avoid-redundant-async-on-load
Warns when a Component's onLoad
method can be made sync.
Refactoring async onLoad
to sync helps Flame directly continue in it's loading cycle.
Example
❌ Bad:
class MyComponent extends Component {
Future<void> onLoad() async {
... // LINT, has no await
}
}
✅ Good:
class MyComponent extends Component {
Future<void> onLoad() async {
await ...
}
}
class MyComponent extends Component {
void onLoad() {
...
}
}