onLoad method
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
@override
Future<void> onLoad() async {
await super.onLoad();
await _loader.load();
this.animation = this.animIdle;
}