0

What can be done to prevent ui from reloading, when app goes to backgrund, and then to foreground again? My tabs reset to 1st one, map resets, and some other ui elements aswell.

Any help is well appreciated!

petek
  • 953
  • 4
  • 14
  • 24
  • Without sharing any code nobody can answer this question, I can only assume that you have put your layout widgets inside the buildmethod - https://stackoverflow.com/help/how-to-ask – F-1 Aug 07 '19 at 09:48
  • @F-1 so the UI shouldnt be inside build()? – petek Aug 07 '19 at 10:08
  • You can but if you don't want it to be reloaded everytime the buildmethod is called then you should move methods outside the the build method and put into the initialstate. There are a number of similar questions on Stack, this is one that I found just now https://stackoverflow.com/questions/51224420/flutter-switching-to-tab-reloads-widgets-and-runs-futurebuilder – F-1 Aug 07 '19 at 10:13

0 Answers0