BlocksCounter constructor

BlocksCounter({
  1. required int initialCounter,
  2. Color color = Colors.white,
  3. BlendMode blend = BlendMode.difference,
})

Implementation

BlocksCounter(
    {required int initialCounter,
    Color color = Colors.white,
    BlendMode blend = BlendMode.difference}) {
  _counter = initialCounter;
  _color = color;
  _blend = blend;
  for (int i = 0; i < _counter!; i++) {
    final dx = _random.nextInt(_blockCount);
    final dy = (_lastIndices[dx] - 1) % _blockCount;
    _lastIndices[dx] = dy;
    _indices.add(Offset(dx.toDouble(), dy.toDouble()));
  }
}