setting to control modal barrier

This commit is contained in:
Fabian Freund
2026-03-11 15:54:18 +01:00
parent cdd7a3ffd5
commit c751c6fe15
9 changed files with 76 additions and 3 deletions
@@ -69,6 +69,7 @@ class _VisualSection extends StatelessWidget {
SettingSection(name: 'Visual'),
_UiZoomSection(),
_DisableAnimationsTile(),
_ShowModalBarrierTile(),
_ThemeSection(),
],
);
@@ -177,6 +178,34 @@ class _DisableAnimationsTile extends HookConsumerWidget {
}
}
class _ShowModalBarrierTile extends HookConsumerWidget {
const _ShowModalBarrierTile();
@override
Widget build(BuildContext context, WidgetRef ref) {
final showModalBarrier = ref.watch(
generalSettingsWithDefaultsProvider.select((s) => s.showModalBarrier),
);
return SwitchListTile.adaptive(
title: const Text('Show Modal Barrier'),
subtitle: const Text(
'Dim the background behind dialogs and bottom sheets',
),
secondary: const Icon(Icons.layers),
value: showModalBarrier,
onChanged: (value) async {
await ref
.read(saveGeneralSettingsControllerProvider.notifier)
.save(
(currentSettings) =>
currentSettings.copyWith.showModalBarrier(value),
);
},
);
}
}
class _TabBarSection extends StatelessWidget {
const _TabBarSection();