tabBar property Null safety

CupertinoTabBar tabBar
final

The tabBar is a CupertinoTabBar drawn at the bottom of the screen that lets the user switch between different tabs in the main content area when present.

The CupertinoTabBar.currentIndex is only used to initialize a CupertinoTabController when no controller is provided. Subsequently providing a different CupertinoTabBar.currentIndex does not affect the scaffold or the tab bar's active tab index. To programmatically change the active tab index, use a CupertinoTabController.

If CupertinoTabBar.onTap is provided, it will still be called. CupertinoTabScaffold automatically also listen to the CupertinoTabBar's onTap to change the controller's index and change the actively displayed tab in CupertinoTabScaffold's own main content area.

If translucent, the main content may slide behind it. Otherwise, the main content's bottom margin will be offset by its height.

By default tabBar has its text scale factor set to 1.0 and does not respond to text scale factor changes from the operating system, to match the native iOS behavior. To override this behavior, wrap each of the tabBar's items inside a MediaQuery with the desired MediaQueryData.textScaleFactor value. The text scale factor value from the operating system can be retrieved int many ways, such as querying MediaQuery.textScaleFactorOf against CupertinoApp's BuildContext.

Must not be null.

Implementation

final CupertinoTabBar tabBar;