TabBar class
A horizontal tab bar widget to select active views from a tab set.
Keyboard Bindings
[: Swaps the active tab index backward (decreases index, wraps around).]: Swaps the active tab index forward (increases index, wraps around).Shift + Tab(orbacktab): Swaps the active tab index backward.
Example Usage
final controller = TabController(length: 3);
final tabBar = TabBar(
controller: controller,
labels: const ['General', 'Settings', 'About'],
);
Properties and Settings
| Property | Type | Description |
|---|---|---|
controller |
TabController | Coordinates the active tab index. |
labels |
List<String> | Text labels for each tab. |
activeStyle |
Style | Style of the selected tab. |
inactiveStyle |
Style | Style of the unselected tabs. |
Constructors
Properties
- activeStyle → Style
-
Style of the selected tab.
final
- controller → TabController
-
Coordinates the active tab index.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- inactiveStyle → Style
-
Style of the unselected tabs.
final
- key → Key?
-
The optional key for this widget.
finalinherited
-
labels
→ List<
String> -
Text labels for each tab.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
createElement(
) → Element -
Creates an Element to manage this widget's location in the tree.
override
-
dispose(
) → void - Cleans up resources.
-
getIntrinsicHeight(
int width) → int -
Computes the intrinsic height of this widget under the given
widthconstraint.inherited -
getIntrinsicWidth(
int height) → int -
Computes the intrinsic width of this widget under the given
heightconstraint.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited