Coordinates class

A class that represents the coordinates information from the API response.

This class holds the coordinates related info such as longitude and latitude.

Example usage:

final coordinates = Coordinates(lon: 12.34, lat: 56.78);
print(coordinates.lon); // 12.34
print(coordinates.lat); // 56.78

The Coordinates class is annotated with JsonSerializable to support JSON serialization and deserialization.

See also:

Annotations
  • @JsonSerializable.new()

Constructors

Coordinates({required double lon, required double lat})
A class representing geographical coordinates.
Coordinates.fromJson(Map<String, dynamic> json)
Creates a Coordinates instance from a JSON map.
factory

Properties

hashCode → int
The hash code for this object.
no setterinherited
lat ↔ double
Details class holds the coordinates related info from the API response lat City geo location, latitude
getter/setter pair
lon ↔ double
Details class holds the coordinates related info from the API response lon City geo location, longitude
getter/setter pair
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() → Map<String, dynamic>
Converts the Coordinates instance to a JSON map.
toString() → String
A string representation of this object.
inherited

Operators

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