Browse Source

refactor(neon): Use switches instead of checkboxes

Signed-off-by: jld3103 <jld3103yt@gmail.com>
pull/845/head
jld3103 1 year ago
parent
commit
240dd27b30
No known key found for this signature in database
GPG Key ID: 9062417B9E8EB7B3
  1. 2
      packages/app/integration_test/screenshot_test.dart
  2. 7
      packages/neon/neon/lib/src/settings/widgets/toggle_settings_tile.dart

2
packages/app/integration_test/screenshot_test.dart

@ -346,7 +346,7 @@ Future<void> main() async {
await binding.takeScreenshot('settings_dark');
// Enable OLED theme
await tester.tap(find.byType(CheckboxListTile).first);
await tester.tap(find.byType(SwitchListTile).first);
await tester.pumpAndSettle();
await binding.takeScreenshot('settings_oled');

7
packages/neon/neon/lib/src/settings/widgets/toggle_settings_tile.dart

@ -13,13 +13,10 @@ class ToggleSettingsTile extends InputSettingsTile<ToggleOption> {
@override
Widget build(final BuildContext context) => ValueListenableBuilder(
valueListenable: option,
builder: (final context, final value, final child) => CheckboxListTile.adaptive(
enabled: option.enabled,
builder: (final context, final value, final child) => SwitchListTile.adaptive(
title: child,
value: value,
onChanged: (final value) {
option.value = value!;
},
onChanged: option.enabled ? (final value) => option.value = value : null,
),
child: Text(option.label(context)),
);

Loading…
Cancel
Save