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 (or backtab): 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.
Inheritance

Constructors

TabBar({required TabController controller, required List<String> labels, Style activeStyle = const Style(foreground: CharmColors.charple, modifiers: Modifier.bold), Style inactiveStyle = const Style(foreground: CharmColors.squid, modifiers: Modifier.dim)})
Creates a TabBar.

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 width constraint.
inherited
getIntrinsicWidth(int height) → int
Computes the intrinsic width of this widget under the given height constraint.
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