avoid-late-context
Warns when the context
is used inside a late
field.
Using the context in late fields might result in an unexpected behavior due to late fields being initialized lazily.
Example
❌ Bad:
class _SomeState extends State<T> {
late final _myState = _create(context); // LINT
}
✅ Good:
class _SomeState extends State<T> {
late final _myState = _create();
}