CopyPastor

Detecting plagiarism made easy.

Score: 0.8755800644004786; Reported for: String similarity Open both answers

Possible Plagiarism

Plagiarized on 2022-07-28
by Abdul Momen

Original Post

Original - Posted on 2020-07-30
by Muyide Ibukun



            
Present in both answers; Present only in the new answer; Present only in the old answer;


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; }); }, ) ]


        
Present in both answers; Present only in the new answer; Present only in the old answer;