GeolocatorPlatform class abstract

The interface that implementations of geolocator must implement.

Platform implementations should extend this class rather than implement it as geolocator does not consider newly added methods to be breaking changes. Extending this class (using extends) ensures that the subclass will get the default implementation, while platform implementations that implements this interface will be broken by newly added GeolocatorPlatform methods.

Inheritance
  • Object
  • PlatformInterface
  • GeolocatorPlatform

Constructors

GeolocatorPlatform()
Constructs a GeolocatorPlatform.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

bearingBetween(double startLatitude, double startLongitude, double endLatitude, double endLongitude) double
Calculates the initial bearing between two points
checkPermission() Future<LocationPermission>
Returns a Future indicating if the user allows the App to access the device's location.
distanceBetween(double startLatitude, double startLongitude, double endLatitude, double endLongitude) double
Calculates the distance between the supplied coordinates in meters.
getCurrentPosition({LocationAccuracy desiredAccuracy = LocationAccuracy.best, bool forceAndroidLocationManager = false, Duration? timeLimit}) Future<Position>
Returns the current position taking the supplied desiredAccuracy into account.
getLastKnownPosition({bool forceAndroidLocationManager = false}) Future<Position?>
Returns the last known position stored on the users device.
getLocationAccuracy() Future<LocationAccuracyStatus>
Returns a Future containing a LocationAccuracyStatus.
getPositionStream({LocationAccuracy desiredAccuracy = LocationAccuracy.best, int distanceFilter = 0, bool forceAndroidLocationManager = false, int timeInterval = 0, Duration? timeLimit}) Stream<Position>
Fires whenever the location changes inside the bounds of the desiredAccuracy.
getServiceStatusStream() Stream<ServiceStatus>
Fires when the location Service is manually disabled or enabled.
isLocationServiceEnabled() Future<bool>
Returns a Future containing a bool value indicating whether location services are enabled on the device.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
openAppSettings() Future<bool>
Opens the App settings page.
openLocationSettings() Future<bool>
Opens the location settings page.
requestPermission() Future<LocationPermission>
Request permission to access the location of the device.
requestTemporaryFullAccuracy({required String purposeKey}) Future<LocationAccuracyStatus>
Asks the user for Temporary Precise location access (iOS 14 or above).
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

instance GeolocatorPlatform
The default instance of GeolocatorPlatform to use.
getter/setter pair