rectanglesViewerElement static method
Converts a List<Rectangle<num>> to ViewerElement< List<Rectangle<num>> >.
color
Optional color to render the element.
strokeSize
Optional stroke size to render the element.
Implementation
static ViewerElement<List<Rectangle<num>>> rectanglesViewerElement(
List<Rectangle<num>> rectangles,
[Color? color,
int? strokeSize]) {
return ViewerElement<List<Rectangle<num>>>(rectangles, color,
strokeSize: strokeSize,
valueCopier: (value) => value
?.map((r) => Rectangle<num>(r.left, r.top, r.width, r.height))
.toList());
}