From 595edbf70e271b5bfe2de604346336996a17443f Mon Sep 17 00:00:00 2001 From: Luke Date: Thu, 23 May 2024 11:38:11 +0100 Subject: [PATCH] fix: [TM-43252] taking time to capture an image --- lib/src/components/organisms/camera/camera_page.dart | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/src/components/organisms/camera/camera_page.dart b/lib/src/components/organisms/camera/camera_page.dart index f075cac..d748a25 100644 --- a/lib/src/components/organisms/camera/camera_page.dart +++ b/lib/src/components/organisms/camera/camera_page.dart @@ -46,6 +46,7 @@ class ZdsCamera extends StatelessWidget { this.cameraMode = ZdsCameraMode.photo, this.maxVideoDuration, this.showPreview = true, + this.saveGPSLocation = false, this.photoPathBuilder, this.videoPathBuilder, this.filters, @@ -60,6 +61,9 @@ class ZdsCamera extends StatelessWidget { /// - [showPreview] determines whether the camera preview is shown before selecting a file, enabled by default. final bool showPreview; + /// - [saveGPSLocation] determines whether the camera output be tagged with GPS location, disabled by default. + final bool saveGPSLocation; + /// A builder for the path to save the photo or video file. /// /// This builder is used to specify the path to save the photo or video file. @@ -87,6 +91,7 @@ class ZdsCamera extends StatelessWidget { BuildContext context, { bool showPreview = true, bool rootNavigator = true, + bool saveGPSLocation = false, CaptureRequestBuilder? photoPathBuilder, CaptureRequestBuilder? videoPathBuilder, List? filters, @@ -98,6 +103,7 @@ class ZdsCamera extends StatelessWidget { ZdsFadePageRouteBuilder( builder: (context) => ZdsCamera( showPreview: showPreview, + saveGPSLocation: saveGPSLocation, photoPathBuilder: photoPathBuilder, videoPathBuilder: videoPathBuilder, filters: filters, @@ -242,7 +248,7 @@ class ZdsCamera extends StatelessWidget { ), ) : SaveConfig.photo( - exifPreferences: ExifPreferences(saveGPSLocation: true), + exifPreferences: ExifPreferences(saveGPSLocation: saveGPSLocation), pathBuilder: videoPathBuilder ?? (sensors) async { final Directory extDir = await getTemporaryDirectory(); @@ -270,7 +276,8 @@ class ZdsCamera extends StatelessWidget { ..add(DiagnosticsProperty('showPreview', showPreview)) ..add(ObjectFlagProperty.has('photoPathBuilder', photoPathBuilder)) ..add(ObjectFlagProperty.has('videoPathBuilder', videoPathBuilder)) - ..add(IterableProperty('filters', filters)); + ..add(IterableProperty('filters', filters)) + ..add(DiagnosticsProperty('saveGPSLocation', saveGPSLocation)); } }