You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now we have an unused_parameters rule that forces us to rename all unused parameters to underscores.
In some cases, we not use context in widget builder functions initially, and add a usage later.
There is some potential of using an incorrect instance of BuildContext that way.
We want to add a lint that checks that we use BuildContext from nearest available scope.
Example:
classSomeWidgetextendsStatefulWidget {
...
}
class_SomeWidgetStateextendsState<SomeWidget> {
...
void_showDialog() {
showModalBottomSheet(
context: context,
builder: (BuildContext _) { <--LINT--this should be renamed to `context`
final someProvider = context.watch<SomeProvider>(); <-- uses context from StatefulWidget instead of the builder, which causes errors.
returnconstSizedBox.shrink();
},
);
}
}
We also probably can provide a quick fix here.
The text was updated successfully, but these errors were encountered:
Right now we have an
unused_parameters
rule that forces us to rename all unused parameters to underscores.In some cases, we not use context in widget builder functions initially, and add a usage later.
There is some potential of using an incorrect instance of
BuildContext
that way.We want to add a lint that checks that we use
BuildContext
from nearest available scope.Example:
We also probably can provide a quick fix here.
The text was updated successfully, but these errors were encountered: