PersistentTabView.custom constructor

const PersistentTabView.custom(
  1. BuildContext context, {
  2. required Widget customWidget,
  3. required int itemCount,
  4. required List<Widget> screens,
  5. Key? key,
  6. PersistentTabController? controller,
  7. EdgeInsets margin = EdgeInsets.zero,
  8. Widget? floatingActionButton,
  9. bool resizeToAvoidBottomInset = false,
  10. double? bottomScreenMargin,
  11. dynamic selectedTabScreenContext(
    1. BuildContext?
    )?,
  12. bool hideNavigationBarWhenKeyboardShows = true,
  13. Color backgroundColor = CupertinoColors.white,
  14. CustomWidgetRouteAndNavigatorSettings routeAndNavigatorSettings = const CustomWidgetRouteAndNavigatorSettings(),
  15. bool confineInSafeArea = true,
  16. Future<bool> onWillPop(
    1. BuildContext?
    )?,
  17. bool stateManagement = true,
  18. bool handleAndroidBackButtonPress = true,
  19. bool? hideNavigationBar,
  20. ScreenTransitionAnimation screenTransitionAnimation = const ScreenTransitionAnimation(),
})

Implementation

const PersistentTabView.custom(
  this.context, {
  required final Widget customWidget,
  required final int itemCount,
  required this.screens,
  final Key? key,
  this.controller,
  this.margin = EdgeInsets.zero,
  this.floatingActionButton,
  this.resizeToAvoidBottomInset = false,
  this.bottomScreenMargin,
  this.selectedTabScreenContext,
  this.hideNavigationBarWhenKeyboardShows = true,
  this.backgroundColor = CupertinoColors.white,
  final CustomWidgetRouteAndNavigatorSettings routeAndNavigatorSettings =
      const CustomWidgetRouteAndNavigatorSettings(),
  this.confineInSafeArea = true,
  this.onWillPop,
  this.stateManagement = true,
  this.handleAndroidBackButtonPress = true,
  this.hideNavigationBar,
  this.screenTransitionAnimation = const ScreenTransitionAnimation(),
})  : assert(itemCount == screens.length,
          "screens and items length should be same. If you are using the onPressed callback function of 'PersistentBottomNavBarItem', enter a dummy screen like Container() in its place in the screens"),
      assert(handleAndroidBackButtonPress && onWillPop != null,
          "If you declare the onWillPop function, you will have to handle the back function functionality yourself as your onWillPop function will override the defualt function."),
      super(
        key: key,
        context: context,
        screens: screens,
        controller: controller,
        margin: margin,
        routeAndNavigatorSettings: routeAndNavigatorSettings,
        backgroundColor: backgroundColor,
        floatingActionButton: floatingActionButton,
        customWidget: customWidget,
        itemCount: itemCount,
        resizeToAvoidBottomInset: resizeToAvoidBottomInset,
        bottomScreenMargin: bottomScreenMargin,
        onWillPop: onWillPop,
        confineInSafeArea: confineInSafeArea,
        stateManagement: stateManagement,
        handleAndroidBackButtonPress: handleAndroidBackButtonPress,
        hideNavigationBar: hideNavigationBar,
        screenTransitionAnimation: screenTransitionAnimation,
        isCustomWidget: true,
        decoration: const NavBarDecoration(),
      );