fromJson static method

LatLng? fromJson(
  1. Map<String, dynamic> json
)

Parses a JSON object to a LatLng object. Should be used instead of LatLng.fromJson for parsing requests from the Aare.guru API.

Implementation

static LatLng? fromJson(Map<String, dynamic> json) {
  DoubleJsonConverter p = DoubleJsonConverter();
  double? lat = DoubleJsonConverter().fromJson(json['lat']);
  double? lon = p.fromJson(json['lon']);
  if (lat == null || lon == null) {
    return null;
  }
  return LatLng(lat, lon);
}