NeshanPolygon constructor

const NeshanPolygon({
  1. required String id,
  2. required List<LatLng> coordinates,
  3. Color? fillColor,
  4. double fillOpacity = 0.5,
  5. Color? strokeColor,
  6. double strokeWidth = 2.0,
  7. double strokeOpacity = 1.0,
})

Creates a new polygon.

id is a unique identifier for the polygon. coordinates is the list of coordinates that define the polygon boundary. The first and last coordinate should be the same to close the polygon. fillColor is the color of the polygon fill (default: blue with 0.5 opacity). fillOpacity is the opacity of the fill (0.0 to 1.0, default: 0.5). strokeColor is the color of the polygon outline (default: black). strokeWidth is the width of the polygon outline in pixels (default: 2). strokeOpacity is the opacity of the outline (0.0 to 1.0, default: 1.0).

Implementation

const NeshanPolygon({
  required this.id,
  required this.coordinates,
  this.fillColor,
  this.fillOpacity = 0.5,
  this.strokeColor,
  this.strokeWidth = 2.0,
  this.strokeOpacity = 1.0,
}) : assert(fillOpacity >= 0.0 && fillOpacity <= 1.0,
          'fillOpacity must be between 0.0 and 1.0'),
     assert(strokeOpacity >= 0.0 && strokeOpacity <= 1.0,
          'strokeOpacity must be between 0.0 and 1.0'),
     assert(strokeWidth >= 0.0, 'strokeWidth must be >= 0.0');