toJetBottomTabs method

JetTab toJetBottomTabs({
  1. required List<String> tabs,
  2. Widget builder(
    1. BuildContext context,
    2. Widget child,
    3. BottomNavigationBar bottomNav
    )?,
  3. List<BottomNavigationBarItem>? bottomNavItems,
  4. Color? indicatorColor,
  5. Color? selectedItemColor,
  6. Color? unselectedItemColor,
})

Creates a JetTab.router with bottom navigation style.

Implementation

JetTab toJetBottomTabs({
  required List<String> tabs,
  Widget Function(
    BuildContext context,
    Widget child,
    BottomNavigationBar bottomNav,
  )?
  builder,
  List<BottomNavigationBarItem>? bottomNavItems,
  Color? indicatorColor,
  Color? selectedItemColor,
  Color? unselectedItemColor,
}) {
  return JetTab.router(
    routes: this,
    tabs: tabs,
    indicatorColor: indicatorColor,
    labelColor: selectedItemColor,
    unselectedLabelColor: unselectedItemColor,
    builder: builder != null && bottomNavItems != null
        ? (context, child) {
            final tabsRouter = AutoTabsRouter.of(context);
            final bottomNav = BottomNavigationBar(
              currentIndex: tabsRouter.activeIndex,
              onTap: tabsRouter.setActiveIndex,
              selectedItemColor: selectedItemColor,
              unselectedItemColor: unselectedItemColor,
              items: bottomNavItems,
            );
            return builder(context, child, bottomNav);
          }
        : null,
  );
}