LedgerButton class

A round button: its label and an optional icon (before the words, or after with iconAfter; a left or right chevron or arrow turns the other way in a right-to-left page). expand stretches it across its room: its column on a phone; from 600 up to 320 (LedgerLayout.fieldMeasure), wider only for longer words, at the start of its slot.

  • LedgerButton(label) is the ordinary act, ringed in the ink (at LedgerButtonSize.small, ringed in the rule on the raised paper).
  • LedgerButton.filled is the page's one act: the accent green, its words in the raised paper, a soft green drop under it.
  • LedgerButton.ink is a firm act on a raised surface (a sheet's or a dialog's confirm): filled with the ink.
  • LedgerButton.text has no frame: its words alone.

isDestructiveAction draws any of them in the danger red. A null onPressed disables it: written in pencil, not ink (no fill, the light rule round it, its words in the third ink). Pressed, the face sinks into the paper and its drop goes; a frameless one's words take the ink underline while held. The touch target is 44 at every size and density; what shrinks is the drawn face. semanticLabel names it for a screen reader when its words say less than the act ("Change category" for a Change).

LedgerButton.filled('Move money', icon: LucideIcons.arrowRightLeft, onPressed: () {})
LedgerButton('Add money', size: LedgerButtonSize.medium, icon: LucideIcons.plus, onPressed: () {})
LedgerButton.ink('Freeze card', onPressed: () {})
LedgerButton.text('View all', onPressed: () {})
Inheritance

Constructors

LedgerButton(String label, {required VoidCallback? onPressed, IconData? icon, bool iconAfter = false, bool expand = false, bool isDestructiveAction = false, LedgerButtonSize size = LedgerButtonSize.large, String? semanticLabel, FocusNode? focusNode, bool autofocus = false, LedgerStyle? style, Key? key})
The ordinary act, ringed in the ink.
const
LedgerButton.filled(String label, {required VoidCallback? onPressed, IconData? icon, bool iconAfter = false, bool expand = false, bool isDestructiveAction = false, LedgerButtonSize size = LedgerButtonSize.large, String? semanticLabel, FocusNode? focusNode, bool autofocus = false, LedgerStyle? style, Key? key})
The page's one act, filled in the accent green.
const
LedgerButton.ink(String label, {required VoidCallback? onPressed, IconData? icon, bool iconAfter = false, bool expand = false, bool isDestructiveAction = false, LedgerButtonSize size = LedgerButtonSize.large, String? semanticLabel, FocusNode? focusNode, bool autofocus = false, LedgerStyle? style, Key? key})
A firm act on a raised surface, filled with the ink.
const
LedgerButton.text(String label, {required VoidCallback? onPressed, IconData? icon, bool iconAfter = false, bool expand = false, bool isDestructiveAction = false, LedgerButtonSize size = LedgerButtonSize.large, String? semanticLabel, FocusNode? focusNode, bool autofocus = false, LedgerStyle? style, Key? key})
An act with no frame: its words alone, in the ink.
const

Properties

autofocus → bool
Whether it takes focus when it first appears.
final
expand → bool
Whether it fills its room's width.
final
focusNode → FocusNode?
Its focus node, which the caller disposes; null keeps its own.
final
hashCode → int
The hash code for this object.
no setterinherited
icon → IconData?
A Lucide glyph beside the words.
final
iconAfter → bool
Whether the glyph follows the words.
final
isDestructiveAction → bool
Whether the act destroys or removes something: drawn in the danger red.
final
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
label → String
Its words.
final
onPressed → VoidCallback?
What a press does; null disables it.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
semanticLabel → String?
The spoken name; null speaks the label.
final
size → LedgerButtonSize
How tall it stands.
final
style → LedgerStyle?
This button's look, over its component theme (components.button, .filledButton, .inkButton or .textButton by its kind). It reads fill, foreground, edge, side, overlay, shape, padding, minimumSize, textStyle and iconSize.
final

Methods

build(BuildContext context) → Widget
Describes the part of the user interface represented by this widget.
override
createElement() → StatelessElement
Creates a StatelessElement to manage this widget's location in the tree.
inherited
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