fancy_bottom_navigation 0.3.2

  • Readme
  • Changelog
  • Example
  • Installing
  • 97

FancyBottomNavigation #

Fancy Gif

Getting Started #

Add the plugin (pub coming soon):

  fancy_bottom_navigation: ^0.3.2

Limitations #

For now this is limited to more than 1 tab, and less than 5. So 2-4 tabs.

Basic Usage #

Adding the widget

bottomNavigationBar: FancyBottomNavigation(
    tabs: [
        TabData(iconData: Icons.home, title: "Home"),
        TabData(iconData:, title: "Search"),
        TabData(iconData: Icons.shopping_cart, title: "Basket")
    onTabChangedListener: (position) {
        setState(() {
        currentPage = position;

TabData #

iconData -> Icon to be used for the tab title -> String to be used for the tab onClick -> Optional function to be used when the circle itself is clicked, on an active tab

Attributes #

required #

tabs -> List of TabData objects<br/> onTabChangedListener -> Function to handle a tap on a tab, receives int position

optional #

initialSelection -> Defaults to 0<br/> circleColor -> Defaults to null, derives from Theme<br/> activeIconColor -> Defaults to null, derives from Theme<br/> inactiveIconColor -> Defaults to null, derives from Theme<br/> taxtColor -> Defaults to null, derives from Theme<br/> barBackgroundColor -> Defaults to null, derives from Theme<br/> key -> Defaults to null<br/>

Theming #

The bar will attempt to use your current theme out of the box, however you may want to theme it. Here are the attributes:

Fancy Theming

Programmatic Selection #

To select a tab programmatically you will need to assign a GlobalKey to the widget. When you want to change tabs you will need to access the State using this key, and then call setPage(position).<br/> See example project, main.dart, line 75 for an example.

Showcase #

Using this package in a live app, let me know and I'll add you app here.

Inspiration #

This package was inspired by a design on dribbble by Manoj Rajput:<br/>

Contributing #

Contributions are welcome, please submit a PR :)

[0.3.2] - Add optional click to active tab circle

  • Contributed by TheWithz, thanks. The circle can have a click event when active.

[0.3.1] - Fix wrong icon bug

  • Fixes bug where wrong icon is shown when navigating away and back

[0.3.0] - Remove Overlay widget causing huge problems

  • Removed Overlay widget
  • Added test
  • Changes to constructor, as RouteObserver is no longer needed.

[0.2.0] - Bug fixes, and new functionality

  • Breaking change!! Widget now requires a RouteObserver
  • Fixes bug where the active tabs circle is left on screen when navigating away
  • Adds key to the Widget to enable programmatic selection.

[0.1.1] - Small change to constructor

  • No longer required BuildContext to be passed.
  • Moves some init code outside initState

[0.1.0] - Initial Beta Release

  • Beta release


example #

A new Flutter application.

Getting Started #

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Use this package as a library

1. Depend on it

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

  fancy_bottom_navigation: ^0.3.2

2. Install it

You can install packages from the command line:

with Flutter:

$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:fancy_bottom_navigation/fancy_bottom_navigation.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Nov 15, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.6.0
  • pana: 0.12.21
  • Flutter: 1.9.1+hotfix.6


Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health suggestions

Fix lib/fancy_bottom_navigation.dart. (-1 points)

Analysis of lib/fancy_bottom_navigation.dart reported 2 hints:

line 226 col 5: The class 'Future' wasn't exported from 'dart:core' until version 2.1, but this code is required to be able to run on earlier versions.

line 231 col 7: The class 'Future' wasn't exported from 'dart:core' until version 2.1, but this code is required to be able to run on earlier versions.

Format lib/internal/tab_item.dart.

Run flutter format to format lib/internal/tab_item.dart.

Format lib/paint/half_clipper.dart.

Run flutter format to format lib/paint/half_clipper.dart.

Format lib/paint/half_painter.dart.

Run flutter format to format lib/paint/half_painter.dart.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0
flutter 0.0.0
vector_math ^2.0.8 2.0.8
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.7 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
Dev dependencies
mockito ^4.0.0