PersistentTabView.custom constructor
PersistentTabView.custom(
- BuildContext context, {
- Key? key,
- List<
PersistentBottomNavBarItem> ? items, - required List<
Widget> screens, - PersistentTabController? controller,
- EdgeInsets margin = EdgeInsets.zero,
- Widget? floatingActionButton,
- required Widget customWidget(),
- required int itemCount,
- bool resizeToAvoidBottomInset = false,
- double? bottomScreenMargin,
- dynamic selectedTabScreenContext()?,
- bool popAllScreensOnTapOfSelectedTab = true,
- Color backgroundColor = CupertinoColors.white,
- bool confineInSafeArea = true,
- Future<
bool> onWillPop()?, - bool stateManagement = true,
- bool handleAndroidBackButtonPress = true,
- ScreenTransitionAnimation screenTransitionAnimation = const ScreenTransitionAnimation(),
Implementation
PersistentTabView.custom(
this.context, {
Key? key,
List<PersistentBottomNavBarItem>? items,
required this.screens,
this.controller,
this.margin = EdgeInsets.zero,
this.floatingActionButton,
required Widget Function(NavBarEssentials) customWidget,
required int itemCount,
this.resizeToAvoidBottomInset = false,
this.bottomScreenMargin,
this.selectedTabScreenContext,
this.hideNavigationBarWhenKeyboardShows = true,
bool popAllScreensOnTapOfSelectedTab = true,
this.backgroundColor = CupertinoColors.white,
CustomWidgetRouteAndNavigatorSettings routeAndNavigatorSettings = const CustomWidgetRouteAndNavigatorSettings(),
this.confineInSafeArea = true,
this.onWillPop,
this.stateManagement = true,
this.handleAndroidBackButtonPress = true,
this.hideNavigationBar,
this.screenTransitionAnimation = const ScreenTransitionAnimation(),
}) : super(
key: key,
context: context,
items: items,
screens: screens,
controller: controller,
margin: margin,
routeAndNavigatorSettings: routeAndNavigatorSettings,
backgroundColor: backgroundColor,
floatingActionButton: floatingActionButton,
customWidget: customWidget,
itemCount: itemCount,
resizeToAvoidBottomInset: resizeToAvoidBottomInset,
popAllScreensOnTapOfSelectedTab: popAllScreensOnTapOfSelectedTab,
bottomScreenMargin: bottomScreenMargin,
onWillPop: onWillPop,
confineInSafeArea: confineInSafeArea,
stateManagement: stateManagement,
handleAndroidBackButtonPress: handleAndroidBackButtonPress,
hideNavigationBar: hideNavigationBar,
screenTransitionAnimation: screenTransitionAnimation,
isCustomWidget: true,
decoration: NavBarDecoration(
colorBehindNavBar: backgroundColor
),
) {
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(
routeAndNavigatorSettings.navigatorKeys == null ||
routeAndNavigatorSettings.navigatorKeys != null &&
routeAndNavigatorSettings.navigatorKeys!.length != items!.length,
"Number of 'Navigator Keys' must be equal to the number of bottom navigation tabs.");
}