PersistentTabView class

A highly customizable persistent navigation bar for flutter.

To learn more, check out the Readme.

Inheritance

Constructors

PersistentTabView(BuildContext context, {Key? key, List<PersistentBottomNavBarItem>? items, required List<Widget> screens, PersistentTabController? controller, double navBarHeight = kBottomNavigationBarHeight, EdgeInsets margin = EdgeInsets.zero, Color backgroundColor = CupertinoColors.white, ValueChanged<int>? onItemSelected, NeumorphicProperties? neumorphicProperties, Widget? floatingActionButton, NavBarPadding padding = const NavBarPadding.all(null), NavBarDecoration decoration = const NavBarDecoration(), bool resizeToAvoidBottomInset = false, double? bottomScreenMargin, dynamic selectedTabScreenContext(BuildContext?)?, bool hideNavigationBarWhenKeyboardShows = true, bool popAllScreensOnTapOfSelectedTab = true, PopActionScreensType popActionScreens = PopActionScreensType.all, bool confineInSafeArea = true, Future<bool> onWillPop(BuildContext?)?, bool stateManagement = true, bool handleAndroidBackButtonPress = true, ItemAnimationProperties? itemAnimationProperties, bool? hideNavigationBar, ScreenTransitionAnimation screenTransitionAnimation = const ScreenTransitionAnimation(), NavBarStyle navBarStyle = NavBarStyle.style1})
PersistentTabView.custom(BuildContext context, {Key? key, List<PersistentBottomNavBarItem>? items, required List<Widget> screens, PersistentTabController? controller, EdgeInsets margin = EdgeInsets.zero, Widget? floatingActionButton, required Widget customWidget(NavBarEssentials), required int itemCount, bool resizeToAvoidBottomInset = false, double? bottomScreenMargin, dynamic selectedTabScreenContext(BuildContext?)?, bool hideNavigationBarWhenKeyboardShows = true, bool popAllScreensOnTapOfSelectedTab = true, Color backgroundColor = CupertinoColors.white, CustomWidgetRouteAndNavigatorSettings routeAndNavigatorSettings = const CustomWidgetRouteAndNavigatorSettings(), bool confineInSafeArea = true, Future<bool> onWillPop(BuildContext?)?, bool stateManagement = true, bool handleAndroidBackButtonPress = true, bool? hideNavigationBar, ScreenTransitionAnimation screenTransitionAnimation = const ScreenTransitionAnimation()})

Properties

backgroundColor Color
Background color of bottom navigation bar. white by default.
final
bottomScreenMargin double?
Bottom margin of the screen.
final
confineInSafeArea bool
Will confine the NavBar's items in the safe area defined by the device.
final
context BuildContext
final
controller PersistentTabController?
Controller for persistent bottom navigation bar. Will be declared if left empty.
final
customWidget → (Widget Function(NavBarEssentials)?)
Custom navigation bar widget builder. To be only used when navBarStyle is set to NavBarStyle.custom.
finalinherited
decoration NavBarDecoration?
Specifies the curve properties of the NavBar.
finalinherited
floatingActionButton Widget?
A custom widget which is displayed at the bottom right of the display at all times.
final
handleAndroidBackButtonPress bool
Handles android back button actions. Defaults to true.
final
hashCode int
The hash code for this object.
no setterinherited
hideNavigationBar bool?
Hides the navigation bar with an transition animation. Use it in conjuction with Provider for better results.
final
hideNavigationBarWhenKeyboardShows bool
final
isCustomWidget bool?
finalinherited
itemAnimationProperties ItemAnimationProperties?
This controls the animation properties of the items of the NavBar.
finalinherited
itemCount int?
If using custom navBarStyle, define this instead of the items property
finalinherited
items List<PersistentBottomNavBarItem>?
List of persistent bottom navigation bar items to be displayed in the navigation bar.
finalinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
margin EdgeInsets
Specifies the navBarHeight
final
Specifies the navBarHeight
finalinherited
Style for persistent bottom navigation bar. Accepts NavBarStyle to determine the theme.
finalinherited
neumorphicProperties NeumorphicProperties?
Style the neumorphic navigation bar item.
finalinherited
onItemSelected ValueChanged<int>?
Callback when page or tab change is detected.
finalinherited
onWillPop → (Future<bool> Function(BuildContext?)?)
If you want to perform a custom action on Android when exiting the app, you can write your logic here. Returns context of the selected screen.
final
padding NavBarPadding?
padding for the persistent navigation bar content. Accepts NavBarPadding instead of EdgeInsets.
finalinherited
popActionScreens PopActionScreensType?
If set all pop until to first screen else set once pop once
finalinherited
popAllScreensOnTapOfSelectedTab bool?
If an already selected tab is pressed/tapped again, all the screens pushed on that particular tab will pop until the first screen in the stack. Defaults to true.
finalinherited
resizeToAvoidBottomInset bool
final
routeAndNavigatorSettings CustomWidgetRouteAndNavigatorSettings?
Define navigation bar route name and settings here.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
screens List<Widget>
Screens that will be displayed on tapping of persistent bottom navigation bar items.
final
screenTransitionAnimation ScreenTransitionAnimation
Screen transition animation properties when switching tabs.
final
selectedTabScreenContext → (dynamic Function(BuildContext?)?)
Returns the context of the selected tab.
final
stateManagement bool
Preserves the state of each tab's screen. true by default.
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → _PersistentTabViewState
Creates the mutable state for this widget at a given location in the tree.
inherited
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited