-
-
Notifications
You must be signed in to change notification settings - Fork 974
New issue
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
How to catch error used after being disposed? #3935
Comments
Hard to say without some context. You didn't share much about what's happening here :) |
@rrousselGit Sorry I didn't realize I didn't give you enough context. I try to catch here is some context on why it happened here: onClick: () {
var a = ref.read(aProvider.notifier);
var b = ref.read(bProvider.notifier);
a.state = null;
b.state = null; <- but bProvider has recently been change to watch for `aProvider` so this code was working correctly but now b.state uses a notifier after disposed.
} from the screenshot I shared, I don't see |
Do you use |
This is not an AutoDisposeNotifier but both are ChangeNotifier |
Sounds like you're talking about this: #3354 |
@rrousselGit it looks similar. I tried to understand the status of it. From my understanding, this will be fixed in the next major release. Is it already fixed in the dev branch? |
No. Honnestly I'm not sure how to go about it yet. |
How can I catch these errors in my code to display them on the screen as error messages for my user?
The text was updated successfully, but these errors were encountered: