Skip to main content

RadioGroup

Stac radioGroup allows you to build the 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.
groupValuedynamicThe currently selected value for a group of radio buttons.
childMap<String, dynamic>The child of radioGroup.

Radio Properties​

PropertyTypeDescription
radioTypeStacRadioTypeThe type of radio.
valuedynamicThe value represented by this radio.
onChangedMap<String, dynamic>The action needs trigger when radio value change.
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.
activeColorStringThe color to use when this radio button is selected.
inactiveColorStringThe color to use when this radio button is not selected.
fillColorStringThe color that fills the radio button, in all WidgetStates.
focusColorStringThe color for the radio's Material when it has the input focus.
hoverColorStringThe color for the radio's Material when a pointer is hovering over it.
overlayColorStringThe color for the radio's Material.
splashRadiusdoubleThe splash radius of the circular Material ink response.
materialTapTargetSizeMaterialTapTargetSizeConfigures 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.

Example JSON​

{
"type": "radioGroup",
"child": {
"type": "column",
"children": [
{
"type": "listTile",
"leading": {
"type": "radio",
"radioType": "adaptive",
"value": "1",
"groupValue": "1"
},
"title": {
"type": "text",
"data": "Male",
"align": "center",
"style": {
"fontSize": 21
}
}
},
{
"type": "listTile",
"leading": {
"type": "radio",
"radioType": "adaptive",
"value": "2",
"groupValue": "1"
},
"title": {
"type": "text",
"data": "Female",
"align": "center",
"style": {
"fontSize": 21
}
}
},
{
"type": "listTile",
"leading": {
"type": "radio",
"radioType": "adaptive",
"value": "3",
"groupValue": "1"
},
"title": {
"type": "text",
"data": "Other",
"align": "center",
"style": {
"fontSize": 21
}
}
}
]
}
}