We currently use the sqflite package to persist article data in the app. This is more complex than our needs require. The goal is to replace sqflite with a simpler file-based JSON storage system.
Requirements
- Store all articles as a list in a single
articles.json file inside the app’s documents directory.
- Ensure the storage layer gracefully handles the case where
articles.json does not yet exist.
- Provide helper functions to:
- Load all articles from the JSON file at app startup.
- Save the current in-memory list of articles back to the JSON file.
- Add, update, and delete articles in memory, then persist changes to disk.
Acceptance criteria
- App can be installed fresh and run without
sqflite.
- A clean install correctly creates
articles.json when the first article is saved.
- After migration, existing user data is preserved and stored in the new JSON file format.
- All bookmark tests pass with the new JSON storage implementation.
We currently use the
sqflitepackage to persist article data in the app. This is more complex than our needs require. The goal is to replacesqflitewith a simpler file-based JSON storage system.Requirements
articles.jsonfile inside the app’s documents directory.articles.jsondoes not yet exist.Acceptance criteria
sqflite.articles.jsonwhen the first article is saved.