0

there are some(10) textfields like feed and price in first page addition to a botton to register and some calculation, next page i have other textfields(15) related to operation costs like salary and rent addition to a button to sum information belong to this page , last page i have a button that calculate all output from 2 previous pages together to give my profit, but there is a problem, because of too much textfields, i want to change some of them in every using the app and wouldn't change others, so i prefer to save all of the "last" values every time i open application. also when i calculate in final page and go back to page1, after putting new values and pushing button, values in page 2 reset. how can i solve this??

  • Does this answer your question? [How to retain text in textfields in flutter?](https://stackoverflow.com/questions/62845227/how-to-retain-text-in-textfields-in-flutter) – Chirag Bargoojar May 30 '21 at 15:01

1 Answers1

0

To solve this you could save values in flutter shared preferences. For more details, you could check out this link: https://pub.dev/packages/shared_preferences.

If you want a sophisticated solution, you could use a RESTful API to register those values for each user, and whenever the user visits a specific page you fetch the specific values of that page from the server and display them in the UI.

ahmed grati
  • 16
  • 1
  • 3
  • Thanks a lot friend, I didn't do shared_preferences before and don't know what are the situation, but the app will be a off-line application, like a calculator and wouldn't be connect to a API and server. I should try it by shared_preferences. – Hamed Zahiri May 30 '21 at 15:12