Right now, there are 3 static screen, and based on user's choice at first start, 5 to 15 dynamic screen. Dynamic means a single stateful widget, which receives a string value, and based on that value collects data from server.
Right now a modal shows all screens. From there user can click on any screen and Navigator.push(context) loads that specific screen. Problem with this method is, say user navigated from A -> B -> C -> D
. And when in D, user presses B, then the stack becomes A -> B -> C -> D -> B
. And B makes a new network request and collects new updated data.
But what I want is:
- When pressing a screen, if screen is not opened, open that screen.
- If that screen is already opened, then show that screen with its previous state intact.
So, navigation stack A -> B -> C -> D
becomes A -> C -> D -> B
, instead of A -> B -> C -> D -> B
.