StacTabBarView class

A Stac model representing Flutter's TabBarView widget.

Displays the content for each tab in a TabBar, supporting horizontal paging between children.

{@tool snippet} Dart Example:

StacTabBarView(
  children: [
    StacCenter(child: StacText('Page 1')),
    StacCenter(child: StacText('Page 2')),
  ],
  physics: StacScrollPhysics.page,
  dragStartBehavior: StacDragStartBehavior.start,
  viewportFraction: 1.0,
  clipBehavior: StacClip.hardEdge,
)

{@end-tool}

{@tool snippet} JSON Example:

{
  "type": "tabBarView",
  "children": [
    { "type": "center", "child": { "type": "text", "data": "Page 1" } },
    { "type": "center", "child": { "type": "text", "data": "Page 2" } }
  ],
  "physics": "page",
  "dragStartBehavior": "start",
  "viewportFraction": 1.0,
  "clipBehavior": "hardEdge"
}

{@end-tool}

See also:

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

Constructors

StacTabBarView({required List<StacWidget> children, StacDragStartBehavior? dragStartBehavior, StacScrollPhysics? physics, double? viewportFraction, StacClip? clipBehavior})
Creates a StacTabBarView.
const
StacTabBarView.fromJson(Map<String, dynamic> json)
Creates a StacTabBarView from a JSON map.
factory

Properties

children → List<StacWidget>
The pages to display; typically one per tab.
final
clipBehavior → StacClip?
The clipping behavior for content.
final
dragStartBehavior → StacDragStartBehavior?
Drag start behavior for horizontal drags.
final
hashCode → int
The hash code for this object.
no setterinherited
jsonData → Map<String, dynamic>?
Raw JSON data for this widget
finalinherited
physics → StacScrollPhysics?
Scroll physics for the page view.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
type → String
Widget type identifier.
no setteroverride
viewportFraction → double?
Fraction of the viewport that each page should occupy.
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

Parses a widget for a slot that needs a PreferredSizeWidget, such as a scaffold's appBar or an app bar's bottom.
toJson() → Map<String, dynamic>
Converts this StacTabBarView instance to a JSON map.
override
toString() → String
A string representation of this object.
inherited

Operators

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