hide CameraHistogram & CameraSpotDetector if purchasable

This commit is contained in:
Vadim 2023-11-08 15:09:33 +01:00
parent 17cd99e8a9
commit 1bd0fe577e

View file

@ -9,6 +9,7 @@ import 'package:lightmeter/screens/metering/components/camera_container/componen
import 'package:lightmeter/screens/metering/components/camera_container/components/camera_preview/components/camera_view_placeholder/widget_placeholder_camera_view.dart';
import 'package:lightmeter/screens/metering/components/camera_container/components/camera_preview/components/histogram/widget_histogram.dart';
import 'package:lightmeter/screens/metering/components/camera_container/models/camera_error_type.dart';
import 'package:m3_lightmeter_iap/m3_lightmeter_iap.dart';
class CameraPreview extends StatefulWidget {
final CameraController? controller;
@ -92,6 +93,7 @@ class _CameraPreviewBuilderState extends State<_CameraPreviewBuilder> {
alignment: Alignment.bottomCenter,
children: [
CameraView(controller: widget.controller),
if (IAPProducts.isPurchased(context, IAPProductType.paidFeatures)) ...[
if (UserPreferencesProvider.cameraFeatureOf(
context,
CameraFeature.histogram,
@ -108,6 +110,7 @@ class _CameraPreviewBuilderState extends State<_CameraPreviewBuilder> {
))
CameraSpotDetector(onSpotTap: widget.onSpotTap)
],
],
)
: const SizedBox.shrink(),
);