GFTabs constructor

const GFTabs({
  1. Key? key,
  2. int? initialIndex = 0,
  3. required int length,
  4. required List<Widget> tabs,
  5. required GFTabBarView tabBarView,
  6. required TabController controller,
  7. bool isScrollable = false,
  8. double? height,
  9. Color? tabBarColor,
  10. Color? indicatorColor,
  11. double indicatorWeight = 2.0,
  12. EdgeInsetsGeometry indicatorPadding = EdgeInsets.zero,
  13. Decoration? indicator,
  14. TabBarIndicatorSize? indicatorSize,
  15. Color? labelColor,
  16. TextStyle? labelStyle,
  17. EdgeInsetsGeometry? labelPadding,
  18. Color? unselectedLabelColor,
  19. TextStyle? unselectedLabelStyle,
  20. double? tabBarHeight,
  21. ShapeBorder? shape,
})

Creates a default tab for the given child widget.

The length argument is typically greater than one. The length must match GFTabBar.tabs's and GFTabBarView.children's length.

The initialIndex argument must not be null.

Implementation

const GFTabs({
  Key? key,
  this.initialIndex = 0,
  required this.length,
  required this.tabs,
  required this.tabBarView,
  required this.controller,
  this.isScrollable = false,
  this.height,
  this.tabBarColor,
  this.indicatorColor,
  this.indicatorWeight = 2.0,
  this.indicatorPadding = EdgeInsets.zero,
  this.indicator,
  this.indicatorSize,
  this.labelColor,
  this.labelStyle,
  this.labelPadding,
  this.unselectedLabelColor,
  this.unselectedLabelStyle,
  this.tabBarHeight,
  this.shape,
})  : assert(length >= 0),
      assert(initialIndex != null &&
          initialIndex >= 0 &&
          (length == 0 || initialIndex < length)),
      super(key: key);