diff --git a/lib/screens/settings_widgets.dart b/lib/screens/settings_widgets.dart index ebc664a2..74d566f9 100644 --- a/lib/screens/settings_widgets.dart +++ b/lib/screens/settings_widgets.dart @@ -27,8 +27,8 @@ class ListPreference extends StatelessWidget { builder: (BuildContext context) { var children = []; for (var o in options) { - var tile = RadioListTile( - title: Text(o), + var tile = LabeledRadio( + label: o, value: o, groupValue: currentOption, onChanged: (String val) { @@ -39,10 +39,9 @@ class ListPreference extends StatelessWidget { } return AlertDialog( title: Text(title), - content: SingleChildScrollView( - child: ListBody( - children: children, - ), + content: Column( + children: children, + mainAxisSize: MainAxisSize.min, ), actions: [ FlatButton( @@ -97,3 +96,36 @@ class ProListTile extends StatelessWidget { ); } } + +class LabeledRadio extends StatelessWidget { + const LabeledRadio({ + this.label, + this.groupValue, + this.value, + this.onChanged, + }); + + final String label; + final String groupValue; + final String value; + final Function onChanged; + + @override + Widget build(BuildContext context) { + return InkWell( + onTap: () { + if (value != groupValue) onChanged(value); + }, + child: Row( + children: [ + Radio( + groupValue: groupValue, + value: value, + onChanged: onChanged, + ), + Text(label), + ], + ), + ); + } +}