Help with riverpod. #3881
Unanswered
Parixit2411
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello! I am facing an issue with Riverpod in one of my projects. To simplify debugging, I created a smaller project to replicate the problem, but the issue persists.
I have two screens:
The problem is that I cannot retrieve the username in Screen 2. I have added the relevant code below.
Screen1:
Screen2:
Notifier:
I am getting "StateError (Bad state: Tried to read the state of an uninitialized provider)" error where I am calling ref.watch in screen2. When I enable the watch comment in screen1 everything is working fine.
Beta Was this translation helpful? Give feedback.
All reactions