GeoCoordinates class
Represents geographical coordinates with latitude and longitude.
Constructors
- GeoCoordinates({required double latitude, required double longitude})
-
Creates a GeoCoordinates instance with the given
latitudeandlongitude.const -
GeoCoordinates.fromJson(Map<
String, dynamic> json) -
Creates a GeoCoordinates instance from a JSON map.
factory
- GeoCoordinates.fromJsonString(String source)
-
Creates a GeoCoordinates from a JSON string.
factory
Properties
- hashCode → int
-
The hash code for this object.
no setteroverride
- isValid → bool
-
Validates whether the coordinates are within valid geographic bounds.
no setter
- latitude → double
-
The latitude in decimal degrees (-90.0 to 90.0).
final
- longitude → double
-
The longitude in decimal degrees (-180.0 to 180.0).
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
bearingTo(
GeoCoordinates other) → double -
Calculates the initial compass bearing in degrees (0° - 360°) towards
other. -
copyWith(
{double? latitude, double? longitude}) → GeoCoordinates - Creates a copy with optional updated fields.
-
distanceTo(
GeoCoordinates other) → double -
Calculates the Great-Circle distance in meters to
otherusing the Haversine formula. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDMS(
) → String - Formats the coordinates into Degrees, Minutes, and Seconds (DMS) string.
-
toJson(
) → Map< String, dynamic> - Converts this instance to a JSON map.
-
toJsonString(
) → String - Converts this instance to a JSON string.
-
toMap(
) → Map< String, dynamic> - Converts this instance to a map.
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override