CupertinoTabBar class

An iOS-styled bottom navigation tab bar.

Displays multiple tabs using BottomNavigationBarItem with one tab being active, the first tab by default.

This StatelessWidget doesn't store the active tab itself. You must listen to the onTap callbacks and call setState with a new currentIndex for the new selection to reflect.

Tab changes typically trigger a switch between Navigators, each with its own navigation stack, per standard iOS design.

If the given backgroundColor's opacity is not 1.0 (which is the case by default), it will produce a blurring effect to the content behind it.

See also:



CupertinoTabBar({Key key, @required List<BottomNavigationBarItem> items, ValueChanged<int> onTap, int currentIndex: 0, Color backgroundColor: _kDefaultTabBarBackgroundColor, Color activeColor: CupertinoColors.activeBlue, Color inactiveColor: CupertinoColors.inactiveGray, double iconSize: 30.0 })
Creates a tab bar in the iOS style.


activeColor Color
The foreground color of the icon and title for the BottomNavigationBarItem of the selected tab.
backgroundColor Color
The background color of the tab bar. If it contains transparency, the tab bar will automatically produce a blurring effect to the content behind it.
currentIndex → int
The index into items of the current active item. [...]
iconSize → double
The size of all of the BottomNavigationBarItem icons. [...]
inactiveColor Color
The foreground color of the icon and title for the BottomNavigationBarItems in the unselected state.
items → List<BottomNavigationBarItem>
The interactive items laid out within the bottom navigation bar. [...]
onTap ValueChanged<int>
The callback that is called when a item is tapped. [...]
opaque → bool
True if the tab bar's background color has no transparency.
preferredSize Size
The size this widget would prefer if it were otherwise unconstrained. [...]
hashCode → int
The hash code for this object. [...]
read-only, inherited
key Key
Controls how one widget replaces another widget in the tree. [...]
final, inherited
runtimeType → Type
A representation of the runtime type of the object.
read-only, inherited


build(BuildContext context) Widget
Describes the part of the user interface represented by this widget. [...]
copyWith({Key key, List<BottomNavigationBarItem> items, Color backgroundColor, Color activeColor, Color inactiveColor, Size iconSize, int currentIndex, void onTap }) CupertinoTabBar
Create a clone of the current CupertinoTabBar but with provided parameters overridden.
createElement() StatelessElement
Creates a StatelessElement to manage this widget's 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 toStringDeep. [...]
toString({DiagnosticLevel minLevel: DiagnosticLevel.debug }) → String
Returns 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 ==(dynamic other) → bool
The equality operator. [...]