CupertinoTabBar constructor Null safety
- {Key? key,
- required List<
BottomNavigationBarItem> items, - ValueChanged<
int> ? onTap, - int currentIndex = 0,
- Color? backgroundColor,
- Color? activeColor,
- Color inactiveColor = _kDefaultTabBarInactiveColor,
- double iconSize = 30.0,
- double height = _kTabBarHeight,
- Border? border = const Border(top: BorderSide(color: _kDefaultTabBarBorderColor, width: 0.0))}
Creates a tab bar in the iOS style.
Implementation
const CupertinoTabBar({
super.key,
required this.items,
this.onTap,
this.currentIndex = 0,
this.backgroundColor,
this.activeColor,
this.inactiveColor = _kDefaultTabBarInactiveColor,
this.iconSize = 30.0,
this.height = _kTabBarHeight,
this.border = const Border(
top: BorderSide(
color: _kDefaultTabBarBorderColor,
width: 0.0, // 0.0 means one physical pixel
),
),
}) : assert(items != null),
assert(
items.length >= 2,
"Tabs need at least 2 items to conform to Apple's HIG",
),
assert(currentIndex != null),
assert(0 <= currentIndex && currentIndex < items.length),
assert(iconSize != null),
assert(height != null && height >= 0.0),
assert(inactiveColor != null);