I need to save an object in one page and then access, edit and again save it in other pages in Flutter.
Is there any way other than serialization and shared preferences?
How can I do that by using a static variable common to all pages?
Thanks in advance
Asked
Active
Viewed 925 times
0

Mohsen Emami
- 2,709
- 3
- 33
- 40
1 Answers
2
There are several methods to do this.
You could use a singleton to store your data:
How do you build a Singleton in Dart?
(Fast and ugly solution)You could implement the Bloc Pattern to State Management
https://medium.com/flutterpub/architecting-your-flutter-project-bd04e144a8f1You could use any other State Management solution
https://flutter.dev/docs/development/data-and-backend/state-mgmt/options

LgFranco
- 1,004
- 6
- 14
-
Thank you @LgFranco let me check that I think it will be helpfull – Mohsen Emami Jun 12 '19 at 11:12