init method

  1. @override
void init()
override

Called when this behaviour should be initialized

After calling this method any call to isInitialized should return true.

Implementation

@override
void init() {
  _rectList = [];
  Size tileSize = size! / 4.0;
  for (int x = 0; x < 4; ++x) {
    for (int y = 0; y < 4; ++y) {
      var rect = Rectangle()
        ..initialColor = randomColor()
        ..color = HSVColor.fromAHSV(0.0, 0.0, 0.0, 0.0)
        ..fadeTo = randomColor()
        ..rect = Offset(tileSize.width * x, tileSize.height * y) & tileSize;
      _rectList!.insert(x * 4 + y, rect);
    }
  }
}