TabItem constructor

TabItem({
  1. Key? key,
  2. required bool selected,
  3. required dynamic callbackFunction(
    1. TabData tabData
    ),
  4. required Color textColor,
  5. required Color iconColor,
  6. required Color inactiveColor,
  7. required TabData tabData,
  8. Gradient? backGroundGradientColor,
  9. CubertoTabStyle? tabStyle = CubertoTabStyle.styleNormal,
})

Constructor for TabItem widget.

Parameters:

  • selected: Indicates if the tab is selected.
  • callbackFunction: Callback function called when the tab is clicked.
  • textColor: Color used for the text inside the tab.
  • iconColor: Color used as the icon color of the tab.
  • inactiveColor: Color used as inactive color if tabData.color is null.
  • tabData: TabData used to set the data of the tab.
  • backGroundGradientColor: Gradient used as the background gradient color of the tab.
  • tabStyle: Style of the tab, default is CubertoTabStyle.styleNormal.

Implementation

TabItem({
  super.key,
  required this.selected,
  required this.callbackFunction,
  required this.textColor,
  required this.iconColor,
  required this.inactiveColor,
  required this.tabData,
  this.backGroundGradientColor,
  this.tabStyle = CubertoTabStyle.styleNormal,
}) {
  _iconData = tabData.iconData;
  _title = tabData.title;
  _tabColor = tabData.tabColor ?? inactiveColor;
  _borderRadius = tabData.borderRadius ??
      const BorderRadius.all(
        Radius.circular(20.0),
      );
}