toDrawable method
- @Deprecated('Instead obtain the outline/line/points using other methods, and render the ' 'layer manually. ' 'This method is being removed to reduce dependency on flutter_map, and allow ' 'full usage of flutter_map functionality without it needing to be ' 'semi-implemented here. ' 'This feature was deprecated after v9.1.0, and will be removed in the next ' 'breaking/major release.')
- @override
- Color? fillColor,
- Color? borderColor,
- double borderStrokeWidth = 3,
- bool isDotted = false,
- bool prettyPaint = true,
- StrokeCap strokeCap = StrokeCap.round,
- StrokeJoin strokeJoin = StrokeJoin.round,
- List<
Color> ? gradientColors, - List<
double> ? colorsStop,
override
Deprecated. Instead obtain the outline/line/points using other methods, and render the layer manually. This method is being removed to reduce dependency on flutter_map, and allow full usage of flutter_map functionality without it needing to be semi-implemented here. This feature was deprecated after v9.1.0, and will be removed in the next breaking/major release.
If prettyPaint
was true
, render a Polyline
based on line and
radius. Otherwise, render multiple Polygons
based on the result of
toOutlines(1)
.
Implementation
@Deprecated(
'Instead obtain the outline/line/points using other methods, and render the '
'layer manually. '
'This method is being removed to reduce dependency on flutter_map, and allow '
'full usage of flutter_map functionality without it needing to be '
'semi-implemented here. '
'This feature was deprecated after v9.1.0, and will be removed in the next '
'breaking/major release.',
)
@override
Widget toDrawable({
Color? fillColor,
Color? borderColor,
double borderStrokeWidth = 3,
bool isDotted = false,
bool prettyPaint = true,
StrokeCap strokeCap = StrokeCap.round,
StrokeJoin strokeJoin = StrokeJoin.round,
List<Color>? gradientColors,
List<double>? colorsStop,
}) =>
prettyPaint
? PolylineLayer(
polylines: [
Polyline(
points: line,
strokeWidth: radius,
useStrokeWidthInMeter: true,
color: fillColor ?? const Color(0x00000000),
borderColor: borderColor ?? const Color(0x00000000),
borderStrokeWidth: borderStrokeWidth,
pattern: isDotted
? const StrokePattern.dotted()
: const StrokePattern.solid(),
gradientColors: gradientColors,
colorsStop: colorsStop,
strokeCap: strokeCap,
strokeJoin: strokeJoin,
),
],
)
: PolygonLayer(
polygons: toOutlines(1)
.map(
(rect) => Polygon(
points: rect,
color: fillColor,
borderColor: borderColor ?? const Color(0x00000000),
borderStrokeWidth: borderStrokeWidth,
pattern: isDotted
? const StrokePattern.dotted()
: const StrokePattern.solid(),
strokeCap: strokeCap,
strokeJoin: strokeJoin,
),
)
.toList(),
);