split method

  1. @override
List<Rect> split(
  1. Rect area
)
override

Splits the given area into multiple sub-areas.

Implementation

@override
List<Rect> split(Rect area) {
  final length = area.width ~/ width;
  if (length == 0) {
    return const [Rect.zero];
  }
  return [
    for (var x = area.left; x < area.left + length * width; x += width)
      Rect.fromLTWH(
        x,
        area.top,
        width,
        area.height,
      ),
  ];
}