fancy_bottom_navigation 0.3.1

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • new87

FancyBottomNavigation

Fancy Gif

Getting Started

Add the plugin (pub coming soon):

dependencies:
  ...
  fancy_bottom_navigation: ^0.3.1

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: Icons.search, title: "Search"),
        TabData(iconData: Icons.shopping_cart, title: "Basket")
    ],
    onTabChangedListener: (position) {
        setState(() {
        currentPage = position;
        });
    },
)

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.

Inspiration

This package was inspired by a design on dribbble by Manoj Rajput:<br/> https://dribbble.com/shots/5419022-Tab

Contributing

Contributions are welcome, please submit a PR :)

[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/README.md

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:


dependencies:
  fancy_bottom_navigation: ^0.3.1

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter packages get

Alternatively, your editor might support flutter packages 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';
  
Version Uploaded Documentation Archive
0.3.1 Jan 11, 2019 Go to the documentation of fancy_bottom_navigation 0.3.1 Download fancy_bottom_navigation 0.3.1 archive
0.3.0 Jan 11, 2019 Go to the documentation of fancy_bottom_navigation 0.3.0 Download fancy_bottom_navigation 0.3.0 archive
0.2.0 Jan 10, 2019 Go to the documentation of fancy_bottom_navigation 0.2.0 Download fancy_bottom_navigation 0.2.0 archive
0.1.1 Jan 6, 2019 Go to the documentation of fancy_bottom_navigation 0.1.1 Download fancy_bottom_navigation 0.1.1 archive
0.1.0 Jan 5, 2019 Go to the documentation of fancy_bottom_navigation 0.1.0 Download fancy_bottom_navigation 0.1.0 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
74
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
87
Learn more about scoring.

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

  • Dart: 2.1.0
  • pana: 0.12.10
  • Flutter: 1.1.7

Platforms

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 225 col 5: The class 'Future' was not exported from 'dart:core' until version 2.1, but this code is required to be able to run on earlier versions.

line 230 col 7: The class 'Future' was not 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.

Dependencies

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
meta 1.1.6 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
Dev dependencies
flutter_test
mockito ^4.0.0