LocationCoordinate class

A geographic coordinate with latitude and longitude.

Uses the WGS84 coordinate system (same as GPS).

const sanFrancisco = LocationCoordinate(
  latitude: 37.7749,
  longitude: -122.4194,
);

final distance = sanFrancisco.distanceTo(newYork);
print('Distance: ${distance.inKilometers} km');
Annotations
  • @immutable

Constructors

LocationCoordinate({required double latitude, required double longitude})
const

Properties

hashCode int
The hash code for this object.
no setteroverride
latitude double
The latitude in decimal degrees.
final
longitude double
The longitude in decimal degrees.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

distanceTo(LocationCoordinate other) Distance
The distance to other.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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