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() {
  center = Offset(size!.width / 2.0, size!.height / 2.0);
  targetCenter = center;
  stars = List<Star>.generate(500, (_) {
    var star = Star();
    _initStar(star);
    return star;
  });
}