apply directly when tapping option in selection dialogs
This commit is contained in:
parent
751f2fcacc
commit
48606a9e39
1 changed files with 5 additions and 6 deletions
|
@ -37,11 +37,6 @@ class _AvesSelectionDialogState<T> extends State<AvesSelectionDialog> {
|
||||||
onPressed: () => Navigator.pop(context),
|
onPressed: () => Navigator.pop(context),
|
||||||
child: Text('Cancel'.toUpperCase()),
|
child: Text('Cancel'.toUpperCase()),
|
||||||
),
|
),
|
||||||
FlatButton(
|
|
||||||
key: Key('apply-button'),
|
|
||||||
onPressed: () => Navigator.pop(context, _selectedValue),
|
|
||||||
child: Text('Apply'.toUpperCase()),
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -50,7 +45,11 @@ class _AvesSelectionDialogState<T> extends State<AvesSelectionDialog> {
|
||||||
key: Key(value.toString()),
|
key: Key(value.toString()),
|
||||||
value: value,
|
value: value,
|
||||||
groupValue: _selectedValue,
|
groupValue: _selectedValue,
|
||||||
onChanged: (v) => setState(() => _selectedValue = v),
|
onChanged: (v) {
|
||||||
|
_selectedValue = v;
|
||||||
|
Navigator.pop(context, _selectedValue);
|
||||||
|
setState(() {});
|
||||||
|
},
|
||||||
title: Text(
|
title: Text(
|
||||||
title,
|
title,
|
||||||
softWrap: false,
|
softWrap: false,
|
||||||
|
|
Loading…
Reference in a new issue