0

God day,

I'm trying to create a ListView of some HTTP Requests, from an Json communication, likely a Dashboard with Pages who loads some jsons.

It is working now, i have 5 classes who return some FutureBuilder like this:

new FutureBuilder<List<RelatorioMensal>>(
                     future: fetchRelatorioMensal(new http.Client(), "", '$dateFinal1Sem'),
                     builder: (context, snapshot) {
                     if (snapshot.hasError) print(snapshot.error);
                        return snapshot.hasData
                              ? new porVendaMensal(listVendasMensais: snapshot.data,)
                              : new Center(child: new CircularProgressIndicator());
                     }
),

But if I go to the last page created by these requests the first ends up disappearing and I need to reload a request that I had already loaded.

I want to stay all that classes alive all time, like loads one time all request and after i can go up and go down if no loading more, the classes stay loaded in the "Dashboard".

OBS: Every page created have the height of 1 screen of the cellphone.

Rafael Nonino
  • 180
  • 4
  • 15
  • refer [this](https://stackoverflow.com/a/51574523/3860386) same applies for future as well, to retain the data you could use a PageStorage() – DarshanGowda0 Jul 30 '18 at 12:11
  • @DarshanGowda0, i tried to do with StreamBuilder, but it still loading if i go down and after go up my dashboard, i find a dependence [link](http://github.com/lakexyde/flutter_localstorage.git) that i can Storage my data, do you think it will work? – Rafael Nonino Jul 30 '18 at 13:43

0 Answers0