Unless you’re using something like StateNoticationProvider, listening to or watching a normal Provider doesn’t seem to update the UI even though the object the provider is returning changes. So when is a normal provider’s listen or watch used? By normal provider I mean the Provider class in contrast to StateNotifierProvider or sth like that. It looks like a basic counter example using riverpod requires too much boilerplate… StateNotfier, StateNotifierProvider, then you have to think about making those objects immutable while also updating their values… etc etc. Is there a way to watch Poviders and not have to worry about rebuilding UI (just do it automatically when the object being listened to changes)
Asked
Active
Viewed 349 times
1 Answers
1
After some fiddling around, it looks to me like the base Provider
is useful when you want to combine multiple providers and compute another provider. In that case, Provider's watch
works as expected!

Suman Chapai
- 51
- 7