PersistentTabView.custom constructor
const
PersistentTabView.custom(
- BuildContext context, {
- required Widget customWidget,
- required int itemCount,
- required List<
Widget> screens, - Key? key,
- PersistentTabController? controller,
- EdgeInsets margin = EdgeInsets.zero,
- Widget? floatingActionButton,
- bool resizeToAvoidBottomInset = false,
- double? bottomScreenMargin,
- dynamic selectedTabScreenContext()?,
- Color backgroundColor = CupertinoColors.white,
- bool confineInSafeArea = true,
- Future<
bool> onWillPop()?, - bool stateManagement = true,
- bool handleAndroidBackButtonPress = true,
- 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(),
);