File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -56,14 +56,15 @@ class FormBuilderRadioGroup<T> extends FormBuilderField<T> {
56
56
return InputDecorator (
57
57
decoration: decoration.copyWith (
58
58
enabled: ! state.readOnly,
59
- errorText: decoration? .errorText ?? field .errorText,
59
+ errorText: decoration? .errorText ?? state .errorText,
60
60
),
61
61
child: GroupedRadio (
62
62
orientation: orientation,
63
63
value: initialValue,
64
64
options: options,
65
65
onChanged: (val) {
66
- field.didChange (val);
66
+ state.requestFocus ();
67
+ state.didChange (val);
67
68
},
68
69
activeColor: activeColor,
69
70
focusColor: focusColor,
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ class GroupedRadio<T> extends StatefulWidget {
20
20
final GroupedRadioOrientation orientation;
21
21
22
22
/// Called when the value of the checkbox group changes.
23
- final ValueChanged <List < T > > onChanged;
23
+ final ValueChanged <T > onChanged;
24
24
25
25
/// The color to use when this checkbox is checked.
26
26
///
@@ -264,6 +264,7 @@ class _GroupedRadioState<T> extends State<GroupedRadio<T>> {
264
264
setState (() {
265
265
selectedValue = selected;
266
266
});
267
+ widget.onChanged? .call (selectedValue);
267
268
},
268
269
);
269
270
@@ -276,6 +277,7 @@ class _GroupedRadioState<T> extends State<GroupedRadio<T>> {
276
277
setState (() {
277
278
selectedValue = widget.options[index].value;
278
279
});
280
+ widget.onChanged? .call (selectedValue);
279
281
},
280
282
);
281
283
You can’t perform that action at this time.
0 commit comments