Replies: 1 comment
-
Updated to using family: https://github.com/hunterpp/riverpod_child_provider/tree/main/lib |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Starting from https://stackoverflow.com/questions/70459434/class-that-indirectly-extends-from-statenotifier-in-statenotifierprovider-doesn
I want a way to reuse some UI code amongst a group of child providers.
The only way I could make it work is with:
https://github.com/hunterpp/riverpod_child_provider/blob/ff30883e5c502b5e821f3c4bb8cc4a93dec21d65/lib/main.dart#L53
But it is quite cumbersome:
Text(ref.watch(ref.watch(kennelProvider).dog.notifier).produce()),
Wondering if there is a cleaner way to accomplish my goal without using ref.watch twice?
Maybe family https://riverpod.dev/docs/concepts/modifiers/family is the way to go? If so how can I have the flexibility of being able to call all the methods of my providers?
Beta Was this translation helpful? Give feedback.
All reactions