now shows correct position on first start of tracking
This commit is contained in:
@@ -125,7 +125,7 @@ class _ExcursionMainState extends State<ExcursionMain> {
|
||||
void initState() {
|
||||
GeolocatorService.deteterminePosition(
|
||||
alwaysOnNeeded: true,
|
||||
).then((result) => currentPosition = result).catchError((error) {
|
||||
).then((result) => currentPosition = result).catchError((error) async {
|
||||
if (error is LocationDisabledException) {
|
||||
if (mounted) {
|
||||
SnackBarHelper.showSnackBarMessage(
|
||||
@@ -142,8 +142,9 @@ class _ExcursionMainState extends State<ExcursionMain> {
|
||||
}
|
||||
} else if (error is NeedAlwaysLocation) {
|
||||
if (mounted) {
|
||||
AddEntriesDialogHelper.locationSettingsDialog(context);
|
||||
}
|
||||
bool reload = await AddEntriesDialogHelper.locationSettingsDialog(context);
|
||||
if (reload) GeolocatorService.deteterminePosition().then((res) => currentPosition = res).catchError((error) {return currentPosition;});
|
||||
}
|
||||
}
|
||||
return currentPosition;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user