Local storage and offline sync in Flutter
Usage description
Add a local storage layer that works offline and then syncs with the server.
Prompt text
In the {{project}} app ({{stack}}), add offline support:
1. Propose a local storage option (such as drift, Isar or Hive) with a short comparison, and wait for my choice.
2. Implement a queue of pending operations that is sent when the connection returns.
3. Define the conflict resolution policy (last write wins, or merge) and explain it.
4. Tests for these scenarios: adding offline, the connection returning, and a conflict.
{{extra}}Required inputs
The app and the server/API.
Expected outputs
A plan, the layer code and scenario tests.
Suitable tools
Practical example
project = "a field notes app" used in areas with a weak connection.
We do not claim this prompt was tested on a particular model; results vary with the model and context, so always review the output.
