Replies: 1 comment 1 reply
-
This is correct. Hence why the family documentation recommends combining it with autoDispose
You'll get one provider state per override |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello there, I'm a little bit confused on how ScopedProvider work... can someone help me
Let's say I have an app that could add and view counter, and there are two screens,
HomeScreen
andViewCounterScreen
, inHomeScreen
I can create and remove and view the list of the counter, while in theViewCounterScreen
I can modify the count of the counter.home.dart
This is how the model looks like:
counter.dart
And when I press one of the counter tiles it will push to a new page and override some provider value in there
And this is how
ViewCounterScreen
looks like:view_counter.dart
I think I made the correct choice there about this line:
as to my understanding, the
.family
modifier will create a unique provider each time we pass a new value to it, therefore if I have 1000 counters and view each of them meaning I will have 1000 providers in the memory if I don't use the.autoDispose
modifier right? (correct me if I wrong please).So what about this line:
Will this cause it to make another provider with the overriden value? or will it uses the same provider only provide different value?
thank you.
Beta Was this translation helpful? Give feedback.
All reactions