Skip to content

Radio

A single choice in a group: selected when value equals groupValue ((o) selected, ( ) not). Enter or Space selects it when focused, as does a click, calling onChanged with this radio’s value. Give every radio in the group the same groupValue and onChanged. Passing null disables it.

See also: RadioGroup for a ready-made group whose arrow keys move the selection.

Learn more: Forms & validation

Import: package:fleury/fleury.dart, or package:fleury/fleury_core.dart in browser code.

Radio<String>(
value: 'fast',
groupValue: _mode,
label: 'Fast',
onChanged: (value) => setState(() => _mode = value),
)
ParameterTypeDefaultDescription
value:TrequiredValue emitted when this radio is activated.
groupValue:T?requiredControlled group selection; equality with value selects this radio.
onChanged:void Function(T value)?requiredCalled with value on activation; null disables this radio.
label:String?—Optional visible text and semantic label beside the indicator.
focusNode:FocusNode?—Optional externally owned focus node used for activation.
autofocus:boolfalseWhether this radio requests focus when mounted.
style:CellStyle?—Base styling, plus optional hover, focus, selected, and disabled state entries from CellStyle.interactive.

Radio is defined in packages/fleury/lib/src/catalog/controls.dart.

Category: Inputs & controls · All widgets