diff --git a/web/repertory/lib/widgets/mount_settings.dart b/web/repertory/lib/widgets/mount_settings.dart index 56468eea..c5a77aca 100644 --- a/web/repertory/lib/widgets/mount_settings.dart +++ b/web/repertory/lib/widgets/mount_settings.dart @@ -32,12 +32,11 @@ class _MountSettingsWidgetState extends State { leading: Icon(Icons.quiz), title: Text(key), initialValue: (value as bool), - onPressed: (_) { - setState(() { - root[key] = !value; - widget.onChanged?.call(widget.settings); - }); - }, + onPressed: + (_) => setState(() { + root[key] = !value; + widget.onChanged?.call(widget.settings); + }), onToggle: (bool nextValue) { setState(() { root[key] = nextValue; @@ -65,9 +64,7 @@ class _MountSettingsWidgetState extends State { actions: [ TextButton( child: Text('Cancel'), - onPressed: () { - Navigator.of(context).pop(); - }, + onPressed: () => Navigator.of(context).pop(), ), TextButton( child: Text('OK'), @@ -85,9 +82,7 @@ class _MountSettingsWidgetState extends State { controller: TextEditingController(text: updatedValue), inputFormatters: [FilteringTextInputFormatter.digitsOnly], keyboardType: TextInputType.number, - onChanged: (nextValue) { - updatedValue = nextValue; - }, + onChanged: (nextValue) => updatedValue = nextValue, ), title: Text(key), ); @@ -151,12 +146,11 @@ class _MountSettingsWidgetState extends State { leading: Icon(icon), value: DropdownButton( value: value, - onChanged: (newValue) { - setState(() { - root[key] = newValue; - widget.onChanged?.call(widget.settings); - }); - }, + onChanged: + (newValue) => setState(() { + root[key] = newValue; + widget.onChanged?.call(widget.settings); + }), items: valueList.map>((item) { return DropdownMenuItem( @@ -198,9 +192,7 @@ class _MountSettingsWidgetState extends State { actions: [ TextButton( child: Text('Cancel'), - onPressed: () { - Navigator.of(context).pop(); - }, + onPressed: () => Navigator.of(context).pop(), ), TextButton( child: Text('OK'), @@ -216,9 +208,7 @@ class _MountSettingsWidgetState extends State { content: TextField( autofocus: true, controller: TextEditingController(text: updatedValue), - onChanged: (value) { - updatedValue = value; - }, + onChanged: (value) => updatedValue = value, ), title: Text(key), ); diff --git a/web/repertory/lib/widgets/mount_widget.dart b/web/repertory/lib/widgets/mount_widget.dart index 49bb6da0..ec8b3b71 100644 --- a/web/repertory/lib/widgets/mount_widget.dart +++ b/web/repertory/lib/widgets/mount_widget.dart @@ -37,9 +37,8 @@ class _MountWidgetState extends State { isThreeLine: true, leading: IconButton( icon: Icon(Icons.settings, color: textColor), - onPressed: () { - Navigator.pushNamed(context, '/edit', arguments: mount); - }, + onPressed: + () => Navigator.pushNamed(context, '/edit', arguments: mount), ), subtitle: Column( crossAxisAlignment: CrossAxisAlignment.start,