Skip to content
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

ref.invalidate(familyProvider) is not working with scoped providers #3567

Open
thiagokisaki opened this issue May 21, 2024 · 0 comments
Open
Assignees
Labels
bug Something isn't working needs triage

Comments

@thiagokisaki
Copy link

thiagokisaki commented May 21, 2024

Describe the bug
ref.invalidate(familyProvider) doesn't seem to work properly when using scoped providers. The problem happens when nesting a ProviderScope inside others.

The reason I'm using many ProviderScopes is that I want to override providers dynamically based on a runtime check. For example, switch from a network and a local implementation of a service, in an app that works both offline with a local database or consuming an API.

I am not sure if this is a bug or a misunderstanding from my part. If I am wrong, I'd appreciate feedback on what I could do to fix the problem.

To Reproduce
I created a simple todo app to demonstrate the problem. Please read the comments in the code.
https://dartpad.dev/?id=b0cbe8e4d8869e181df00ebd5873c0cc

Expected behavior
I expect ref.invalidate(familyProvider) to work even when using scoped providers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage
Projects
None yet
Development

No branches or pull requests

2 participants