Form
Radio
A radio button that typically allows the user to choose only one of a predefined set of options.
We recommend using a select group to create a group of radio buttons instead of using FRadio directly.
class RadioPage extends StatefulWidget {
@override
State<RadioPage> createState() => _RadioPageState();
}
class _RadioPageState extends State<RadioPage> {
bool _value = true;
@override
Widget build(BuildContext context) => FRadio(
label: const Text('Default'),
description: const Text('The description of the default option.'),
value: _value,
onChange: (value) => setState(() => _value = value),
);
}CLI
To generate and customize this style:
dart run forui style create radioUsage
FRadio(...)
FRadio(
style: (style) => style.copyWith(...),
label: const Text('Default'),
description: const Text('The description of the default option.'),
error: const Text('Please select the default option.'),
semanticsLabel: 'Default',
value: true,
onChange: (value) {},
enabled: true,
autofocus: true,
focusNode: FocusNode(),
onFocusChange: (focused) {},
);Picker
A generic picker that allows an item to be selected. It is composed of one or more wheels, optionally with separators between those wheels. The picker supports arrow key navigation. Recommended for touch devices.
Select Group
A group of items that allow users to make a selection from a set of options.