GeoPolygon constructor

const GeoPolygon({
  1. required List<GeoPoint> points,
})

Creates a new GeoPolygon with the given points.

Throws AssertionError if fewer than 3 points are provided.

Example:

final polygon = GeoPolygon(points: [
  GeoPoint(latitude: 37.7749, longitude: -122.4194),
  GeoPoint(latitude: 37.7849, longitude: -122.4094),
  GeoPoint(latitude: 37.7649, longitude: -122.4094),
]);

Implementation

const GeoPolygon({
  required this.points,
}) : assert(points.length >= 3,
          'Polygon must have at least 3 points');