πGeolocation Overview
Quickstart
Create the Geolocator
val geolocator: Geolocator = Geolocator.mobile()Get current location
val result: GeolocatorResult = geolocator.current()
// Handle the result:
when (result) {
is GeolocatorResult.Success -> {
// Do something with result.location
}
is GeolocatorResult.Error -> when(result) {
is GeolocatorResult.NotSupported -> TODO()
is GeolocatorResult.NotFound -> TODO()
is GeolocatorResult.PermissionError -> TODO()
is GeolocatorResult.GeolocationFailed -> TODO()
}
}Last updated