CupertinoTabPage class

A page used to manage a CupertinoTabBar and its child routes.

Example:

final tabState = CupertinoTabPage.of(context);
final scaffold = CupertinoTabScaffold(
  controller: tabState.controller,
  tabBuilder: tabState.tabBuilder,
  tabBar: CupertinoTabBar(
    items: [
      BottomNavigationBarItem(
        label: 'Feed',
        icon: Icon(CupertinoIcons.list_bullet),
      ),
      BottomNavigationBarItem(
        label: 'Settings',
        icon: Icon(CupertinoIcons.search),
      ),
    ],
  ),
);
Inheritance
Mixed in types

Constructors

CupertinoTabPage({required Widget child, required List<String> paths, Page pageBuilder(Widget child) = _defaultPageBuilder, TabBackBehavior backBehavior = TabBackBehavior.none})
Initializes the page with a list of child paths.
const

Properties

arguments Object?
The arguments passed to this route.
finalinherited
backBehavior TabBackBehavior
Specifies how tabs behave when used with the system back button.
final
child Widget
The child Widget that will display the CupertinoTabBar.
final
hashCode int
The hash code for this object.
no setterinherited
key LocalKey?
The key associated with this page.
finalinherited
name String?
The name of the route (e.g., "/settings").
finalinherited
pageBuilder Page Function(Widget child)
Optional function to customize the Page created for this route. If this is null, a MaterialPage is used.
final
paths List<String>
A list of the child paths. These can be relative (for example 'one') or absolute (for example '/tabs/one').
final
restorationId String?
Restoration ID to save and restore the state of the Route configured by this page.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

canUpdate(Page other) bool
Whether this page can be updated with the other page.
inherited
createRoute(BuildContext context) Route<void>
Creates the Route that corresponds to this page.
inherited
createState() PageState<StatefulPage>
Returns a state object for this page.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

of(BuildContext context) CupertinoTabPageState
Retrieves the nearest CupertinoTabPageState ancestor.