diff --git a/lib/providers/user_preferences_provider.dart b/lib/providers/user_preferences_provider.dart index 9527c14..b3acbc0 100644 --- a/lib/providers/user_preferences_provider.dart +++ b/lib/providers/user_preferences_provider.dart @@ -74,7 +74,7 @@ class _UserPreferencesProviderState extends State late bool dynamicColor = userPreferencesService.dynamicColor; late EvSourceType evSourceType; late MeteringScreenLayoutConfig meteringScreenLayout = - ServicesProvider.of(context).userPreferencesService.meteringScreenLayout; + userPreferencesService.meteringScreenLayout; late Color primaryColor = userPreferencesService.primaryColor; late StopType stopType = userPreferencesService.stopType; late SupportedLocale locale = userPreferencesService.locale; @@ -83,7 +83,7 @@ class _UserPreferencesProviderState extends State @override void initState() { super.initState(); - evSourceType = ServicesProvider.of(context).userPreferencesService.evSourceType; + evSourceType = userPreferencesService.evSourceType; evSourceType = evSourceType == EvSourceType.sensor && !ServicesProvider.of(context).environment.hasLightSensor ? EvSourceType.camera @@ -145,7 +145,7 @@ class _UserPreferencesProviderState extends State setState(() { dynamicColor = enable; }); - ServicesProvider.of(context).userPreferencesService.dynamicColor = enable; + userPreferencesService.dynamicColor = enable; } void toggleEvSourceType() { @@ -160,7 +160,7 @@ class _UserPreferencesProviderState extends State evSourceType = EvSourceType.camera; } }); - ServicesProvider.of(context).userPreferencesService.evSourceType = evSourceType; + userPreferencesService.evSourceType = evSourceType; } void setLocale(SupportedLocale locale) { @@ -168,7 +168,7 @@ class _UserPreferencesProviderState extends State setState(() { this.locale = locale; }); - ServicesProvider.of(context).userPreferencesService.locale = locale; + userPreferencesService.locale = locale; }); } @@ -176,28 +176,28 @@ class _UserPreferencesProviderState extends State setState(() { meteringScreenLayout = config; }); - ServicesProvider.of(context).userPreferencesService.meteringScreenLayout = meteringScreenLayout; + userPreferencesService.meteringScreenLayout = meteringScreenLayout; } void setPrimaryColor(Color primaryColor) { setState(() { this.primaryColor = primaryColor; }); - ServicesProvider.of(context).userPreferencesService.primaryColor = primaryColor; + userPreferencesService.primaryColor = primaryColor; } void setStopType(StopType stopType) { setState(() { this.stopType = stopType; }); - ServicesProvider.of(context).userPreferencesService.stopType = stopType; + userPreferencesService.stopType = stopType; } void setThemeType(ThemeType themeType) { setState(() { this.themeType = themeType; }); - ServicesProvider.of(context).userPreferencesService.themeType = themeType; + userPreferencesService.themeType = themeType; } Brightness get _themeBrightness {