onLoad method

  1. @mustCallSuper
Future<void>? onLoad()
inherited

Whenever onLoad returns something, the parent will wait for the Future to be resolved before adding it. If null is returned, the class is added right away.

The default implementation just returns null.

This can be overwritten to add custom logic to the component loading.

Example:

@override
Future<void> onLoad() async {
  myImage = await gameRef.load('my_image.png');
}

Implementation

@mustCallSuper
Future<void>? onLoad() => null;