BottomNavLayout class

BottomNavLayout is a quick and powerful layout tool. You can create an app with fluent bottom bar behavior in less than 15 lines. It coordinates all behavior regarding bottom nav bar and app's top level destinations.

BottomNavLayout layout consists of a Scaffold. which shows one of the pages inside Scaffold.body and has a bottom navbar as Scaffold.bottomNavigationBar. Bottom navbar controls which one of the pages is currently visible.

Inheritance

Constructors

BottomNavLayout({Key? key, required List<PageBuilder> pages, required Widget bottomNavigationBar(int, dynamic (int)), bool savePageState = false, bool lazyLoadPages = false, PageStack? pageStack, bool extendBody = false, bool resizeToAvoidBottomInset = true, PageTransitionData? pageTransitionData})

Properties

bottomNavigationBar Widget Function(int, dynamic (int))
The bottom navbar of the layout.
final
extendBody bool
Passed to Scaffold.extendBody. Default is false.
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
lazyLoadPages bool
When false, pages are created on layout creation. When true, pages are created when they are navigated for the first time.
final
pages List<PageBuilder>
The app's destinations. Each destination corresponds to one bottom navbar item. You can navigate between these destinations using bottom navbar items.
final
pageStack PageStack?
Keeps track of which tabs are navigated in what order. Default is ReorderToFrontPageStack for Android and NoPageStack for iOS. There are other stack implementations. You can also implement your own.
final
pageTransitionData PageTransitionData?
Page transition data delegate. If null, no transition is applied.
final
resizeToAvoidBottomInset bool
Passed to Scaffold.resizeToAvoidBottomInset. Default is true.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
savePageState bool
When false, the pages are reinitialized every time they are navigated to. (Material Design behavior) When true, the pages are initialized once and hidden/shown on navigation. (Cupertino behavior)
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<StatefulWidget>
Creates the mutable state for this widget at a given location in the tree.
override
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