CupertinoTabView class

A single tab view with its own Navigator state and history.

A typical tab view is used as the content of each tab in a CupertinoTabScaffold where multiple tabs with parallel navigation states and history can co-exist.

CupertinoTabView configures the top-level Navigator to search for routes in the following order:

  1. For the / route, the builder property, if non-null, is used.

  2. Otherwise, the routes table is used, if it has an entry for the route, including / if builder is not specified.

  3. Otherwise, onGenerateRoute is called, if provided. It should return a non-null value for any valid route not handled by builder and routes.

  4. Finally if all else fails onUnknownRoute is called.

These navigation properties are not shared with any sibling CupertinoTabView nor any ancestor or descendant Navigator instances.

To push a route above this CupertinoTabView instead of inside it (such as when showing a dialog on top of all tabs), use Navigator.of(rootNavigator: true).

See also:

Inheritance

Constructors

CupertinoTabView({Key? key, WidgetBuilder? builder, GlobalKey<NavigatorState>? navigatorKey, String? defaultTitle, Map<String, WidgetBuilder>? routes, RouteFactory? onGenerateRoute, RouteFactory? onUnknownRoute, List<NavigatorObserver> navigatorObservers = const <NavigatorObserver>[], String? restorationScopeId})
Creates the content area for a tab in a CupertinoTabScaffold.
const

Properties

builder WidgetBuilder?
The widget builder for the default route of the tab view (Navigator.defaultRouteName, which is /).
final
defaultTitle String?
The title of the default route.
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
A key to use when building this widget's Navigator.
final
The list of observers for the Navigator created in this tab view.
final
onGenerateRoute RouteFactory?
The route generator callback used when the tab view is navigated to a named route.
final
onUnknownRoute RouteFactory?
Called when onGenerateRoute also fails to generate a route.
final
restorationScopeId String?
Restoration ID to save and restore the state of the Navigator built by this CupertinoTabView.
final
routes Map<String, WidgetBuilder>?
This tab view's routing table.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<CupertinoTabView>
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, 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