Location class

Holds location information using the GPS format from the phone.

Inheritance
  • Object
  • Serializable
  • Data
  • SensorData
  • Geolocation
  • Location
Annotations
  • @JsonSerializable(fieldRename: FieldRename.none, includeIfNull: false)

Constructors

Location({double latitude = 0, double longitude = 0, double? altitude, double? accuracy, double? verticalAccuracy, double? heading, double? headingAccuracy, double? speed, double? speedAccuracy, DateTime? time, bool? isMock, double? elapsedRealtimeNanos, double? elapsedRealtimeUncertaintyNanos, int? satellites, String? provider})
Location.fromJson(Map<String, dynamic> json)
factory
Location.fromPositionData(Position position)
Create a Location object based on a Position from the geolocator plugin.

Properties

$type String?
The runtime class name (type) of this object. Used for deserialization from JSON objects.
getter/setter pairinherited
accuracy double?
Estimated horizontal accuracy of this location, radial, in meters
getter/setter pair
altitude double?
In meters above the WGS 84 reference ellipsoid. Derived from GPS information.
getter/setter pair
elapsedRealtimeNanos double?
Return the time of this fix, in elapsed real-time since system boot. Only available on Android https://developer.android.com/reference/android/location/Location#getElapsedRealtimeNanos()
getter/setter pair
elapsedRealtimeUncertaintyNanos double?
Get estimate of the relative precision of the alignment of the ElapsedRealtimeNanos timestamp. Only available on Android https://developer.android.com/reference/android/location/Location#getElapsedRealtimeUncertaintyNanos()
getter/setter pair
format → DataType
The format of this data as a DataType.
no setterinherited
fromJsonFunction Function
The function which can convert a JSON string to an object of this type.
no setteroverride
hashCode int
The hash code for this object.
no setterinherited
heading double?
Horizontal direction of travel of this device, in degrees.
getter/setter pair
headingAccuracy double?
Estimated bearing accuracy of this location, in degrees. Only available on Android. https://developer.android.com/reference/android/location/Location#getBearingAccuracyDegrees()
getter/setter pair
isMock bool?
Is the location currently mocked
getter/setter pair
jsonType String
Return the __type to be used for JSON serialization of this class. Default is runtimeType. Only specify this if you need another type.
no setterinherited
latitude double
Latitude in GPS coordinates.
getter/setter pairinherited
longitude double
Longitude in GPS coordinates.
getter/setter pairinherited
provider String?
The location provider. Only available on Android. Deprecated in API level 31.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
satellites int?
The number of satellites used to derive the fix. Only available on Android https://developer.android.com/reference/android/location/Location#getExtras()
getter/setter pair
sensorSpecificData ↔ Data?
Additional sensor-specific data pertaining to this data point. This can be used to append highly-specific sensor data to an otherwise common data type.
getter/setter pairinherited
speed double?
Estimated movement speed. In meters/second
getter/setter pair
speedAccuracy double?
Accuracy in speed estimation. In meters/second
getter/setter pair
time DateTime?
The time when this location was collected.
getter/setter pair
verticalAccuracy double?
Estimated vertical accuracy of this location, in meters.
getter/setter pair

Methods

equivalentTo(Data other) bool
Is this data equivalent to other?
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Return a JSON encoding of this object.
override
toString() String
A string representation of this object.
inherited

Operators

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

Constants

dataType → const String