Radio<T> constructor
- Key? key,
- required T value,
- required T? groupValue,
- required ValueChanged<
T?> ? onChanged, - MouseCursor? mouseCursor,
- bool toggleable = false,
- Color? activeColor,
- MaterialStateProperty<
Color?> ? fillColor, - Color? focusColor,
- Color? hoverColor,
- MaterialStateProperty<
Color?> ? overlayColor, - double? splashRadius,
- MaterialTapTargetSize? materialTapTargetSize,
- VisualDensity? visualDensity,
- FocusNode? focusNode,
- bool autofocus = false,
Creates a Material Design radio button.
The radio button itself does not maintain any state. Instead, when the
radio button is selected, the widget calls the onChanged
callback. Most
widgets that use a radio button will listen for the onChanged
callback
and rebuild the radio button with a new groupValue
to update the visual
appearance of the radio button.
The following arguments are required:
value
andgroupValue
together determine whether the radio button is selected.onChanged
is called when the user selects this radio button.
Implementation
const Radio({
super.key,
required this.value,
required this.groupValue,
required this.onChanged,
this.mouseCursor,
this.toggleable = false,
this.activeColor,
this.fillColor,
this.focusColor,
this.hoverColor,
this.overlayColor,
this.splashRadius,
this.materialTapTargetSize,
this.visualDensity,
this.focusNode,
this.autofocus = false,
}) : _radioType = _RadioType.material,
useCupertinoCheckmarkStyle = false;