Closed SomtochiUmeh closed 3 months ago
Visit the preview URL for this PR (updated for commit 3666e52):
https://rationapp-37f76--pr10-nav-4x95jehd.web.app
(expires Tue, 20 Aug 2024 18:45:15 GMT)
🔥 via Firebase Hosting GitHub Action 🌎
Sign: 5f2efbcbf86c7e73b750d3fe2f3f11115043b7cc
I've updated the code such that each destination in the navigation bar has it's own Navigator
https://github.com/user-attachments/assets/034f470c-f8a9-4a14-8f00-e915b07723b1
The navigation bar is always present at the bottom of the app in all the pages. The FeedFormulaPage is currently only accessed through the CowCharacteristicsPage when the user submits the cow's characteristics. I've made the changes such that if the user navigates away from the CowCharacteristicsPage and back, they resume where they left off.
These changes involved adding a boolean toggle in the CowCharacteristicsPage which determines whether to show the CowCharacteristicsContent (the cow form) or the FeedFormulaPage (where the user adds in ingredients). After this change, we no longer had the Navigator stack to push and pop pages/context to and from, so the back button in the FeedFormulaPage that takes the user back to the populated CowCharacteristicsContent didn't work. To fix this new issue, I passed the toggle function to the FeedFormulaPage to trigger when the back button is pressed. I also had to move the text controller states from the CowCharacteristicsContent up to the CowCharacteristicsPage, so the back button returns the user to a populated cow form.
https://github.com/user-attachments/assets/3ee97c9a-1b47-4229-9004-c16d70c667a5