ExpressiveCheckbox class

A Material 3 checkbox (Compose Checkbox and TriStateCheckbox): a 20dp box, 2dp in from its 24dp bounds, that fills and draws its check on the default spatial spring, and gathers the check into a dash when value is null (indeterminate; only when tristate).

A tap reports the next value: unchecked → checked → unchecked; from indeterminate, checked (Compose's "select all" pattern). isError draws the error colours (CheckboxTokens *Error*); disabled wins.

ExpressiveCheckbox(value: done, onChanged: (v) => setState(() => done = v))
Inheritance

Constructors

ExpressiveCheckbox({required bool? value, ValueChanged<bool>? onChanged, bool tristate = false, bool isError = false, String? semanticLabel, FocusNode? focusNode, bool autofocus = false, ExpressiveComponentThemeData? style, Key? key})
A checkbox showing value, reporting a change through onChanged.
const
ExpressiveCheckbox.mark({required bool? value, bool tristate = false, bool enabled = true, bool isError = false, String? semanticLabel, ExpressiveComponentThemeData? style, Key? key})
The box alone, for a row that takes the tap itself (as ExpressiveCheckboxRow does): no touch target, no ripple, no focus, only the box at its 24dp with its states' colours. enabled false draws it disabled, for a disabled row.
const

Properties

autofocus → bool
Whether to take focus when first built.
final
enabled → bool
Whether it is enabled: it has onChanged; a ExpressiveCheckbox.mark as its row says.
no setter
focusNode → FocusNode?
The focus node; one is made when null.
final
hashCode → int
The hash code for this object.
no setterinherited
isError → bool
Whether to draw the error colours.
final
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onChanged → ValueChanged<bool>?
Told the next value on a tap; null disables the box at its full size, as Flutter's Checkbox does. For a box inside a row that takes the tap, use ExpressiveCheckbox.mark.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
semanticLabel → String?
What a screen reader says for the box on its own.
final
style → ExpressiveComponentThemeData?
Stateful visual overrides for this control or labelled row.
final
tristate → bool
Whether value may be null (Compose's TriStateCheckbox).
final
value → bool?
Checked (true), unchecked (false) or indeterminate (null, tristate).
final

Methods

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