|
|
@ -33,23 +33,21 @@ class DropdownButtonSettingsTile<T> extends InputSettingsTile<SelectOption<T>> { |
|
|
|
: Theme.of(context).textTheme.subtitle1!.copyWith(color: Theme.of(context).disabledColor), |
|
|
|
: Theme.of(context).textTheme.subtitle1!.copyWith(color: Theme.of(context).disabledColor), |
|
|
|
), |
|
|
|
), |
|
|
|
trailing: valuesSnapshot.hasData |
|
|
|
trailing: valuesSnapshot.hasData |
|
|
|
? DropdownButtonHideUnderline( |
|
|
|
? DropdownButton<T>( |
|
|
|
child: DropdownButton<T>( |
|
|
|
value: value, |
|
|
|
value: value, |
|
|
|
items: valuesSnapshot.data!.keys |
|
|
|
items: valuesSnapshot.data!.keys |
|
|
|
.map( |
|
|
|
.map( |
|
|
|
(final k) => DropdownMenuItem( |
|
|
|
(final k) => DropdownMenuItem( |
|
|
|
value: k, |
|
|
|
value: k, |
|
|
|
child: Text(valuesSnapshot.data![k]!(context)), |
|
|
|
child: Text(valuesSnapshot.data![k]!(context)), |
|
|
|
), |
|
|
|
), |
|
|
|
) |
|
|
|
) |
|
|
|
.toList(), |
|
|
|
.toList(), |
|
|
|
onChanged: enabledSnapshot.data ?? false |
|
|
|
onChanged: enabledSnapshot.data ?? false |
|
|
|
? (final value) async { |
|
|
|
? (final value) async { |
|
|
|
await option.set(value as T); |
|
|
|
await option.set(value as T); |
|
|
|
} |
|
|
|
} |
|
|
|
: null, |
|
|
|
: null, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
) |
|
|
|
) |
|
|
|
: null, |
|
|
|
: null, |
|
|
|
), |
|
|
|
), |
|
|
|