SheenTabBar class
The floating tab bar of iOS 26 and later: the tabs on one glass capsule with the selected tab on a lens, and search as its own circle.
The lens slides on the snappy spring and stretches along its travel; the new tab's glyph dips. minimized shrinks the bar to the current tab, an optional accessory and search, on the smooth spring.
Press and slide, as in iOS 26: a finger on the capsule lifts the lens past the capsule and magnifies what is under it; the bar's glass swells and joins the search circle through a liquid neck. The lens follows the finger with a selection tick at each tab; letting go opens what is under it (away from the bar nothing changes). A plain tap selects as usual.
With Reduce Motion the lens jumps, the bars cross-fade and a pressed lens only swells 6 %. The bar keeps its labels at the system text size, as iOS does.
SheenTabBar(
items: const [
SheenTabItem(icon: SheenIcons.home, label: 'Home'),
SheenTabItem(icon: SheenIcons.map, label: 'Map'),
SheenTabItem(icon: SheenIcons.heart, label: 'Saved'),
SheenTabItem(icon: SheenIcons.user, label: 'Profile'),
],
index: tab,
onSelect: (i) => setState(() => tab = i),
onSearch: openSearch,
)
Tab glyphs are drawn filled when they have a filled form (SheenIcons.*Fill lists them), otherwise as their outline.
The circle need not be search: searchIcon, searchLabel and searchVariant
make it another action, such as a prominent plus.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- SheenTabBar
Constructors
-
SheenTabBar({Key? key, required List<
SheenTabItem> items, required int index, required ValueChanged<int> onSelect, required VoidCallback onSearch, String? searchLabel, String searchIcon = SheenIcons.search, SheenGlassVariant searchVariant = SheenGlassVariant.regular, bool searchActive = false, bool minimized = false, Widget? accessory, VoidCallback? onAccessory, VoidCallback? onRestore}) -
A tab bar showing
items.const
Properties
- accessory → Widget?
-
Shown beside the minimized bar, usually a SheenTabAccessory.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- index → int
-
The selected tab.
final
-
items
→ List<
SheenTabItem> -
The tabs (four fit best).
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- minimized → bool
-
Shrinks the bar to the current tab, the accessory and search, for example while a list scrolls down.
final
- onAccessory → VoidCallback?
-
Called when the accessory is tapped.
final
- onRestore → VoidCallback?
-
Tap on the current-tab circle of the minimized bar; defaults to selecting the current tab.
final
- onSearch → VoidCallback
-
Called when search is chosen.
final
-
onSelect
→ ValueChanged<
int> -
Called with the chosen tab.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- searchActive → bool
-
Search is the active destination: the circle is marked as current (a lens, or a ring on prominent glass), no tab is.
final
- searchIcon → String
-
The search circle's glyph (SheenIcons); another glyph makes it another action.
final
- searchLabel → String?
-
The search circle's label for screen readers; SheenStrings.search when null.
final
- searchVariant → SheenGlassVariant
-
The search circle's glass; SheenGlassVariant.prominent gives it the accent, for the screen's main action.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< SheenTabBar> -
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.
inherited
-
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
Constants
- gap → const double
- The space between the capsule and the search circle.
- height → const double
- The bar height in points.
- maxWidth → const double
- The widest the bar and its search circle grow in a wide window (iPad): four tabs do not stretch across it.
- minimizedHeight → const double
- The minimized bar height in points.