RANIARANIA Academy

Local Data & Persistence

Learn to store data on the device so your Flutter app works offline and remembers state between launches. You will use shared_preferences for settings, sqflite for relational data and Hive for fast object storage, then wrap them in a repository that caches API data and picks the right store for each job.

Watch the free preview

Getting started with shared_preferences — free to watch, no account needed.

Mobile Development (Flutter) INTERMEDIATE · 150 min · Certificate on completion · 3 CPD points

What you'll learn

  • Store data on the device for offline use across app launches
  • Persist simple settings and flags with shared_preferences
  • Model and query relational data with sqflite, including migrations
  • Store objects fast with Hive using type adapters
  • Wrap local stores in a repository that caches API data and chooses the right store

Syllabus

Simple Settings with shared_preferences
Getting started with shared_preferencesFree preview15 min
Managing typed preferences safely15 min
Relational Data with sqflite
Opening a database and creating tables15 min
CRUD, queries and migrations15 min
Fast Object Storage with Hive
Hive basics — boxes and key-value storage15 min
Type adapters — storing your own objects15 min
Architecture — Repositories and Caching
The repository pattern for local data15 min
Caching API data and choosing the right store15 min
Lab — 10 Exercises & Solutions
Exercises 1–515 min
Exercises 6–1015 min