How to save to local storage using Flutter?
In Android, if I have the information I want to persist across sessions I know I can use SharedPreferences or create a SQLite database or even write a file to the device and read it in later.
Is there a way to save and restore data like this just using Flutter? Or would I need to write device-specific code for Android and iOS like in the services example?
There are a few options:
- Read and write files: https://flutter.io/reading-writing-files/
- SQLite via a Flutter plugin: https://github.com/tekartik/sqflite
- SQLCipher via a Flutter plugin: https://github.com/drydart/flutter_sqlcipher
- SharedPreferences via a Flutter plugin: https://github.com/flutter/plugins/tree/master/packages/shared_preferences
- Localstore via a Flutter plugin: https://pub.dev/packages/localstore