Is get valueWatcher => ref.watch(valueProvider)
inadvasied?
#3590
-
I'm wondering if there are any downsides or potential bugs associated with defining my watchers like the following:
I prefer this syntax as it allows me to more easily document the value parameters and "watcher" parameters without cluttering the build function. So far I haven't noticed any bugs or downsides, but I'm wondering if this might lead to hard-to-find bugs down the road. From what I understand, Riverpod is a little finicky about what gets placed in the build functions or not. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Only works in StatefulConsumerWidget, not in ConsumerWidgets. People trying to read your code might get confused. Other than that, you are fine. |
Beta Was this translation helpful? Give feedback.
Only works in StatefulConsumerWidget, not in ConsumerWidgets. People trying to read your code might get confused. Other than that, you are fine.