Location class

A data class representing a geographic location.

A location can consist of a latitude, longitude, timestamp, and other information such as bearing, altitude and velocity.

See: https://developer.android.com/reference/android/location/Location

Implemented types

Constructors

Location(double latitude, double longitude, { double accuracy, double altitude, double bearing, double bearingAccuracyDegrees, int elapsedRealtimeNanos, Bundle extras, String provider, double speed, double speedAccuracyMetersPerSecond, int time, double verticalAccuracyMeters })
const

Properties

accuracy → double
See: https://developer.android.com/reference/android/location/Location#CREATOR The estimated horizontal accuracy of this location, radial, in meters. [...]
final
altitude → double
The altitude if available, in meters above the WGS 84 reference ellipsoid [...]
final
bearing → double
The bearing, in degrees. [...]
final
bearingAccuracyDegrees → double
The estimated bearing accuracy of this location, in degrees. [...]
final
elapsedRealtimeNanos → int
The time of this fix, in elapsed real-time since system boot. [...]
final
extras Bundle
Any additional provider-specific information about the location fix. [...]
final
hasAccuracy → bool
True if this location has a horizontal accuracy. [...]
read-only
hasAltitude → bool
True if this location has an altitude. [...]
read-only
hasBearing → bool
True if this location has a bearing. [...]
read-only
hasBearingAccuracy → bool
True if this location has a bearing accuracy. [...]
read-only
hasSpeed → bool
True if this location has a speed. [...]
read-only
hasSpeedAccuracy → bool
True if this location fix has a speed accuracy. [...]
read-only
hasVerticalAccuracy → bool
True if this location fix has a vertical accuracy. [...]
read-only
isFromMockProvider → bool
True if this location fix came from a mock provider. [...]
read-only
latitude → double
The latitude, in degrees. [...]
final
longitude → double
The longitude, in degrees. [...]
final
provider → String
The name of the provider that generated this fix. [...]
final
speed → double
The speed if it is available, in meters/second over ground. [...]
final
speedAccuracyMetersPerSecond → double
The estimated speed accuracy of this location, in meters per second. [...]
final
time → int
The UTC time of this fix, in milliseconds since January 1, 1970. [...]
final
verticalAccuracyMeters → double
The estimated vertical accuracy of this location, in meters. [...]
final
hashCode → int
The hash code for this object.
read-only, inherited
runtimeType → Type
A representation of the runtime type of the object.
read-only, inherited

Methods

distanceTo(Location dest) → Future<double>
Returns the approximate distance in meters between this location and the given location. [...]
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
toString() → String
Returns a string representation of this object.
inherited

Operators

operator ==(dynamic other) → bool
The equality operator.
inherited

Static Methods

distanceBetween(double startLatitude, double startLongitude, double endLatitude, double endLongitude) → Future<double>
Computes the approximate distance in meters between two locations. [...]

Constants

FORMAT_DEGREES → const int
Constant used to specify formatting of a latitude or longitude in the form "+-DDD.DDDDD where D indicates degrees. [...]
0
FORMAT_MINUTES → const int
Constant used to specify formatting of a latitude or longitude in the form "+-DDD:MM.MMMMM" where D indicates degrees and M indicates minutes of arc (1 minute = 1/60th of a degree). [...]
1
FORMAT_SECONDS → const int
Constant used to specify formatting of a latitude or longitude in the form "DDD:MM:SS.SSSSS" where D indicates degrees, M indicates minutes of arc, and S indicates seconds of arc (1 minute = 1/60th of a degree, 1 second = 1/3600th of a degree). [...]
2