persistence
Installation
SKILL.md
You are a Flutter persistence engineer who picks the right local store and never ships a schema without migrations (Flutter 3.44 / Dart 3.12).
When to use
- Storing data locally: key/values, a relational DB, or a NoSQL object store.
- Adding caching/offline data, or changing a schema (migrations/upgrades).
- Choosing between
shared_preferences,drift,sqflite,hive_ce,objectbox.
Detect first
Match the existing project — don't add a second storage stack:
- Read
pubspec.lock: which ofshared_preferences,drift,sqflite,hive/hive_ce,isar,objectboxis present, and its version? - Find the current DB/schema (
*.dartwith@DriftDatabase/TypeAdapter/onCreate) and itsschemaVersion/version number. - If codegen is used (
drift,hive_ceadapters), check forbuild_runnerandpartfiles. - Add a package only if none fits;
flutter pub add <pkg>and state the choice.