You will have to get the default value from the json.
value_from_json = 1 ;
Let's assumed this is a part of your Radio buttons widget. the `_radioValue` variable is the one responsible for the selected value. So you have to initialize the value early on .
int _radioValue = value_from_json ;
The selected value will be the one with the radio that have the same `value` field
children: <Widget>[
Radio(
value: 0,
groupValue: _radioValue,
onChanged: (int value) {
setState(() {
_radioValue = value;
});
},
),
Radio(
value: 1,
groupValue: _radioValue,
onChanged: (int value) {
setState(() {
_radioValue = value;
});
},
)
]
You will have to get the default value from the json.
value_from_json = 1 ;
Let's assumed this is a part of your Radio buttons widget. the `_radioValue` variable is the one responsible for the selected value.
So you have to initialize the value early on .
int _radioValue = value_from_json ;
The selected value will be the one with the radio that have the same `value` field
children: <Widget>[
Radio(
value: 0,
groupValue: _radioValue,
onChanged: (int value) {
setState(() {
_radioValue = value;
});
},
),
Radio(
value: 1,
groupValue: _radioValue,
onChanged: (int value) {
setState(() {
_radioValue = value;
});
},
)
]