StacTabBar class

A Stac model representing Flutter's TabBar widget.

A material design widget that displays a horizontal row of tabs.

{@tool snippet} Dart Example:

StacTabBar(
  tabs: [
    StacTab(text: 'Home'),
    StacTab(text: 'Profile'),
  ],
  isScrollable: false,
  indicatorWeight: 2.0,
)

{@end-tool}

{@tool snippet} JSON Example:

{
  "type": "tabBar",
  "tabs": [
    { "type": "tab", "text": "Home" },
    { "type": "tab", "text": "Profile" }
  ],
  "isScrollable": false,
  "indicatorWeight": 2.0
}

{@end-tool}

See also:

  • Flutter's TabBar documentation (https://api.flutter.dev/flutter/material/TabBar-class.html)
Inheritance
Available extensions
Annotations
  • @JsonSerializable.new()

Constructors

StacTabBar({required List<StacWidget> tabs, int? initialIndex, bool? isScrollable, StacEdgeInsets? padding, StacColor? indicatorColor, bool? automaticIndicatorColorAdjustment, double? indicatorWeight, StacEdgeInsets? indicatorPadding, StacBoxDecoration? indicator, StacTabBarIndicatorSize? indicatorSize, StacColor? labelColor, StacTextStyle? labelStyle, StacEdgeInsets? labelPadding, StacColor? unselectedLabelColor, StacTextStyle? unselectedLabelStyle, StacDragStartBehavior? dragStartBehavior, bool? enableFeedback, StacScrollPhysics? physics, StacTabAlignment? tabAlignment, StacColor? dividerColor, double? dividerHeight})
Creates a StacTabBar.
const
StacTabBar.fromJson(Map<String, dynamic> json)
Creates a StacTabBar from a JSON map.
factory

Properties

automaticIndicatorColorAdjustment → bool?
Whether to adjust indicator color automatically based on label colors.
final
dividerColor → StacColor?
Divider color drawn below the tab bar (Material 3).
final
dividerHeight → double?
Divider height drawn below the tab bar (Material 3).
final
dragStartBehavior → StacDragStartBehavior?
Drag start behavior for drag gestures.
final
enableFeedback → bool?
Whether tapping tabs should include feedback.
final
hashCode → int
The hash code for this object.
no setterinherited
indicator → StacBoxDecoration?
A custom decoration for the tab indicator.
final
indicatorColor → StacColor?
Color for the tab indicator.
final
indicatorPadding → StacEdgeInsets?
Padding for the tab indicator.
final
indicatorSize → StacTabBarIndicatorSize?
How the indicator's size is computed.
final
indicatorWeight → double?
Thickness of the tab indicator in logical pixels.
final
initialIndex → int?
The initial tab index (used with DefaultTabController).
final
isScrollable → bool?
Whether the tab bar can be scrolled horizontally.
final
jsonData → Map<String, dynamic>?
Raw JSON data for this widget
finalinherited
labelColor → StacColor?
Color of selected tab labels.
final
labelPadding → StacEdgeInsets?
Padding added to each label.
final
labelStyle → StacTextStyle?
Text style of selected tab labels.
final
padding → StacEdgeInsets?
Padding for the entire tab bar.
final
physics → StacScrollPhysics?
Scroll physics for the tab bar.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
tabAlignment → StacTabAlignment?
How the tabs should be aligned.
final
tabs → List<StacWidget>
The tabs to display.
final
type → String
Widget type identifier.
no setteroverride
unselectedLabelColor → StacColor?
Color of unselected tab labels.
final
unselectedLabelStyle → StacTextStyle?
Text style of unselected tab labels.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
parse(BuildContext context) → Widget?

Available on StacWidget?, provided by the StacWidgetParser extension

parsePreferredSizeWidget(BuildContext context) → PreferredSizeWidget?

Available on StacWidget?, provided by the StacWidgetParser extension

toJson() → Map<String, dynamic>
Converts this StacTabBar to a JSON map.
override
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited