refactor
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good

This commit is contained in:
Scott E. Graves 2025-03-06 15:13:35 -06:00
parent 94073fe1f1
commit 5ed74aa5af
2 changed files with 16 additions and 27 deletions

View File

@ -32,12 +32,11 @@ class _MountSettingsWidgetState extends State<MountSettingsWidget> {
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<MountSettingsWidget> {
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<MountSettingsWidget> {
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<MountSettingsWidget> {
leading: Icon(icon),
value: DropdownButton<String>(
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<DropdownMenuItem<String>>((item) {
return DropdownMenuItem<String>(
@ -198,9 +192,7 @@ class _MountSettingsWidgetState extends State<MountSettingsWidget> {
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<MountSettingsWidget> {
content: TextField(
autofocus: true,
controller: TextEditingController(text: updatedValue),
onChanged: (value) {
updatedValue = value;
},
onChanged: (value) => updatedValue = value,
),
title: Text(key),
);

View File

@ -37,9 +37,8 @@ class _MountWidgetState extends State<MountWidget> {
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,