You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
1000 B
29 lines
1000 B
part of '../../settings.dart'; |
|
|
|
class CheckBoxSettingsTile extends InputSettingsTile<ToggleOption> { |
|
const CheckBoxSettingsTile({ |
|
required super.option, |
|
super.key, |
|
}); |
|
|
|
@override |
|
Widget build(final BuildContext context) => OptionBuilder<bool>( |
|
option: option, |
|
builder: (final context, final value) => value == null |
|
? Container() |
|
: StreamBuilder<bool>( |
|
stream: option.enabled, |
|
builder: (final context, final enabledSnapshot) => !enabledSnapshot.hasData |
|
? Container() |
|
: CheckboxListTile( |
|
title: Text(option.label(context)), |
|
value: value, |
|
onChanged: enabledSnapshot.data! |
|
? (final value) async { |
|
await option.set(value!); |
|
} |
|
: null, |
|
), |
|
), |
|
); |
|
}
|
|
|