Geolocator

interface Geolocator

Provides geolocation operations:

  • Track the location.

  • Get the current location.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open val locationUpdates: Flow<Location>

A flow of location updates.

Link copied to clipboard
abstract val trackingStatus: Flow<TrackingStatus>

A flow of the current status of location tracking.

Functions

Link copied to clipboard
abstract suspend fun current(priority: Priority = Priority.Balanced): GeolocatorResult

Get the current location.

Link copied to clipboard

Gets the current location or null if the location is not available.

Link copied to clipboard

Check if the current Geolocator has the permissions required for geolocation.

Link copied to clipboard
abstract suspend fun isAvailable(): Boolean

Check if location services are available.

Link copied to clipboard
open suspend fun startTracking(request: LocationRequest = LocationRequest()): TrackingStatus

Start tracking the location and wait for the first location update.

Link copied to clipboard
abstract fun stopTracking()

Stop tracking the location.

Link copied to clipboard
abstract fun track(request: LocationRequest = LocationRequest()): Flow<TrackingStatus>

Start tracking the location.