DesignTabBar class
A bar of tabs, controller choosing among them; the look paints each tab (tabBuilder) and the indicator under them (indicatorBuilder), or over them (indicatorPosition).
Tabs share the bar's width (or, isScrollable, keep their own and the bar scrolls, the selected and the focused tab kept wholly in view); direction vertical stacks them (a settings sidebar), each its own height. Across the bar every tab's face stands as tall as the tallest (as wide as the widest, in a column). A tab's face is the whole tab, or what a touch target (DesignTapTarget) in it holds when the target stands larger: the target is the tab's hit area, the face keeps its own size in it, and the indicator keeps to the face (DesignTabIndicatorDetails.rect). A tab whose words grow where it stands (a larger text size, a tab renamed) lays the bar out again.
The bar is one tab stop, on the selected tab; the arrows along it move focus (mirrored right to left), wrapping, Home and End to the ends, disabled tabs skipped. With selectionFollowsFocus the focused tab is chosen as focus reaches it; otherwise Enter or Space chooses it.
DesignTabBar(controller: controller, tabs: const [DesignTab(label: 'Inbox'), DesignTab(label: 'Sent')], tabBuilder: (context, tab, details) => Text(tab.label))
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- DesignTabBar
Constructors
-
DesignTabBar({Key? key, required DesignTabController controller, required List<
DesignTab> tabs, required DesignTabBuilder tabBuilder, DesignTabIndicatorBuilder? indicatorBuilder, bool isScrollable = false, Axis direction = Axis.horizontal, bool selectionFollowsFocus = true, String? semanticLabel, DecorationPosition indicatorPosition = DecorationPosition.background}) -
A bar of
tabs, one percontrollertab.const
Properties
- controller → DesignTabController
-
Which tab is selected; the caller's.
final
- direction → Axis
-
Which way the tabs run.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- indicatorBuilder → DesignTabIndicatorBuilder?
-
Paints the indicator, under the tabs (indicatorPosition); null:
none.
final
- indicatorPosition → DecorationPosition
-
Whether the indicator is painted under the tabs
(DecorationPosition.background, the default) or over them
(DecorationPosition.foreground). Under is right for most: a pill or
a fill behind the selected tab's words must not cover them, and a line
under them shows either way. Over suits a line a tab's own fill would
hide (a tab that paints its hover or its selection across its whole
box). It takes no hits either way.
final
- isScrollable → bool
-
Whether the tabs keep their own widths and the bar scrolls.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- selectionFollowsFocus → bool
-
Whether a tab is chosen as focus reaches it (automatic activation).
final
- semanticLabel → String?
-
What a screen reader calls the bar.
final
- tabBuilder → DesignTabBuilder
-
Paints a tab.
final
-
tabs
→ List<
DesignTab> -
The tabs, DesignTabController.length of them.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< DesignTabBar> -
Creates the mutable state for this widget at a given location in the tree.
override
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited