build method

Widget build(
  1. BuildContext context
)

Implementation

Widget build(BuildContext context) {
  return LayoutBuilder(
    builder: (_, constraints) {
      final blockSize = Size(
        constraints.maxWidth / _blockCount,
        constraints.maxHeight / _blockCount,
      );
      return Stack(
        children: [
          for (int i = 0; i < _indices.length; i++)
            Positioned.fill(
              child: _Block(
                blockSize: blockSize,
                endOffset: Offset(
                  _indices[i].dx * blockSize.width,
                  _indices[i].dy * blockSize.height,
                ),
                color: _color,
                blend: _blend,
              ),
            ),
        ],
      );
    },
  );
}