From c110e066503294abd615ac90a827d5d4f3f250ac Mon Sep 17 00:00:00 2001 From: Vadim <44135514+vodemn@users.noreply.github.com> Date: Sun, 29 Jan 2023 19:38:27 +0300 Subject: [PATCH] save evsource --- lib/providers/ev_source_type_provider.dart | 1 + lib/screens/metering/screen_metering.dart | 41 ++++++++++------------ 2 files changed, 20 insertions(+), 22 deletions(-) diff --git a/lib/providers/ev_source_type_provider.dart b/lib/providers/ev_source_type_provider.dart index 74b09d0..8c71d03 100644 --- a/lib/providers/ev_source_type_provider.dart +++ b/lib/providers/ev_source_type_provider.dart @@ -60,5 +60,6 @@ class EvSourceTypeProviderState extends State { valueListenable.value = EvSourceType.camera; break; } + context.read().evSourceType = valueListenable.value; } } diff --git a/lib/screens/metering/screen_metering.dart b/lib/screens/metering/screen_metering.dart index 9397e49..868dcf6 100644 --- a/lib/screens/metering/screen_metering.dart +++ b/lib/screens/metering/screen_metering.dart @@ -37,28 +37,25 @@ class _MeteringScreenState extends State { children: [ Expanded( child: BlocBuilder( - builder: (context, state) => AnimatedSwitcher( - duration: Dimens.durationS, - child: context.watch() == EvSourceType.camera - ? CameraContainerProvider( - fastest: state.fastest, - slowest: state.slowest, - iso: state.iso, - nd: state.nd, - onIsoChanged: (value) => _bloc.add(IsoChangedEvent(value)), - onNdChanged: (value) => _bloc.add(NdChangedEvent(value)), - exposurePairs: state.exposurePairs, - ) - : LightSensorContainerProvider( - fastest: state.fastest, - slowest: state.slowest, - iso: state.iso, - nd: state.nd, - onIsoChanged: (value) => _bloc.add(IsoChangedEvent(value)), - onNdChanged: (value) => _bloc.add(NdChangedEvent(value)), - exposurePairs: state.exposurePairs, - ), - ), + builder: (context, state) => context.watch() == EvSourceType.camera + ? CameraContainerProvider( + fastest: state.fastest, + slowest: state.slowest, + iso: state.iso, + nd: state.nd, + onIsoChanged: (value) => _bloc.add(IsoChangedEvent(value)), + onNdChanged: (value) => _bloc.add(NdChangedEvent(value)), + exposurePairs: state.exposurePairs, + ) + : LightSensorContainerProvider( + fastest: state.fastest, + slowest: state.slowest, + iso: state.iso, + nd: state.nd, + onIsoChanged: (value) => _bloc.add(IsoChangedEvent(value)), + onNdChanged: (value) => _bloc.add(NdChangedEvent(value)), + exposurePairs: state.exposurePairs, + ), ), ), MeteringBottomControls(