Dart Tutorial

Flutter Chapter 9 of 16

Storing Data

Keep data on the device with shared_preferences, files and SQLite, and in the cloud with Firebase.

An app that forgets everything when it closes is frustrating. This chapter covers the main ways to store data, from a single setting to a full database.

Lessons in this chapter

  1. shared_preferences in Flutter: Saving Simple DataSave small values in Flutter with shared_preferences: settings, flags and tokens, plus secure storage for sensitive data.
  2. Reading and Writing Files in Flutter with path_providerRead and write files in a Flutter app: find the right folder with path_provider, save text and JSON, and store downloaded images.
  3. SQLite in Flutter with sqfliteStore structured data in Flutter with SQLite using sqflite: create tables, insert, query, update, delete, and run migrations.
  4. Firebase with Flutter: Authentication and FirestoreGet started with Firebase in Flutter: set up with FlutterFire, sign users in with Firebase Auth, and store live data in Cloud Firestore.