2

In my current app, it's possible to navigate through pages with a drawer. But if I go to a second page, and the click to go to the first page (making this route history [FirstPage, SecondPage, FirstPage]) it recreate a new FirstPage.
I don't want to it to be recreated because there is a lot of process and it can take few seconds. I was wondering if it's possible to go to the first instance of the FirstPage instead of recreating a new one, and still have the same route history.

I hope it's clear enough to understand.

AmazingBite
  • 302
  • 2
  • 16
  • Are you creating a new instance every-time you go to a page? Or how you're doing that? – Sergio Bernal Jul 29 '19 at 17:01
  • @SergioBernal I use a drawer to navigate. I have a map and at the initialization, I load markers. If I navigate to the map, it load the markers again but if I press back, I have my map with all the markers and no loading. – AmazingBite Jul 30 '19 at 08:41
  • why not use local db to cache the data ? – Salma Jul 30 '19 at 09:08
  • @Salma. I'm afraid of using too much memory, but I gonna give a try. – AmazingBite Jul 30 '19 at 09:15
  • 1
    check this question https://stackoverflow.com/questions/49439047/how-to-preserve-widget-states-in-flutter-when-navigating-using-bottomnavigation – Salma Jul 30 '19 at 09:27

0 Answers0