persistent_bottom_nav_bar 0.0.1 copy "persistent_bottom_nav_bar: ^0.0.1" to clipboard
persistent_bottom_nav_bar: ^0.0.1 copied to clipboard

outdated

A feature rich persistent bottom navigation bar for flutter

persistent_bottom_nav_bar #

A persistent bottom navigation bar for Flutter.

Features #

  • Persistent Bottom Navigation.
  • Ability to push new screen with or without bottom navigation bar.
  • 8 styles for the bottom navigation bar (includes BottomNavyBar style).
  • Includes function for pushing screen with or without the bottom navigation bar i.e. pushNewScreen() and pushNewScreenWithRouteSettings().
  • Includes platform specific behavior as an option (specify it in the two navigator functions).
  • Based on flutter's Cupertino(iOS) bottom navigation bar.

Example #

Persistent bottom navigation bar uses PersistentTabController as its controller. Here is how to declare it:

PersistentTabController _controller;

_controller = PersistentTabController(initialIndex: 0);

The main widget then to be declared is PersistenTabView. NOTE: This widget includes SCAFFOLD (based on CupertinoTabScaffold), so no need to declare it. Following is an example for demonstration purposes:


class MyApp extends StatelessWidget {
  const MyApp({Key key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return PersistentTabView(
      controller: _controller,
      items: _navBarsItems(),
      screens: _buildScreens(),
      showElevation: true,
      isCurved: false,
      iconSize: 26.0,
      navBarStyle: NavBarStyle.style1, // Choose the nav bar style with this property
      onItemSelected: (index) {
        print(index);
      },
    );
  }
}


    List<Widget> _buildScreens() {
        return [
        HomeScreen(),
        SettingsScreen()
        ];
    }


    List<PersistentBottomNavBarItem> _navBarsItems() {
        return [
        PersistentBottomNavBarItem(
            icon: Icon(CupertinoIcons.home),
            title: ("Home"),
            activeColor: CupertinoColors.activeBlue,
            inactiveColor: CupertinoColors.grey,
        ),
        PersistentBottomNavBarItem(
            icon: Icon(CupertinoIcons.settings),
            title: ("Settings"),
            activeColor: CupertinoColors.activeBlue,
            inactiveColor: CupertinoColors.grey,
        ),
        ];
    }

2071
likes
0
pub points
99%
popularity

Publisher

unverified uploader

A feature rich persistent bottom navigation bar for flutter

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

cupertino_icons, flutter, flutter_device_type

More

Packages that depend on persistent_bottom_nav_bar