rectanglesViewerElement static method

ViewerElement<List<Rectangle<num>>> rectanglesViewerElement(
  1. List<Rectangle<num>> rectangles, [
  2. Color? color,
  3. int? strokeSize
])

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(),
  );
}