Fix one off locations

This commit is contained in:
Anton Tananaev 2025-05-31 22:23:11 -07:00
parent 0f37947be1
commit 13cabaccd1
2 changed files with 2 additions and 2 deletions

View file

@ -72,7 +72,7 @@ class _MainScreenState extends State<MainScreen> {
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);

View file

@ -27,7 +27,7 @@ class _QuickActionsInitializerState extends State<QuickActionsInitializer> {
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);