LatLng class final

A geographic point on the Earth's surface, defined by its latitude and longitude.

The LatLng class is a simple value object that represents a geographic point on the Earth's surface. It consists of a latitude and longitude pair, each of which is represented as a double value.

Example usage:

final point = LatLng(37.7749, -122.4194);
print(point.latitude); // Prints: 37.7749
print(point.longitude); // Prints: -122.4194
Implemented types
Available Extensions

Constructors

LatLng(double latitude, double longitude)
Creates a new LatLng object with the given latitude and longitude.
const
LatLng.named({required double latitude, required double longitude})
Creates a new LatLng object with the given latitude and longitude.
const

Properties

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

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson({JsonCodec codec = const JsonCodec()}) String
Returns a JSON-encoded string representation of the object.
override
toString() String
A string representation of this object.
override

Operators

operator ==(covariant LatLng other) bool
The equality operator.
override