-
-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[Request] Add custom scope open/closing #313
Comments
Same here, I just got a scope race condition, when I pop scope on widget dispose and register a new singleton on a new screen open, but it gots disposed in a several milliseconds. |
Any idea how this should lool like? If you only want to tie a scope to a widgets life cycle, the get_it_mixin would be the more elegant solution. |
Just add a scope name to close function. |
Can you elaborate on how you mean that? |
Just add a scopeName to popScope function.
This way we can close any open scope. |
but that wouldn't be popping but removing a scope anywhere in the stack, or not? There is actually a PR waiting for that #292 I'm not sure if that would help with the race condition that you observed? |
Yep. Thats exactly what is needed. |
Hi everyone.
With this feature we can tie scopes to stateful widget lifecycle initState/dispose methods.
With current model it's not possible, since widget A can be disposed after Widget B initState is called. Therefor breaking scope destruction.
The text was updated successfully, but these errors were encountered: