bottommultinavigationbar 1.0.2 copy "bottommultinavigationbar: ^1.0.2" to clipboard
bottommultinavigationbar: ^1.0.2 copied to clipboard

outdated

A widget where each fragment has their own navigation history inside the bottom navigation bar

bottommultinavigationbar #

A widget where each fragment has their own navigation history inside the bottom navigation bar

Getting Started #

1. import bottommultinavigationbar #

import 'package:bottommultinavigationbar/bottommultinavigationbar.dart';

2. Create a list of PageNavigators: #

var pages = [
  PageNavigator(
    bottomNavigationIcon: Icon(Icons.ac_unit),
    bottomNavigationText: "Page 1",
    initialRoute: "/page2",
    onGenerateRoute: (settings) {
      if(settings.name == PageNavigator.home)
        return MaterialPageRoute(builder: (_) => Test(test:"Page 1 - 1",index: 0,));
      if(settings.name == "/page2")
        return MaterialPageRoute(builder: (_) => Test(test:"Page 1 - 2",index: 0));
    }
  ),
  PageNavigator(
    bottomNavigationIcon: Icon(Icons.ac_unit),
    bottomNavigationText: "Page 2",
    onGenerateRoute: (settings) {
      if(settings.name == PageNavigator.home)
        return MaterialPageRoute(builder: (_) => Test(test:"Page 2 - 1",index: 1,));
      if(settings.name == "/page2-2")
        return MaterialPageRoute(builder: (_) => Test(test:"Page 2 - 2",index: 1,));
    }
  ),
];

Be sure that you use "/" in your namings like "/page1". PageNavigator.home represents the home page of the fragment. From there the navigator will navigate to your pages inside of the fragment without leaving the bottom navigation view. With the "initialRoute" attribute you can specify a different start point for each of your fragment.

3. Use the BottomMultiNavigationBar Widget #

  @override
  Widget build(BuildContext context) {
    return BottomMultiNavigationBar(
      index: myCounter
      pageNavigators: pages,
      onIndexChanged: (index) {
        setState({
          myCounter = index
        })
      },
    );
  }
2
likes
0
pub points
0%
popularity

Publisher

verified publisheronurozkan.net

A widget where each fragment has their own navigation history inside the bottom navigation bar

Homepage

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on bottommultinavigationbar