FloaticaTab constructor
const
FloaticaTab({
- required bool isSelected,
- required String title,
- required VoidCallback onTap,
- required Widget icon,
- TextStyle? titleStyle,
- FloaticaActionButton? floatyActionButton,
- EdgeInsetsGeometry margin = const EdgeInsets.all(4),
- Color? selectedColor,
- Color? unselectedColor,
- FloaticaTabDisplayMode selectedDisplayMode = FloaticaTabDisplayMode.iconAndTitle,
- FloaticaTabDisplayMode unselectedDisplayMode = FloaticaTabDisplayMode.iconOnly,
- Gradient? selectedGradient,
- Gradient? unselectedGradient,
- Widget? badge,
- double iconSize = 22.0,
- double selectedIconSize = 24.0,
- FloaticaLabelPosition labelPosition = FloaticaLabelPosition.right,
- FloaticaIndicatorStyle indicatorStyle = FloaticaIndicatorStyle.background,
- Color? indicatorColor,
- Color? borderColor,
- double? borderWidth,
- Duration? animationDuration,
- Curve? animationCurve,
- bool enableHaptics = false,
- String? tooltip,
- FloaticaGlassEffect? glassEffect,
- double? width,
- double? height,
Creates a FloaticaTab instance with the specified properties.
The isSelected parameter indicates whether the tab is currently selected.
The title parameter sets the text displayed on the tab.
The onTap parameter is a callback function that is invoked when the tab is tapped.
The icon parameter specifies the icon displayed on the tab.
The titleStyle parameter allows customization of the text style for the title.
The floatyActionButton parameter can be used to associate a floating action button with the tab.
The margin parameter sets the margin around the tab, defaulting to 4 pixels on all sides.
The selectedColor and unselectedColor parameters define the colors of the tab in selected
and unselected states respectively.
Implementation
const FloaticaTab({
required this.isSelected,
required this.title,
required this.onTap,
required this.icon,
this.titleStyle,
this.floatyActionButton,
this.margin = const EdgeInsets.all(4),
this.selectedColor,
this.unselectedColor,
this.selectedDisplayMode = FloaticaTabDisplayMode.iconAndTitle,
this.unselectedDisplayMode = FloaticaTabDisplayMode.iconOnly,
// New modern features
this.selectedGradient,
this.unselectedGradient,
this.badge,
this.iconSize = 22.0,
this.selectedIconSize = 24.0,
this.labelPosition = FloaticaLabelPosition.right,
this.indicatorStyle = FloaticaIndicatorStyle.background,
this.indicatorColor,
this.borderColor,
this.borderWidth,
this.animationDuration,
this.animationCurve,
this.enableHaptics = false,
this.tooltip,
this.glassEffect,
this.width,
this.height,
});