PersistentTabView constructor
PersistentTabView(
- BuildContext context, {
- required List<
Widget> screens, - Key? key,
- List<
PersistentBottomNavBarItem> items = const [], - PersistentTabController? controller,
- EdgeInsets margin = EdgeInsets.zero,
- Color backgroundColor = CupertinoColors.white,
- ValueChanged<
int> ? onItemSelected, - NeumorphicProperties? neumorphicProperties,
- Widget? floatingActionButton,
- EdgeInsets padding = EdgeInsets.zero,
- NavBarDecoration decoration = const NavBarDecoration(),
- bool resizeToAvoidBottomInset = false,
- double? bottomScreenMargin,
- dynamic selectedTabScreenContext()?,
- bool confineToSafeArea = true,
- Future<
bool> onWillPop()?, - HideOnScrollSettings hideOnScrollSettings = const HideOnScrollSettings(),
- bool stateManagement = true,
- bool handleAndroidBackButtonPress = true,
- bool isVisible = true,
- NavBarAnimationSettings animationSettings = const NavBarAnimationSettings(),
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,
);