getNavBar method

Widget getNavBar(
  1. DeviceType device, {
  2. double? elevation,
  3. Color? appBarColor,
  4. Color? drawerColor,
  5. bool? extendBodyBehindAppBar,
  6. PageIndicator? pageIndicator,
  7. double? indicatorLineThickness,
  8. NavItemPosition? itemPosition,
  9. BoxDecoration? customDecoration,
  10. Widget? drawerHeader,
  11. Widget? drawerBody,
  12. Widget? drawerFooter,
  13. double? navItemSpacing,
  14. NavItemPosition? itemsPosition,
  15. TextStyle? navTextStyle,
  16. bool? showFab,
  17. Widget? title,
  18. String? titleText,
  19. double? height,
  20. Widget? fab,
  21. bool? enableDrawer,
  22. NavDrawerMode? drawerMode,
  23. Color? backgroundColor,
  24. Widget? leading,
  25. List<Widget>? actions,
  26. List<NavItem>? navItems,
  27. AnimationType? navItemAnimation,
})

Implementation

Widget getNavBar(
  DeviceType device, {
      double? elevation,
      Color? appBarColor,
      Color? drawerColor,
      bool? extendBodyBehindAppBar,
      PageIndicator? pageIndicator,
      double? indicatorLineThickness,
      NavItemPosition? itemPosition,
      BoxDecoration? customDecoration,
      Widget? drawerHeader,
      Widget? drawerBody,
      Widget? drawerFooter,
      double? navItemSpacing,
      NavItemPosition? itemsPosition,
      TextStyle? navTextStyle,
  bool? showFab,
  Widget? title,
  String? titleText,
  double? height,
  Widget? fab,
  bool? enableDrawer,
  NavDrawerMode? drawerMode,
  Color? backgroundColor,
  Widget? leading,
  List<Widget>? actions,
  List<NavItem>? navItems,
      AnimationType? navItemAnimation
}) {
  Widget child = Container();
  switch (device) {
    case DeviceType.mobile:
      child = MobNavBar(
          title: title ?? this.title,
          navItems: items,
          fab: fab ?? this.fab,
          showFab: showFab ?? this.showFab,
          body: body,
          navItemAnimation: navItemAnimation ?? this.navItemAnimation,
          extendBodyBehindAppBar: extendBodyBehindAppBar ?? this.extendBodyBehindAppBar,
          elevation: elevation ?? this.elevation,
          customDecoration: customDecoration??this.customDecoration,
          drawerBody: drawerBody??this.drawerBody,
          drawerFooter: drawerFooter??this.drawerFooter,
          drawerHeader: drawerHeader??this.drawerHeader,
          indicatorLineThickness: indicatorLineThickness ?? this.indicatorLineThickness,
          pageIndicator: pageIndicator ?? this.pageIndicator,
          navItemSpacing: navItemSpacing ?? this.navItemSpacing,
          MAX_PAGE_WIDTH: MAX_PAGE_WIDTH,
          itemPosition: itemsPosition ?? this.itemsPosition,
          drawerMode: drawerMode ?? this.drawerMode,
          height: height ?? this.height,
          navTextStyle: navTextStyle ?? this.navTextStyle,
          titleText: titleText ?? this.titleText,
          appBarColor: appBarColor ?? this.appBarColor,
          drawerColor: drawerColor ?? this.drawerColor,
          backgroundColor: backgroundColor ?? this.backgroundColor,
          actions: actions ?? this.actions,
          leading: leading ?? this.leading);
      break;
    default:
      child = DefaultNavBar(
          title: title ?? this.title,
          items: items,
          fab: fab ?? this.fab,
          enableDrawer: enableDrawer ??this.enableDrawer,
          showFab: showFab ?? this.showFab,
          body: body,
          navItemAnimation: navItemAnimation ?? this.navItemAnimation,
          extendBodyBehindAppBar: extendBodyBehindAppBar ?? this.extendBodyBehindAppBar,
          elevation: elevation ?? this.elevation,
          customDecoration: customDecoration??this.customDecoration,
          drawerBody: drawerBody??this.drawerBody,
          drawerFooter: drawerFooter??this.drawerFooter,
          drawerHeader: drawerHeader??this.drawerHeader,
          indicatorLineThickness: indicatorLineThickness ?? this.indicatorLineThickness,
          pageIndicator: pageIndicator ?? this.pageIndicator,
          navItemSpacing: navItemSpacing ?? this.navItemSpacing,
          MAX_PAGE_WIDTH: MAX_PAGE_WIDTH,
          itemPosition: itemsPosition ?? this.itemsPosition,
          drawerMode: drawerMode ?? this.drawerMode,
          height: height ?? this.height,
          navTextStyle: navTextStyle ?? this.navTextStyle,
          titleText: titleText ?? this.titleText,
          appBarColor: appBarColor ?? this.appBarColor,
          drawerColor: drawerColor ?? this.drawerColor,
          backgroundColor: backgroundColor ?? this.backgroundColor,
          actions: actions ?? this.actions,
          leading: leading ?? this.leading);
      break;
  }
  return PageTrackerContext<int>(child: child, currentData: 0);
}