Polygon constructor

Polygon({
  1. int? id,
  2. required List<LatLng> points,
  3. List<List<LatLng>> holes = const [],
  4. Color? fillColor,
  5. Color? strokeColor,
  6. double? alpha,
})

Each polygon must have at least three points. Each hole must have at least three points.

Implementation

Polygon({
  this.id,
  required this.points,
  this.holes = const [],
  this.fillColor,
  this.strokeColor,
  this.alpha,
})  : assert(points.length >= 3, 'Polygon must have at least three points'),
      assert(holes.every((hole) => hole.length >= 3),
          'Hole must have at least three points');