Radio constructor

const Radio({
  1. Key? key,
  2. required bool value,
  3. bool focusing = false,
  4. double? size,
  5. Color? activeColor,
  6. Color? borderColor,
  7. Color? backgroundColor,
})

Creates a Radio with the specified selection state and styling.

The value parameter is required and determines whether the radio appears selected. All other parameters are optional and will fall back to theme values when not specified.

Parameters:

  • value (bool, required): Whether the radio button is selected
  • focusing (bool, default: false): Whether the radio has focus
  • size (double?, optional): Size of the radio button in pixels
  • activeColor (Color?, optional): Color of the selection indicator
  • borderColor (Color?, optional): Color of the outer border
  • backgroundColor (Color?, optional): Color of the background fill

Example:

Radio(
  value: selectedValue == itemValue,
  focusing: focusNode.hasFocus,
  size: 18,
);

Implementation

const Radio({
  super.key,
  required this.value,
  this.focusing = false,
  this.size,
  this.activeColor,
  this.borderColor,
  this.backgroundColor,
});