StacDefaultTabController class
A Stac model representing Flutter's DefaultTabController widget.
Provides a default TabController to descendant widgets, used with TabBar and TabBarView to coordinate tab selection.
{@tool snippet} Dart Example:
StacDefaultTabController(
length: 3,
initialIndex: 1,
child: StacTabBarView(children: [/* ... */]),
)
{@end-tool}
{@tool snippet} JSON Example:
{
"type": "defaultTabController",
"length": 3,
"initialIndex": 1,
"child": { "type": "tabBarView", "children": [] }
}
{@end-tool}
See also:
- Flutter's DefaultTabController documentation (
https://api.flutter.dev/flutter/material/DefaultTabController-class.html)
- Inheritance
-
- Object
- StacElement
- StacWidget
- StacDefaultTabController
- Available extensions
- Annotations
-
- @JsonSerializable.new()
Constructors
- StacDefaultTabController({required int length, int? initialIndex, StacDuration? animationDuration, required StacWidget child})
-
Creates a StacDefaultTabController.
const
-
StacDefaultTabController.fromJson(Map<
String, dynamic> json) -
Creates a StacDefaultTabController from a JSON map.
factory
Properties
- animationDuration → StacDuration?
-
The duration of the tab change animation.
final
- child → StacWidget
-
The subtree that has access to the provided TabController.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- initialIndex → int?
-
The initial index of the selected tab.
final
-
jsonData
→ Map<
String, dynamic> ? -
Raw JSON data for this widget
finalinherited
- length → int
-
The number of tabs.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- type → String
-
Widget type identifier.
no setteroverride
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'sappBaror an app bar'sbottom. -
toJson(
) → Map< String, dynamic> -
Converts this StacDefaultTabController instance to a JSON map.
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited