Finding Location
Get current location finds where the person is, once, and hands it to the next step: show events near them, fill in a pickup point, or record where a report was made. One design works on iOS, Android and the web.
Adding it
Add Get current location to a button and fill in:
Using the position
The result has three numbers: latitude, longitude and accuracy, how sure the device is, in metres. Pick them in the data picker anywhere after it: a screen parameter, a record's values, a message.
Get current location Accuracy: precise, Result name: here
On success Create a report with latitude = here → latitude,
longitude = here → longitude
On error Show "We couldn't find you. Try again outside."Always fresh, one at a time
Asking
Location is asked for first, exactly as Ask for permission does, so there is never an Ask for permission in front of it. Refused, On denied runs with the reason; location switched off on the device is unavailable. iOS shows your Location message from App, Permission messages.
What each export uses
Flutter. geolocator for the position; asking stays with permission_handler.
Expo. expo-location.
Web. The browser's own geolocation. A browser that has been refused once will not ask again, so there the reason is blocked.
Trying it
In Preview there is no position: it uses a fixed one, Accra, and says so, then runs On success. On a device, try it once indoors and once outside; to check the refused case, turn location off for the app in Settings first.