Closed tinoper closed 2 years ago
After further debugging, it seems that when the back button is pressed (and the top page of the navigation stack is popped), all state changes to the flow state made by the most recently popped page are discarded as well.
To reproduce this behavior, keep track of the value of context.flow<Profile>().state
in each form's build
method. Notice that whenever you navigate back from ProfileAgeForm
to ProfileNameForm
, the state gets reset to Profile(null, null, null)
, indicating that the previous changes to the flow state were discarded.
A solution could be to add a leading BackButton
widget to the AppBar
that updates the state with the new user inputted values and modify onGenerateProfilePages
to show only one page in the navigation stack at all times.
Closing for now since there is no actionable next step. Feel free to comment with any follow-up questions and I'm happy to continue the conversation 👍
Question
In Profile Flow Builder example, how can I check if age field have a previous value before type a new one?
To Reproduce Steps to reproduce the behavior:
Expected behavior I would expect to have the Age typed on step 3.
Screenshots
![image](https://user-images.githubusercontent.com/4380484/123825568-63448280-d8d5-11eb-92a0-18b7e83ccad5.png)
Logs Run
flutter analyze
and attach any output of that command below. If there are any analysis errors, try resolving them before filing this issue.Paste the output of running
flutter doctor -v
here.Additional context Maybe I can solve this recording to a local storage but I would like to be sure the solution doesn´t have an answer to this issue. Let me know if you need more information