From 13cabaccd13f61ebd6eb0c59c3775110df1c7a52 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 31 May 2025 22:23:11 -0700 Subject: [PATCH] Fix one off locations --- lib/main_screen.dart | 2 +- lib/quick_actions.dart | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/main_screen.dart b/lib/main_screen.dart index 5804ba2..7b9d7be 100644 --- a/lib/main_screen.dart +++ b/lib/main_screen.dart @@ -72,7 +72,7 @@ class _MainScreenState extends State { FilledButton.tonal( onPressed: () async { try { - await bg.BackgroundGeolocation.getCurrentPosition(samples: 1); + await bg.BackgroundGeolocation.getCurrentPosition(samples: 1, persist: true); await bg.BackgroundGeolocation.sync(); } catch (error) { developer.log('Failed to fetch location', error: error); diff --git a/lib/quick_actions.dart b/lib/quick_actions.dart index f8d3bb4..2a7590a 100644 --- a/lib/quick_actions.dart +++ b/lib/quick_actions.dart @@ -27,7 +27,7 @@ class _QuickActionsInitializerState extends State { bg.BackgroundGeolocation.stop(); case 'sos': try { - await bg.BackgroundGeolocation.getCurrentPosition(samples: 1, extras: {'alarm': 'sos'}); + await bg.BackgroundGeolocation.getCurrentPosition(samples: 1, persist: true, extras: {'alarm': 'sos'}); await bg.BackgroundGeolocation.sync(); } catch (error) { developer.log('Failed to send alert', error: error);