LedgerTabs class

In-page sections, peers of one page: a strip 44 tall over the page's hairline, each tabs label set in the sans medium with an optional counts figure after it in the mono, the chosen one in the ink under one ink rule and the rest in the second ink. A strip wider than its room scrolls sideways, keeping the chosen tab in view. The strip is ui_core's DesignTabBar: one tab stop, the arrow keys (mirrored right to left, wrapping) and Home and End move the choice and the focus with it, and the change runs on ui_core's spring, the old tab's rule drawn back out as the new one's is drawn in. padding insets the labels (the page's gutter on a full-bleed strip) while the hairline runs edge to edge. A null onSelected shows the strip without letting it change. A screen reader hears a tab bar, each tab its label, its count and its place ("Entries, 12, Tab 2 of 3"), and whether it is chosen. Supply children to show a named, swipeable tab panel below the strip. Give the widget a bounded height when showing panels.

LedgerTabs(tabs: const ['Overview', 'Entries', 'Notes'], counts: const [null, 12, 3], selectedIndex: tab, onSelected: (i) => setState(() => tab = i))
Inheritance

Constructors

LedgerTabs({required List<String> tabs, required int selectedIndex, ValueChanged<int>? onSelected, List<int?>? counts, List<Widget>? children, EdgeInsetsGeometry padding = EdgeInsets.zero, Key? key})
A strip of tabs, the one at selectedIndex chosen.
const

Properties

children → List<Widget>?
A page for each tab, in the same order as tabs. Omit to show only the strip.
final
counts → List<int?>?
One count per tab (null for a tab without one), printed in the mono after its label.
final
hashCode → int
The hash code for this object.
no setterinherited
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onSelected → ValueChanged<int>?
Called with the tab pressed; null shows the strip without letting it change.
final
padding → EdgeInsetsGeometry
The strip's inset for its labels; the hairline under them ignores it.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
selectedIndex → int
The chosen tab.
final
tabs → List<String>
The tabs' words, in order.
final

Methods

createElement() → StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → State<LedgerTabs>
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