Polygon<R extends Object> constructor

Polygon<R extends Object>({
  1. required List<LatLng> points,
  2. List<List<LatLng>>? holePointsList,
  3. Color? color,
  4. double borderStrokeWidth = 0,
  5. Color borderColor = const Color(0xFFFFFF00),
  6. bool disableHolesBorder = false,
  7. StrokePattern pattern = const StrokePattern.solid(),
  8. @Deprecated('Prefer setting `color` to null to disable filling, or a `Color` to enable filling of that color. ' 'This parameter will be removed to simplify the API, as this was a remnant of pre-null-safety. ' 'The default of this parameter is now `null` and will use the rules above - the option is retained so as not to break APIs. ' 'This feature was deprecated (and the default changed) after v7.') bool? isFilled,
  9. StrokeCap strokeCap = StrokeCap.round,
  10. StrokeJoin strokeJoin = StrokeJoin.round,
  11. String? label,
  12. TextStyle labelStyle = const TextStyle(),
  13. PolygonLabelPlacement labelPlacement = PolygonLabelPlacement.centroid,
  14. bool rotateLabel = false,
  15. R? hitValue,
})

Create a new Polygon instance by setting it's parameters.

Implementation

Polygon({
  required this.points,
  this.holePointsList,
  this.color,
  this.borderStrokeWidth = 0,
  this.borderColor = const Color(0xFFFFFF00),
  this.disableHolesBorder = false,
  this.pattern = const StrokePattern.solid(),
  @Deprecated(
    'Prefer setting `color` to null to disable filling, or a `Color` to enable filling of that color. '
    'This parameter will be removed to simplify the API, as this was a remnant of pre-null-safety. '
    'The default of this parameter is now `null` and will use the rules above - the option is retained so as not to break APIs. '
    'This feature was deprecated (and the default changed) after v7.',
  )
  this.isFilled,
  this.strokeCap = StrokeCap.round,
  this.strokeJoin = StrokeJoin.round,
  this.label,
  this.labelStyle = const TextStyle(),
  this.labelPlacement = PolygonLabelPlacement.centroid,
  this.rotateLabel = false,
  this.hitValue,
}) : _filledAndClockwise =
          (isFilled ?? (color != null)) && isClockwise(points);