PersistentTabView class
A highly customizable persistent navigation bar for flutter.
To learn more, check out the Readme.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- PersistentTabViewBase
- PersistentTabView
Constructors
-
PersistentTabView(BuildContext context, {required List<
Widget> screens, Key? key, List<PersistentBottomNavBarItem> ? items, PersistentTabController? controller, 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 popAllScreensOnTapOfSelectedTab = true, bool popAllScreensOnTapAnyTabs = false, PopActionScreensType popActionScreens = PopActionScreensType.all, bool confineInSafeArea = true, Future<bool> onWillPop(BuildContext?)?, bool stateManagement = true, bool handleAndroidBackButtonPress = true, ItemAnimationProperties? itemAnimationProperties, ScreenTransitionAnimation screenTransitionAnimation = const ScreenTransitionAnimation(), }) -
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(BuildContext?)?, Color backgroundColor = CupertinoColors.white, bool confineInSafeArea = true, Future<bool> onWillPop(BuildContext?)?, bool stateManagement = true, bool handleAndroidBackButtonPress = true, ScreenTransitionAnimation screenTransitionAnimation = const ScreenTransitionAnimation()}) -
const
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?
-
Custom navigation bar widget. To be only used when
navBarStyle
is set toNavBarStyle.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
-
Hides the navigation bar with an transition animation. Use it in conjuction with Provider for better results.
final
-
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 theitems
propertyfinalinherited -
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. AcceptsNavBarPadding
instead ofEdgeInsets
.finalinherited - popActionScreens → PopActionScreensType?
-
If set all pop until to first screen else set once pop once
finalinherited
- popAllScreensOnTapAnyTabs → bool?
-
All the screens pushed on that particular tab will pop until the first screen in the stack, whether the tab is already selected or not. Defaults to
false
.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
-
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