PersistentTabView constructor

PersistentTabView(
  1. BuildContext context, {
  2. required List<Widget> screens,
  3. Key? key,
  4. List<PersistentBottomNavBarItem> items = const [],
  5. PersistentTabController? controller,
  6. double navBarHeight = kBottomNavigationBarHeight,
  7. EdgeInsets margin = EdgeInsets.zero,
  8. Color backgroundColor = CupertinoColors.white,
  9. ValueChanged<int>? onItemSelected,
  10. NeumorphicProperties? neumorphicProperties,
  11. Widget? floatingActionButton,
  12. EdgeInsets padding = EdgeInsets.zero,
  13. NavBarDecoration decoration = const NavBarDecoration(),
  14. bool resizeToAvoidBottomInset = false,
  15. double? bottomScreenMargin,
  16. dynamic selectedTabScreenContext(
    1. BuildContext?
    )?,
  17. bool hideNavigationBarWhenKeyboardAppears = true,
  18. PopBehavior popBehaviorOnSelectedNavBarItemPress = PopBehavior.all,
  19. bool confineToSafeArea = true,
  20. Future<bool> onWillPop(
    1. BuildContext?
    )?,
  21. HideOnScrollSettings hideOnScrollSettings = const HideOnScrollSettings(),
  22. bool stateManagement = true,
  23. bool handleAndroidBackButtonPress = true,
  24. bool isVisible = true,
  25. NavBarAnimationSettings animationSettings = const NavBarAnimationSettings(),
  26. NavBarStyle navBarStyle = NavBarStyle.style1,
})

Implementation

PersistentTabView(this.context,
    {required final List<Widget> screens,
    final Key? key,
    final List<PersistentBottomNavBarItem> items = const [],
    this.controller,
    final double navBarHeight = kBottomNavigationBarHeight,
    this.margin = EdgeInsets.zero,
    this.backgroundColor = CupertinoColors.white,
    final ValueChanged<int>? onItemSelected,
    final NeumorphicProperties? neumorphicProperties,
    this.floatingActionButton,
    final EdgeInsets padding = EdgeInsets.zero,
    final NavBarDecoration decoration = const NavBarDecoration(),
    this.resizeToAvoidBottomInset = false,
    this.bottomScreenMargin,
    this.selectedTabScreenContext,
    this.hideNavigationBarWhenKeyboardAppears = true,
    // final MainAxisAlignment navBarItemsAlignment = MainAxisAlignment.spaceAround,
    final PopBehavior popBehaviorOnSelectedNavBarItemPress = PopBehavior.all,
    this.confineToSafeArea = true,
    this.onWillPop,
    this.hideOnScrollSettings = const HideOnScrollSettings(),
    this.stateManagement = true,
    this.handleAndroidBackButtonPress = true,
    this.isVisible = true,
    // this.navBarPosition = NavBarPosition.bottom,
    this.animationSettings = const NavBarAnimationSettings(),
    final NavBarStyle navBarStyle = NavBarStyle.style1})
    : assert(assertMidButtonStyles(navBarStyle, items.length),
          "NavBar styles 15-18 only accepts the property `List<PersistentBottomNavBarItem> items` with 3 or 5 length."),
      assert(items.length == 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(items.length >= 2 && items.length <= 6,
          "NavBar should have at least 2 or maximum 6 items (Except for styles 15-18)"),
      super(
        key: key,
        context: context,
        screens: screens,
        controller: controller,
        margin: margin,
        items: items,
        padding: padding,
        decoration: decoration,
        hideOnScrollSettings: hideOnScrollSettings,
        hideNavigationBarWhenKeyboardAppears:
            hideNavigationBarWhenKeyboardAppears,
        animationSettings: animationSettings,
        navBarStyle: navBarStyle,
        navBarItemsAlignment: MainAxisAlignment.spaceAround,
        popBehaviorOnSelectedNavBarItemPress:
            popBehaviorOnSelectedNavBarItemPress,
        navBarHeight: navBarHeight,
        backgroundColor: backgroundColor,
        onItemSelected: onItemSelected,
        neumorphicProperties: neumorphicProperties,
        floatingActionButton: floatingActionButton,
        resizeToAvoidBottomInset: resizeToAvoidBottomInset,
        bottomScreenMargin: bottomScreenMargin,
        onWillPop: onWillPop,
        isCustomWidget: false,
        confineToSafeArea: confineToSafeArea,
        stateManagement: stateManagement,
        handleAndroidBackButtonPress: handleAndroidBackButtonPress,
        isVisible: isVisible,
        navBarPosition: NavBarPosition.bottom,
      );