mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-08-05 02:28:36 +02:00
feat(appearance): manual toggle to force backdrop blur on lower device tiers
This commit is contained in:
@@ -1,10 +1,19 @@
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:spotiflac_android/providers/settings_provider.dart';
|
||||
|
||||
/// True on low-end hardware (arm32-only or low-RAM, resolved at startup in
|
||||
/// main.dart via a ProviderScope override). UI uses it to skip expensive
|
||||
/// effects like the shell's backdrop blur.
|
||||
final lowEndDeviceProvider = Provider<bool>((ref) => false);
|
||||
|
||||
/// Generic visual capability decided by the startup runtime profile. Effects
|
||||
/// can consume this without hardcoding a device model or platform source.
|
||||
final backdropBlurEnabledProvider = Provider<bool>((ref) => false);
|
||||
/// Raw device capability decided by the startup runtime profile (overridden
|
||||
/// in main.dart). Only the `high` tier enables blur by default.
|
||||
final deviceSupportsBackdropBlurProvider = Provider<bool>((ref) => false);
|
||||
|
||||
/// Whether backdrop blur effects should render: the device default, or the
|
||||
/// user's manual override from appearance settings (issue #488 — let lower
|
||||
/// tiers opt back in).
|
||||
final backdropBlurEnabledProvider = Provider<bool>((ref) {
|
||||
return ref.watch(deviceSupportsBackdropBlurProvider) ||
|
||||
ref.watch(settingsProvider.select((s) => s.forceBackdropBlur));
|
||||
});
|
||||
|
||||
@@ -658,6 +658,11 @@ class SettingsNotifier extends Notifier<AppSettings> {
|
||||
_saveSettings();
|
||||
}
|
||||
|
||||
void setForceBackdropBlur(bool enabled) {
|
||||
state = state.copyWith(forceBackdropBlur: enabled);
|
||||
_saveSettings();
|
||||
}
|
||||
|
||||
void setExtensionVerificationBrowserMode(String mode) {
|
||||
state = state.copyWith(
|
||||
extensionVerificationBrowserMode:
|
||||
|
||||
Reference in New Issue
Block a user