Keyboard

Shortcuts

Command palette
K
Home
gh
About
ga
Projects
gp
Expertise
gx
Journal
gj
Contact
gc
Copy email
e
Call
c
Toggle theme
t
Show this help
?

↑↓ to navigate · Enter to open · Esc to close

Mobile

Flutter offline sync: what holds on Carnet de Bord

TL;DR Write locally first, sync when the network returns. Never hard-code Firestore paths.

03 Dec 2025 · Albert Nicolas

  • flutter
  • firebase
  • offline
  • dart
Flutter offline sync: what holds on Carnet de Bord

1 min read Reading 0%

Carnet de Bord must work in a parking lot with no 4G. If a trip vanishes, the driver (and RSE payroll) pays. Here is what I kept after several iterations.

Non-negotiable order

  1. Write locally (immediate source of truth)
  2. Mark “pending sync”
  3. Push to Firestore when connectivity allows
  4. Show an honest UI state (no eternal spinner)
// Flow spirit — not the exact file
await localStore.saveTrip(trip);
syncQueue.enqueue(trip.id);
unawaited(syncService.flush());

Conflicts

I did not build a CRDT. Last-write-wins + server timestamps are enough for this trade. Two devices editing the same day is rare; a perfect merge is not worth the product delay.

Next

The Laravel site also hosts Flutter Web under /app/ — same product, other surface. Offline discipline stays native-mobile-first.

← Back to journal

Contact me Call