Skip to main content
The Stac RadioGroup allows you to build Flutter Radio widgets using JSON. To know more about the Radio widget in Flutter, refer to the official documentation.

RadioGroup Properties

PropertyTypeDescription
idStringThe id will be used to save the selected value of radio.
groupValueStringThe currently selected value for a group of radio buttons.
childStacWidgetThe child of radioGroup.

Radio Properties

PropertyTypeDescription
radioTypeStacRadioTypeThe type of radio.
valueStringThe value represented by this radio.
mouseCursorStacMouseCursorThe cursor for a mouse pointer when it enters or is hovering over the radio.
toggleableboolSet to true if this wanted to deselect when selected.
activeColorStacColorThe color to use when this radio button is selected.
inactiveColorStacColorThe color to use when this radio button is not selected.
fillColorStacColorThe color that fills the radio button, in all WidgetStates.
focusColorStacColorThe color for the radio’s Material when it has the input focus.
hoverColorStacColorThe color for the radio’s Material when a pointer is hovering over it.
overlayColorStacColorThe color for the radio’s Material.
splashRadiusdoubleThe splash radius of the circular Material ink response.
materialTapTargetSizeStacMaterialTapTargetSizeConfigures the minimum size of the tap target.
visualDensityStacVisualDensityDefines how compact the radio’s layout will be.
autofocusboolTrue if this widget will be selected as the initial focus when no other node in its scope is currently focused.
useCheckmarkStyleboolControls whether the radio displays in a checkbox style or the default iOS radio style.
useCupertinoCheckmarkStyleboolControls whether the checkmark style is used in an iOS-style radio.
enabledboolWhether this radio is enabled for user interaction.
backgroundColorStacColorThe background color of the radio.
sideStacBorderSideThe border side of the radio.
innerRadiusdoubleThe inner radius of the radio in logical pixels.

Example

StacRadioGroup(
  child: StacColumn(
    children: [
      StacListTile(
        leading: StacRadio(
          radioType: StacRadioType.adaptive,
          value: '1',
          groupValue: '1',
        ),
        title: StacText(
          data: 'Male',
          textAlign: StacTextAlign.center,
          style: StacTextStyle(fontSize: 21),
        ),
      ),
      StacListTile(
        leading: StacRadio(
          radioType: StacRadioType.adaptive,
          value: '2',
          groupValue: '1',
        ),
        title: StacText(
          data: 'Female',
          textAlign: StacTextAlign.center,
          style: StacTextStyle(fontSize: 21),
        ),
      ),
      StacListTile(
        leading: StacRadio(
          radioType: StacRadioType.adaptive,
          value: '3',
          groupValue: '1',
        ),
        title: StacText(
          data: 'Other',
          textAlign: StacTextAlign.center,
          style: StacTextStyle(fontSize: 21),
        ),
      ),
    ],
  ),
)