Is ref.read ok with mundane things in notifier build() functions? #4386
-
|
Colleagues tend to use Should we start classifying which ref.read usages are OK to use in build() functions or enforce the rule that they should all be ref.watch? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
|
Providers are cached, so ref.watch won't re-fetch if the value hasn't changed. Using ref.watch everywhere seems fine. |
Beta Was this translation helpful? Give feedback.
-
|
Avoid |
Beta Was this translation helpful? Give feedback.
Avoid
ref.readas much as possible. To begin with, I'll most definitely deprecate this API soon.