PersistentTabView class

A highly customizable persistent navigation bar for flutter.

To learn more, check out the Readme.

Inheritance
Available extensions

Constructors

PersistentTabView.new(BuildContext context, {required List<Widget> screens, Key? key, List<PersistentBottomNavBarItem> items = const [], PersistentTabController? controller, double navBarHeight = kBottomNavigationBarHeight, 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(BuildContext?)?, bool hideNavigationBarWhenKeyboardAppears = true, PopBehavior popBehaviorOnSelectedNavBarItemPress = PopBehavior.all, bool confineToSafeArea = true, Future<bool> onWillPop(BuildContext?)?, HideOnScrollSettings hideOnScrollSettings = const HideOnScrollSettings(), bool stateManagement = true, bool handleAndroidBackButtonPress = true, bool isVisible = true, NavBarAnimationSettings animationSettings = const NavBarAnimationSettings(), NavBarStyle navBarStyle = NavBarStyle.style1})
PersistentTabView.custom(BuildContext context, {required Widget customWidget, required int itemCount, required List<CustomNavBarScreen> screens, Key? key, PersistentTabController? controller, EdgeInsets margin = EdgeInsets.zero, Widget? floatingActionButton, bool resizeToAvoidBottomInset = false, double? bottomScreenMargin, dynamic selectedTabScreenContext(BuildContext?)?, bool hideNavigationBarWhenKeyboardAppears = true, Color backgroundColor = CupertinoColors.white, bool confineToSafeArea = true, Future<bool> onWillPop(BuildContext?)?, HideOnScrollSettings hideOnScrollSettings = const HideOnScrollSettings(), bool stateManagement = true, bool handleAndroidBackButtonPress = true, bool isVisible = true, NavBarAnimationSettings animationSettings = const NavBarAnimationSettings(), double navBarHeight = kBottomNavigationBarHeight})
const

Properties

animationSettings NavBarAnimationSettings
Screen transition animation properties when switching tabs.
final
backgroundColor Color
Background color of bottom navigation bar. white by default.
final
bottomScreenMargin double?
Bottom margin of the screen.
final
confineToSafeArea 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
customNavBarScreens List<CustomNavBarScreen>
finalinherited
customWidget Widget?
Custom navigation bar widget. 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
hideNavigationBarWhenKeyboardAppears bool
final
hideOnScrollSettings HideOnScrollSettings
When these scroll controllers detect a scroll down motion, the navigation bar hides automatically. A hidden navigation bar appears again when scroll up motion is detected.
final
isCustomWidget bool
finalinherited
isVisible bool
Hides the navigation bar with a transition animation when set to false. Use it in conjunction with Provider for better results.
final
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
finalinherited
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. If you to exit the app make sure to set handleAndroidBackButtonPress as false.
final
padding EdgeInsets
padding for the persistent navigation bar content.
finalinherited
popBehaviorOnSelectedNavBarItemPress PopBehavior
Defines the pop behavior when an already selected nav bar item/tab is pressed.
finalinherited
resizeToAvoidBottomInset bool
final
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.
finalinherited
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

animate({Key? key, List<Effect>? effects, AnimateCallback? onInit, AnimateCallback? onPlay, AnimateCallback? onComplete, bool? autoPlay, Duration? delay, AnimationController? controller, Adapter? adapter, double? target, double? value}) Animate

Available on Widget, provided by the AnimateWidgetExtensions extension

Wraps the target Widget in an Animate instance, and returns the instance for chaining calls. Ex. myWidget.animate() is equivalent to Animate(child: myWidget).
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, int wrapWidth = 65}) 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