toJetBottomTabs method
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,
);
}