Closed PSanJuanS closed 2 years ago
Actually WidgetRef.read
etc. is the API in Riverpod 1.0.0-dev.x, and ScopeReader
doesn't exist any more. You are probably using 0.14.x. But yeah, the documentation is in a poor state right now and unreliable (e.g. the page you linked uses WidgetRef.read
but mentions context.read
in the diagram, which doesn't exist in the 1.0.0 line any more either), same can be said about the inline documentation in code (e.g. it says that select
can only be used for hooks or ProviderContainer.listen
, which is no longer true either - it is now supported everywhere). I guess the author(s) want to polish and release the code first and then they will take care of the docs, we need to be patient.
Thank you for your answer. I know that in the current project state the code evolves faster than the docs can follow, I only wanted to note the inconsistency between code and docs in case the error was not acknowledged. And yes, I am using 0.14.x as it is the latest stable.
Closing since this is expected.
The documentation is showing version 1.0.0-dev on purpose since that is the latest version. I prefer this over maintaining two versions for the documentation.
I think the consumer description in the starting docs is outdated. In https://riverpod.dev/docs/concepts/reading when explaining consumerwidget and consumer it uses WidgetRef instead of ScopeReader. So the examples use ref.watch(provider) instead of watch(provider) and that no longer works.