Related: What exactly is FutureOr<void> onLoad?
When I try to write onLoad in VSCode, it autocompletes as FutureOr<void> onLoad()
.
However, I want it to autocomplete as Future<void> onLoad()
.
How can I configure VSCode to suggest Future<void> onLoad()
instead?
Most Flutter Flame sample code online uses Future<void> onLoad()
,
For example: https://docs.flame-engine.org/latest/flame/game.html
@override Future<void> onLoad() async { sprite = await Sprite.load('crate.png'); }
You can't, not directly at least, since FutureOr<void>
is what the super class specifies as its method signature return type. As suggested you can create a VSCode snippet for it though.