Replies: 1 comment
-
Update the state, not a value inside the state, or the provider will not notify its listeners:
Prefer using ref.watch in builders: No need to use watch in handlers:
And setState is useless here, since you do not update the state of your widget. If your widget depends on UserCardSheetInfo, watch it in build(). You may want to spend more time reading the riverpod doc. |
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
-
I have the below Riverpod annotation for the provider. I would like to update the values in one page and get the updated value in next page.
I the first page, I am updating the value as below.
In the next page, I am trying to read the updated value. But I am always getting an empty class without the values.
How should I be handling the value read/write using Riverpod?
Beta Was this translation helpful? Give feedback.
All reactions