RadioButton
A labeled radio button, generic over T the same way Flutter's own Radio<T> is — pass whatever type you're using to represent the selected option.
dart
FBRadioButton<String>.standard(
value: 'a',
groupValue: selected,
onChanged: (v) => setState(() => selected = v),
label: 'Option A',
);1
2
3
4
5
6
2
3
4
5
6
CLI
Install this component into your project:
radio-button
$
flutter_beautify add radio-buttonVariants
FBRadioButton.standard() · FBRadioButton.outlined() — the plain constructor forwards to .standard().
Key parameters
| Parameter | Type | Default |
|---|---|---|
value | T | required |
groupValue | T? | — the currently selected value |
onChanged | ValueChanged<T?>? | — |
label | String | '' |
activeColor | Color? | — |
size | double? | — |
Usage
dart
import 'package:your_app/widgets/radio_button.dart';
FBRadioButton<String>.standard(
value: 'a',
groupValue: selected,
onChanged: (v) => setState(() => selected = v),
label: 'Option A',
);1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
