We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug
Calling Provider.of<not nullable T> when not mounted triggers a codepath that attempts to throw an error but throws a less good error instead; here:
Provider.of<not nullable T>
if (inheritedElement == null && null is! T) { throw ProviderNotFoundException(T, context.widget.runtimeType); }
which throws accessing context.widget.
context.widget
Expected behavior
A better error message could be provided by checking context.isMounted before trying to access widget.
context.isMounted
widget
The text was updated successfully, but these errors were encountered:
rrousselGit
No branches or pull requests
Describe the bug
Calling
Provider.of<not nullable T>
when not mounted triggers a codepath that attempts to throw an error but throws a less good error instead; here:which throws accessing
context.widget
.Expected behavior
A better error message could be provided by checking
context.isMounted
before trying to accesswidget
.The text was updated successfully, but these errors were encountered: