This Flutter app demonstrates the use of a SliverAppBar
combined with a CustomScrollView
to create a scrolling effect with multiple sliver items. The app showcases how to implement a flexible, responsive UI with scrollable content and a customizable app bar.
- SliverAppBar: A customizable app bar that scrolls along with the content, with options to pin or float.
- CustomScrollView: Manages multiple sliver items that can be scrolled vertically.
- FlexibleSpaceBar: An expandable app bar with a background image and dynamic title behavior.
- Sliver Items: Multiple
SliverToBoxAdapter
items styled with padding, rounded corners, and different colors.
MyApp
class: Initializes the app and applies the theme.HomePage
class: Implements the core UI, including theCustomScrollView
andSliverAppBar
.- SliverAppBar:
- Floating: The app bar appears as you scroll up.
- Pinned: Optionally pins the app bar so it stays visible at the top.
- FlexibleSpaceBar: Expands or collapses the app bar while scrolling.
- SliverToBoxAdapter: Adds multiple styled containers to the scroll view, each with padding and a background color.
- ExpandedHeight: Modify the
expandedHeight
property ofSliverAppBar
to control how much space it occupies when fully expanded. - Pin/Floating: Toggle the
floating
andpinned
properties ofSliverAppBar
to adjust its behavior during scroll events.
To run this project on your local machine:
- Clone the repository and open it in your IDE:
git clone https://github.com/Bhavyansh03-tech/FlutterTabBar.git
- Run the project on an emulator or a physical device.
flutter run
Contributions are welcome! Please fork the repository and submit a pull request for any improvements or bug fixes.
- Fork the repository.
- Create your feature branch (
git checkout -b feature/your-feature
). - Commit your changes (
git commit -am 'Add some feature'
). - Push to the branch (
git push origin feature/your-feature
). - Create a new Pull Request.
For questions or feedback, please contact @Bhavyansh03-tech on GitHub or connect with me on LinkedIn.