Browse Source

settings: Show underline for select options

pull/23/head
jld3103 2 years ago
parent
commit
0df3dcf1a8
No known key found for this signature in database
GPG Key ID: 9062417B9E8EB7B3
  1. 32
      packages/settings/lib/src/widgets/dropdown_button_settings_tile.dart

32
packages/settings/lib/src/widgets/dropdown_button_settings_tile.dart

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

Loading…
Cancel
Save