Skip to content

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.

View source on GitHub ↗

CLI ​

Install this component into your project:

radio-button
$flutter_beautify add radio-button

Variants ​

FBRadioButton.standard() · FBRadioButton.outlined() — the plain constructor forwards to .standard().

Key parameters ​

ParameterTypeDefault
valueTrequired
groupValueT?— the currently selected value
onChangedValueChanged<T?>?—
labelString''
activeColorColor?—
sizedouble?—

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',
);

Released under the MIT License.