ZetaTabBar constructor

ZetaTabBar({
  1. required BuildContext context,
  2. required List<ZetaTab> tabs,
  3. TabAlignment tabAlignment = TabAlignment.center,
  4. @Deprecated('Use disabled instead. ' 'enabled is deprecated as of 0.11.0') bool enabled = true,
  5. bool isScrollable = false,
  6. bool? enableFeedback,
  7. DragStartBehavior dragStartBehavior = DragStartBehavior.start,
  8. EdgeInsetsGeometry? padding,
  9. ValueChanged<int>? onTap,
  10. Key? key,
})

Creates a Zeta Design primary tab bar.

Implementation

ZetaTabBar({
  required BuildContext context,
  required List<ZetaTab> super.tabs,
  TabAlignment super.tabAlignment = TabAlignment.center,
  @Deprecated('Use disabled instead. ' 'enabled is deprecated as of 0.11.0') bool enabled = true,
  super.isScrollable,
  super.enableFeedback,
  super.dragStartBehavior,
  super.padding,
  super.onTap,
  super.key,
}) : super(
        indicatorSize: isScrollable ? TabBarIndicatorSize.label : TabBarIndicatorSize.tab,
        labelPadding: isScrollable ? null : EdgeInsets.zero,
        indicator: UnderlineTabIndicator(
          borderSide: BorderSide(
            color: Zeta.of(context).colors.primary,
            width: onTap != null ? Zeta.of(context).spacing.minimum : Zeta.of(context).spacing.none,
          ),
          borderRadius: Zeta.of(context).radius.none,
        ),
        splashFactory: null,
        labelStyle: ZetaTextStyles.labelLarge.copyWith(
          color: onTap != null ? Zeta.of(context).colors.textDefault : Zeta.of(context).colors.textDisabled,
        ),
        unselectedLabelStyle: ZetaTextStyles.labelLarge.copyWith(
          color: onTap != null ? Zeta.of(context).colors.textSubtle : Zeta.of(context).colors.textDisabled,
        ),
      );