I have a PageView( ) displaying four different pages and a BottomNavigationBar used to navigate to those pages. I have a FloatingActionButton on the first page when I use Navigator.push() to push the second route and Navigator.pop to pop it out the initial page rebuilds again, The same thing happens when I use it on the fourth page too, The first screen is returned instead of the same screen as I’m performing an operation on that page. So how do I navigate back to the same page while preserving sate of that page?
I have used AutomaticKeepAliveClient mixin to preserve the state of the pages while navigating through the bottom navigation bar but not able to do so using Navigator.
This article by Andrea Bezzito does cover some parts of it but I wasn’t sure if that is exactly what I wanted. so wanted to look for alternative solutions if any available.
What you’re looking for is called
Provider. Here is a very simple example of how you could use provider. https://github.com/m-Skolnick/provider_example_flutter
Answered By – mskolnick
Answer Checked By – Willingham (FlutterFixes Volunteer)