TabBar.secondary constructor
- Key? key,
- required List<
Widget> tabs, - TabController? controller,
- bool isScrollable = false,
- EdgeInsetsGeometry? padding,
- Color? indicatorColor,
- bool automaticIndicatorColorAdjustment = true,
- double indicatorWeight = 2.0,
- EdgeInsetsGeometry indicatorPadding = EdgeInsets.zero,
- Decoration? indicator,
- TabBarIndicatorSize? indicatorSize,
- Color? dividerColor,
- double? dividerHeight,
- Color? labelColor,
- TextStyle? labelStyle,
- EdgeInsetsGeometry? labelPadding,
- Color? unselectedLabelColor,
- TextStyle? unselectedLabelStyle,
- DragStartBehavior dragStartBehavior = DragStartBehavior.start,
- MaterialStateProperty<
Color?> ? overlayColor, - MouseCursor? mouseCursor,
- bool? enableFeedback,
- ValueChanged<
int> ? onTap, - ScrollPhysics? physics,
- InteractiveInkFeatureFactory? splashFactory,
- BorderRadius? splashBorderRadius,
- TabAlignment? tabAlignment,
- TextScaler? textScaler,
- TabIndicatorAnimation? indicatorAnimation,
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.TabBar.secondary.1 mysample
See also:
- TabBar, for a primary tab bar.
- TabBarView, which displays page views that correspond to each tab.
- TabController, which coordinates tab selection between a TabBar and a TabBarView.
- https://m3.material.io/components/tabs/overview, the Material 3 tab bar specification.
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,
this.indicatorAnimation,
}) : _isPrimary = false,
assert(indicator != null || (indicatorWeight > 0.0));