custom_navigation_bar 0.3.2

Flutter Android iOS web

A custom navigation bar with bubble click effect. Inspired by The Boring Flutter Development Show EP. 35.

custom_navigation_bar #

A custom navigation bar with bubble click effect.

pub package License: MIT

Overview #

This project is inspired by this post from Dribbble and The Boring Flutter Development Show, Ep. 35

This package gives you a cute bubble effect when you click on the navigation bar.

Dribbble:

Implemented:

How to install #

Add this to your package's pubspec.yaml file:

dependencies:
  custom_navigation_bar: ^0.3.2

Documentation #

You can customize these attributes in the navigation bar.

AttributesTypeDescriptionDefault
scaleFactordoublescale factor for the icon scale animation.0.2
elevationdoubleThe z-coordinate of this CustomNavigationBar8.0
itemsListitem data in CustomNavigationBarrequired
selectedColorColor[Color] when [CustomNavigationBarItem] is selected[blueAccent]
unSelectedColorColor[Color] when [CustomNavigationBarItem] is not selected.grey[600]
onTapFunction(int)callback function when item tappednull
currentIndexintcurrent index of navigation bar.0
iconSizedoublesize of icon. also represent the max radius of bubble effect animation.24.0
backgroundColorColorBackground color of [CustomNavigationBar]Colors.white
strokeColorColorstroke colorblueAccent
bubbleCurveCurveanimation curve of bubble effectlinear
scaleCurveCurveanimation curve of scale effectlinear
borderRadiusRadiusborder radius of navigation barRadius.zero
isFloatingboolcontrol if CustomNavigationBar is floatingfalse

And for customize icon in the navigation bar, just put the icons you want in the CustomNavigationBarItem like this.

CustomNavigationBar(
        ...
        items: [
          CustomNavigationBarItem(
            icon: Icons.home,
          ),
          CustomNavigationBarItem(
            icon: Icons.shopping_cart,
          ),
          CustomNavigationBarItem(
            icon: Icons.lightbulb_outline,
          ),
          CustomNavigationBarItem(
            icon: Icons.search,
          ),
          CustomNavigationBarItem(
            icon: Icons.account_circle,
          ),
        ],
        ...
      )

Attention: If you set isFloating to true, I would recommand you to set extendBody to true in Scaffold for a better performance.

Example #

Check example app for more details.

Future Plans #

  • [x] Code format
  • [x] Make it more like native navigation bar in Flutter.
  • [x] Better documentation
  • [ ] More customizations!! And more...
39
likes
110
pub points
85%
popularity

A custom navigation bar with bubble click effect. Inspired by The Boring Flutter Development Show EP. 35.

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

chaoxiangwen@gmail.com

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on custom_navigation_bar