From 3643f04250eca86e06f031c3ecc982961a30cdd0 Mon Sep 17 00:00:00 2001 From: Vadim Date: Thu, 13 Jul 2023 15:05:30 +0200 Subject: [PATCH] calculate layout height based on `MeteringScreenLayoutFeature` --- .../camera_container/widget_container_camera.dart | 7 +++++-- .../readings_container/widget_container_readings.dart | 8 ++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/lib/screens/metering/components/camera_container/widget_container_camera.dart b/lib/screens/metering/components/camera_container/widget_container_camera.dart index 8d2885d..260eae4 100644 --- a/lib/screens/metering/components/camera_container/widget_container_camera.dart +++ b/lib/screens/metering/components/camera_container/widget_container_camera.dart @@ -17,7 +17,6 @@ import 'package:lightmeter/screens/metering/components/camera_container/state_co import 'package:lightmeter/screens/metering/components/shared/exposure_pairs_list/widget_list_exposure_pairs.dart'; import 'package:lightmeter/screens/metering/components/shared/metering_top_bar/widget_top_bar_metering.dart'; import 'package:lightmeter/screens/metering/components/shared/readings_container/widget_container_readings.dart'; -import 'package:m3_lightmeter_iap/m3_lightmeter_iap.dart'; import 'package:m3_lightmeter_resources/m3_lightmeter_resources.dart'; class CameraContainer extends StatelessWidget { @@ -52,7 +51,11 @@ class CameraContainer extends StatelessWidget { double topBarOverflow = Dimens.readingContainerSingleValueHeight + // ISO & ND -cameraViewHeight; - if (IAPProducts.isPurchased(context, IAPProductType.equipment)) { + + if (MeteringScreenLayout.featureOf( + context, + MeteringScreenLayoutFeature.equipmentProfiles, + )) { topBarOverflow += Dimens.readingContainerSingleValueHeight; topBarOverflow += Dimens.paddingS; } diff --git a/lib/screens/metering/components/shared/readings_container/widget_container_readings.dart b/lib/screens/metering/components/shared/readings_container/widget_container_readings.dart index 98badc1..1a3911e 100644 --- a/lib/screens/metering/components/shared/readings_container/widget_container_readings.dart +++ b/lib/screens/metering/components/shared/readings_container/widget_container_readings.dart @@ -9,7 +9,6 @@ import 'package:lightmeter/res/dimens.dart'; import 'package:lightmeter/screens/metering/components/shared/readings_container/components/animated_dialog_picker/widget_picker_dialog_animated.dart'; import 'package:lightmeter/screens/metering/components/shared/readings_container/components/reading_value_container/widget_container_reading_value.dart'; import 'package:lightmeter/utils/inherited_generics.dart'; -import 'package:m3_lightmeter_iap/m3_lightmeter_iap.dart'; import 'package:m3_lightmeter_resources/m3_lightmeter_resources.dart'; class ReadingsContainer extends StatelessWidget { @@ -36,12 +35,13 @@ class ReadingsContainer extends StatelessWidget { @override Widget build(BuildContext context) { - final layout = MeteringScreenLayout.of(context); return Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ - if (IAPProducts.isPurchased(context, IAPProductType.equipment) && - layout[MeteringScreenLayoutFeature.equipmentProfiles]!) ...[ + if (MeteringScreenLayout.featureOf( + context, + MeteringScreenLayoutFeature.equipmentProfiles, + )) ...[ const _EquipmentProfilePicker(), const _InnerPadding(), ],