MotionTabBar constructor

MotionTabBar({
  1. Key? key,
  2. TextStyle? textStyle,
  3. Color? tabIconColor = Colors.black,
  4. double? tabIconSize = 24,
  5. Color? tabIconSelectedColor = Colors.white,
  6. double? tabIconSelectedSize = 24,
  7. Color? tabSelectedColor = Colors.black,
  8. Color? tabBarColor = Colors.white,
  9. double? tabBarHeight = 65,
  10. double? tabSize = 60,
  11. Function? onTabItemSelected,
  12. required String initialSelectedTab,
  13. required List<String?> labels,
  14. List<IconData>? icons,
  15. List<Widget>? iconWidgets,
  16. bool useSafeArea = true,
  17. List<Widget?>? badges,
  18. MotionTabBarController? controller,
  19. 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);