Checkbox
A boolean checkbox: [x] checked, [ ] unchecked. Enter or Space
toggles it when focused, as does a click, calling onChanged with the new
value. A controlled widget — hold the value yourself and update it from
onChanged. Passing null disables it.
See also: Toggle for a compact on/off switch · Switch for a setting that should stand out.
Learn more: Forms & validation
Import: package:fleury/fleury.dart, or package:fleury/fleury_core.dart in browser code.
Checkbox( value: _accepted, label: 'Accept terms', onChanged: (value) => setState(() => _accepted = value),)Constructors
Section titled “Constructors”Checkbox()
Section titled “Checkbox()”| Parameter | Type | Default | Description |
|---|---|---|---|
value: | bool | required | Controlled checked state rendered by the checkbox. |
onChanged: | void Function(bool value)? | required | Called with the requested next state on activation; null disables it. |
label: | String? | — | Optional visible text and semantic label beside the indicator. |
focusNode: | FocusNode? | — | Optional externally owned focus node used for activation. |
autofocus: | bool | false | Whether the checkbox requests focus when mounted. |
style: | CellStyle? | — | Base styling, plus optional hover, focus, selected, disabled, and invalid state entries from CellStyle.interactive. |
Source
Section titled “Source”Checkbox is defined in packages/fleury/lib/src/catalog/controls.dart.
Category: Inputs & controls · All widgets