bottom_navigator 0.0.5
bottom_navigator: ^0.0.5 copied to clipboard
A premium, glassmorphic bottom navigation bar for Flutter with multiple variants (Floating, Docked, Notched), fluid animations, and automatic item overflow management.
Bottom Navigator #
Current stable release: 0.0.5
A premium, glassmorphic bottom navigation bar for Flutter. Elevate your app's UI with fluid animations, multiple layout variants, and automatic overflow management.
β¨ Features #
- π§ Glassmorphism: Built-in frosted glass effect with customizable blur and opacity.
- π Multiple Variants: Choose between Floating, Docked, Notched, and Classic layouts.
- β‘ Auto-More: Automatically handles item overflow by grouping extra items into a premium "More" menu.
- π¨ Indicator Styles: Support for various selection indicators: Pill, Line, Square, Circle, and None.
- π Scroll Aware: Built-in support for hiding the navigation bar on scroll to maximize screen real estate.
- π¬ Fluid Animations: Smooth transitions and physics-based animations for a premium feel.
- π οΈ Highly Customizable: Fine-tune colors, icons, labels, animation curves, and more.
π Getting Started #
Add the dependency to your pubspec.yaml:
dependencies:
bottom_navigator: ^0.0.5
π οΈ Usage #
Classic Bottom Bar #
ClassicNavBottomBar(
items: [
BottomNavItem(icon: Icons.home, label: 'Home'),
BottomNavItem(icon: Icons.search, label: 'Search'),
BottomNavItem(icon: Icons.favorite, label: 'Likes'),
BottomNavItem(icon: Icons.person, label: 'Profile'),
],
currentIndex: _selectedIndex,
onTap: (index) => setState(() => _selectedIndex = index),
)
Floating Glass Bar #
FloatingNavBottomBar(
items: navItems,
currentIndex: _selectedIndex,
centerButton: FloatingActionButton(
onPressed: () {},
child: Icon(Icons.add),
),
onTap: (index) => setState(() => _selectedIndex = index),
)
Docked Bar #
DockedNavBottomBar(
items: navItems,
currentIndex: _selectedIndex,
onTap: (index) => setState(() => _selectedIndex = index),
)
Notched Bar #
NotchedNavBottomBar(
items: navItems,
currentIndex: _selectedIndex,
onTap: (index) => setState(() => _selectedIndex = index),
)
π¨ Customization #
Badges π΄ #
You can display numeric, text-based, or dot-only badges on your navigation items. Use the badge property in BottomNavItem to pass a BottomNavBadge:
BottomNavItem(
icon: Icons.search,
label: 'Search',
badge: BottomNavBadge(
text: '5',
color: Colors.blue,
textStyle: TextStyle(fontSize: 10, color: Colors.white, fontWeight: FontWeight.bold),
),
)
- Numeric / Text Badges: Pass a string to the
textparameter. - Dot-Only Badges: Omit the
textparameter (or passnull) to render a simple notification dot. - Customization: Change background colors via
color, pass custom text styling viatextStyle, adjust the position usingoffset, or hide it withshowBadge. - Overflow Support: If navigation items overflow into the "More" menu, a dot badge will automatically appear on the "More" button if any of the hidden items have active badges.
Center Button Offset #
You can customize the vertical offset of the center action button using the centerButtonOffset property. By default, it automatically positions the button (-25 pixels for Notched and -30 pixels for Floating/Docked), but you can override this for fine-grained alignment.
FloatingNavBottomBar(
items: navItems,
currentIndex: _selectedIndex,
centerButton: FloatingActionButton(
onPressed: () {},
child: const Icon(Icons.add),
),
centerButtonOffset: -20.0, // Adjust the vertical placement of the button
onTap: (index) => setState(() => _selectedIndex = index),
)
Indicator Styles #
PillIndicatorStyle()LineIndicatorStyle()SquareIndicatorStyle()CircleIndicatorStyle()IndicatorStyle.none
You can also customize the "More" overflow button using moreButtonLabel, moreButtonWidget, and showSelectedMoreItem.
Handling Scroll #
To hide the bar when scrolling, simply provide your ScrollController:
ClassicNavBottomBar(
// ... other properties
hideOnScroll: true,
scrollController: _myScrollController,
)
π Additional Information #
Contributing #
Contributions are welcome! Please feel free to submit a Pull Request.
Issues #
If you encounter any bugs or have feature requests, please file them on the issue tracker.
License #
This project is licensed under the MIT License - see the LICENSE file for details.