CupertinoTabView class Null safety

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:



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.


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


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


operator ==(Object other) bool
The equality operator.
@nonVirtual, inherited