Local-First Flutter

Flutter can be a strong local-first app stack, but storage choices must match target platforms.

Local-First Shape

Widget/View
  -> ViewModel
  -> Repository
  -> Local store
  -> Export/backup/sync service

The local store should be the source of truth. Network sync, if present, should reconcile with the local source rather than making every UI read depend on the network.

Design Decisions

DecisionRecommendation
Source of truthLocal database for records, not in-memory state
MigrationsVersion and test before release
ExportBuild before sync for user-owned data
BackupTest restore on a clean install
EncryptionDefine threat model and recovery before implementation
SyncAdd only when backup/export cannot solve the user problem
ConflictsModel before writing sync code

Cross-Platform Storage Risk

Mobile, desktop, and web do not share one identical storage substrate. A package may use SQLite on mobile, IndexedDB or Wasm-backed storage on web, and FFI/native libraries on desktop. Treat that as architecture.

Gotcha: A local-first app without restore tests is not durable. The data path must prove migration, export, backup, restore, and deletion.