GoogleMapPolygon constructor

GoogleMapPolygon({
  1. Key? key,
  2. required String mapId,
  3. required String mapKey,
  4. required GoogleMapPolygonController mapController,
  5. required CameraPosition initialCameraPosition,
  6. double mapHeight = 300,
  7. double mapWidth = double.infinity,
  8. List<PolygonData>? polygons,
  9. PolygonData? singlePolygon,
  10. bool returnAsWKT = false,
  11. void onPolygonCreated(
    1. dynamic value
    )?,
  12. bool editPolygon = false,
  13. void onPolygonEdited(
    1. dynamic value
    )?,
})

Implementation

GoogleMapPolygon({
  super.key,
  required this.mapId,
  required this.mapKey,
  required this.mapController,
  required this.initialCameraPosition,
  this.mapHeight = 300,
  this.mapWidth = double.infinity,
  this.polygons,
  this.singlePolygon,
  this.returnAsWKT = false,
  this.onPolygonCreated,
  this.editPolygon = false,
  this.onPolygonEdited,
}) : assert((polygons == null && singlePolygon == null) || (polygons != null && singlePolygon == null) || (polygons == null && singlePolygon != null), 'Can\'t provide both list and a single polygon. Either one or both should be null'),
      assert(polygons == null || polygons.map((p) => p.id).toSet().length == polygons.length, 'Duplicate polygon IDs found in the polygons list', ),
      assert(mapId.isNotEmpty, 'Map ID can\'t be empty. Head to Google cloud console and get one from Map Styles'),
      assert((editPolygon == true && singlePolygon != null && polygons == null) || (editPolygon == false && singlePolygon == null && polygons != null), 'Editing a polygon requires a single polygon data. And the polygon list to be null');