TabBar.secondary constructor

const TabBar.secondary({
  1. Key? key,
  2. required List<Widget> tabs,
  3. TabController? controller,
  4. bool isScrollable = false,
  5. EdgeInsetsGeometry? padding,
  6. Color? indicatorColor,
  7. bool automaticIndicatorColorAdjustment = true,
  8. double indicatorWeight = 2.0,
  9. EdgeInsetsGeometry indicatorPadding = EdgeInsets.zero,
  10. Decoration? indicator,
  11. TabBarIndicatorSize? indicatorSize,
  12. Color? dividerColor,
  13. double? dividerHeight,
  14. Color? labelColor,
  15. TextStyle? labelStyle,
  16. EdgeInsetsGeometry? labelPadding,
  17. Color? unselectedLabelColor,
  18. TextStyle? unselectedLabelStyle,
  19. DragStartBehavior dragStartBehavior = DragStartBehavior.start,
  20. MaterialStateProperty<Color?>? overlayColor,
  21. MouseCursor? mouseCursor,
  22. bool? enableFeedback,
  23. ValueChanged<int>? onTap,
  24. ScrollPhysics? physics,
  25. InteractiveInkFeatureFactory? splashFactory,
  26. BorderRadius? splashBorderRadius,
  27. TabAlignment? tabAlignment,
  28. TextScaler? textScaler,
})

Creates a Material Design secondary tab bar.

Secondary tabs are used within a content area to further separate related content and establish hierarchy.

This sample showcases nested Material 3 TabBars. It consists of a primary TabBar with nested a secondary TabBar. The primary TabBar uses a DefaultTabController while the secondary TabBar uses a TabController.
link

To create a local project with this code sample, run:
flutter create --sample=material.TabBar.secondary.1 mysample

See also:

Implementation

const TabBar.secondary({
  super.key,
  required this.tabs,
  this.controller,
  this.isScrollable = false,
  this.padding,
  this.indicatorColor,
  this.automaticIndicatorColorAdjustment = true,
  this.indicatorWeight = 2.0,
  this.indicatorPadding = EdgeInsets.zero,
  this.indicator,
  this.indicatorSize,
  this.dividerColor,
  this.dividerHeight,
  this.labelColor,
  this.labelStyle,
  this.labelPadding,
  this.unselectedLabelColor,
  this.unselectedLabelStyle,
  this.dragStartBehavior = DragStartBehavior.start,
  this.overlayColor,
  this.mouseCursor,
  this.enableFeedback,
  this.onTap,
  this.physics,
  this.splashFactory,
  this.splashBorderRadius,
  this.tabAlignment,
  this.textScaler,
}) : _isPrimary = false,
     assert(indicator != null || (indicatorWeight > 0.0));