LocationPlatform class abstract

The interface that implementations of location must implement.

Platform implementations should extend this class rather than implement it as Location. 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 LocationPlatform methods.

Inheritance
  • Object
  • PlatformInterface
  • LocationPlatform

Constructors

LocationPlatform()
Constructs a LocationPlatform.

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

getLocation({LocationSettings? settings}) Future<LocationData?>
Return the current location.
getPermissionStatus() Future<PermissionStatus?>
Get the permission status of the app
isGPSEnabled() Future<bool?>
Return true if GPS is enabled on the device
isNetworkEnabled() Future<bool?>
Return true if Network is enabled on the device
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onLocationChanged({bool inBackground = false}) Stream<LocationData?>
Return a stream of the user's location.
openAppSettings() Future<bool>
Will open the App settings page. Returns true if the location settings page could be opened, otherwise or false if not.
openLocationSettings() Future<bool>
Will open the location settings page. Returns true if the location settings page could be opened, otherwise or false if not.
requestPermission() Future<PermissionStatus?>
Request location permission for the app
setLocationSettings(LocationSettings settings) Future<bool?>
Set new global location settings for the app
toString() String
A string representation of this object.
inherited
updateBackgroundNotification({String? channelName, String? title, String? iconName, String? subtitle, String? description, Color? color, bool? onTapBringToFront}) Future<bool?>
Return true if the notification was properly updated

Operators

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

Static Properties

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