MotionTabBar constructor
MotionTabBar({
- Key? key,
- TextStyle? textStyle,
- Color? tabIconColor = Colors.black,
- double? tabIconSize = 24,
- Color? tabIconSelectedColor = Colors.white,
- double? tabIconSelectedSize = 24,
- Color? tabSelectedColor = Colors.black,
- Color? tabBarColor = Colors.white,
- double? tabBarHeight = 65,
- double? tabSize = 60,
- Function? onTabItemSelected,
- required String initialSelectedTab,
- required List<
String?> labels, - List<
IconData> ? icons, - List<
Widget> ? iconWidgets, - bool useSafeArea = true,
- List<
Widget?> ? badges, - MotionTabBarController? controller,
- bool labelAlwaysVisible = false,
Creates a MotionTabBar.
initialSelectedTab must be one of labels. Either icons or
iconWidgets must be provided, with the same length as labels.
If badges is provided, its length must match labels.
Implementation
MotionTabBar({
Key? key,
this.textStyle,
this.tabIconColor = Colors.black,
this.tabIconSize = 24,
this.tabIconSelectedColor = Colors.white,
this.tabIconSelectedSize = 24,
this.tabSelectedColor = Colors.black,
this.tabBarColor = Colors.white,
this.tabBarHeight = 65,
this.tabSize = 60,
this.onTabItemSelected,
required this.initialSelectedTab,
required this.labels,
this.icons,
this.iconWidgets,
this.useSafeArea = true,
this.badges,
this.controller,
this.labelAlwaysVisible = false,
}) : assert(labels.contains(initialSelectedTab)),
assert((icons != null && icons.length == labels.length) ||
(iconWidgets != null && iconWidgets.length == labels.length)),
assert((badges != null && badges.isNotEmpty) ? badges.length == labels.length : true),
super(key: key);