GeoPoint constructor

GeoPoint({
  1. required double lon,
  2. required double lat,
})

Create a point from a longitude and latgitude. lon must be between -180 and 180, and lat must be between -90 and 90.

Implementation

GeoPoint({required this.lon, required this.lat}) {
  if (lon < -180 || lon > 180) throw ArgumentError.value(lon, 'lon', 'must be between -180 and 180');
  if (lat < -90 || lat > 90) throw ArgumentError.value(lat, 'lat', 'must be between -90 and 90');
}