ColorfulTabBar constructor

ColorfulTabBar({
  1. Key? key,
  2. required List<TabItem> tabs,
  3. TabController? controller,
  4. double selectedHeight = 40.0,
  5. double unselectedHeight = 32.0,
  6. double indicatorHeight = 4.0,
  7. double topPadding = 8.0,
  8. double verticalTabPadding = 2.0,
  9. ShapeBorder tabShape = const RoundedRectangleBorder(borderRadius: BorderRadius.only(topLeft: Radius.circular(4.0), topRight: Radius.circular(4.0))),
  10. Color? labelColor,
  11. Color? unselectedLabelColor,
  12. TextStyle? labelStyle,
  13. TextStyle? unselectedLabelStyle,
  14. TabAxisAlignment alignment = TabAxisAlignment.center,
})

Implementation

ColorfulTabBar({
  Key? key,
  required this.tabs,
  this.controller,
  double selectedHeight = 40.0,
  double unselectedHeight = 32.0,
  this.indicatorHeight = 4.0,
  this.topPadding = 8.0,
  this.verticalTabPadding = 2.0,
  this.tabShape = const RoundedRectangleBorder(
      borderRadius: BorderRadius.only(
    topLeft: Radius.circular(4.0),
    topRight: Radius.circular(4.0),
  )),
  this.labelColor,
  this.unselectedLabelColor,
  this.labelStyle,
  this.unselectedLabelStyle,
  TabAxisAlignment alignment = TabAxisAlignment.center,
})  : assert(selectedHeight > 0.0),
      assert(unselectedHeight > 0.0),
      assert(indicatorHeight >= 0.0),
      _tabHeight = max(selectedHeight, unselectedHeight),
      _selectedTabPadding =
          max(selectedHeight, unselectedHeight) - selectedHeight,
      _unselectedTabPadding =
          max(selectedHeight, unselectedHeight) - unselectedHeight,
      _alignment = alignment.toCrossAxisAlignment(),
      super(key: key);