This commit is contained in:
Vadim 2023-01-29 19:55:44 +03:00
parent b244f36a11
commit b506b6132b
2 changed files with 2 additions and 10 deletions

View file

@ -19,18 +19,11 @@ import 'screens/metering/flow_metering.dart';
import 'screens/settings/flow_settings.dart'; import 'screens/settings/flow_settings.dart';
import 'utils/stop_type_provider.dart'; import 'utils/stop_type_provider.dart';
final RouteObserver<PageRoute> routeObserver = RouteObserver<PageRoute>(); class Application extends StatelessWidget {
class Application extends StatefulWidget {
final Environment env; final Environment env;
const Application(this.env, {super.key}); const Application(this.env, {super.key});
@override
State<Application> createState() => _ApplicationState();
}
class _ApplicationState extends State<Application> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return FutureBuilder( return FutureBuilder(
@ -42,7 +35,7 @@ class _ApplicationState extends State<Application> {
if (snapshot.data != null) { if (snapshot.data != null) {
return MultiProvider( return MultiProvider(
providers: [ providers: [
Provider.value(value: widget.env.copyWith(hasLightSensor: snapshot.data![1] as bool)), Provider.value(value: env.copyWith(hasLightSensor: snapshot.data![1] as bool)),
Provider(create: (_) => UserPreferencesService(snapshot.data![0] as SharedPreferences)), Provider(create: (_) => UserPreferencesService(snapshot.data![0] as SharedPreferences)),
Provider(create: (_) => const HapticsService()), Provider(create: (_) => const HapticsService()),
Provider(create: (_) => PermissionsService()), Provider(create: (_) => PermissionsService()),

View file

@ -4,7 +4,6 @@ import 'package:lightmeter/data/models/ev_source_type.dart';
import 'package:lightmeter/data/models/photography_values/photography_value.dart'; import 'package:lightmeter/data/models/photography_values/photography_value.dart';
import 'package:lightmeter/environment.dart'; import 'package:lightmeter/environment.dart';
import 'package:lightmeter/providers/ev_source_type_provider.dart'; import 'package:lightmeter/providers/ev_source_type_provider.dart';
import 'package:lightmeter/res/dimens.dart';
import 'components/bottom_controls/widget_bottom_controls.dart'; import 'components/bottom_controls/widget_bottom_controls.dart';
import 'components/camera_container/provider_container_camera.dart'; import 'components/camera_container/provider_container_camera.dart';