TabBar constructor
- Key? key,
- required List<
Widget> tabs, - TabController? controller,
- TabBarScrollController? scrollController,
- 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,
- WidgetStateProperty<
Color?> ? overlayColor, - MouseCursor? mouseCursor,
- bool? enableFeedback,
- ValueChanged<
int> ? onTap, - TabValueChanged<
bool> ? onHover, - TabValueChanged<
bool> ? onFocusChange, - ScrollPhysics? physics,
- InteractiveInkFeatureFactory? splashFactory,
- BorderRadius? splashBorderRadius,
- TabAlignment? tabAlignment,
- TextScaler? textScaler,
- TabIndicatorAnimation? indicatorAnimation,
Creates a Material Design primary tab bar.
The length of the tabs argument must match the controller's
TabController.length.
If a TabController is not provided, then there must be a DefaultTabController ancestor.
The indicatorWeight parameter defaults to 2.
The indicatorPadding parameter defaults to EdgeInsets.zero.
If indicator is not null or provided from TabBarTheme,
then indicatorColor is ignored.
The indicatorWeight does not affect the visual appearance of
the indicator when a custom indicator is provided. However,
it may still be used to compute the TabBar's preferred size.
Implementation
const TabBar({
super.key,
required this.tabs,
this.controller,
this.scrollController,
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.onHover,
this.onFocusChange,
this.physics,
this.splashFactory,
this.splashBorderRadius,
this.tabAlignment,
this.textScaler,
this.indicatorAnimation,
}) : _isPrimary = true,
assert(indicator != null || (indicatorWeight > 0.0));