flutter-persistence
Installation
SKILL.md
Flutter Persistence
Choose storage from data shape, query needs, durability, sensitivity, synchronization, and migration requirements.
Before choosing APIs, inspect pubspec.yaml, SDK constraints, the resolved persistence package and version, generated-schema policy, existing storage owners, supported platforms, and tests. Preserve the established package unless a demonstrated requirement exceeds its supported contract.
Select proportionately
- Use preferences only for small settings, not relational or critical domain data.
- Use files for document/blob ownership with explicit atomicity and cleanup.
- Use a database when queries, relationships, transactions, indexing, or migration justify it.
- Use platform secure storage for small secrets; do not treat ordinary app databases as secret vaults.
- Preserve an established package unless it cannot satisfy a concrete requirement.
Model ownership
Define the source of truth, cache freshness, write ordering, conflict behavior, offline mutations, deletion semantics, and recovery from corrupt or incompatible data. Keep storage models behind repositories so schema details do not leak into widgets.