Add local data store adapter layer and Hive scaffold
This commit is contained in:
@@ -22,6 +22,20 @@ Use fake gateway for local/offline development:
|
||||
flutter run --dart-define=USE_FAKE_BACKEND=true
|
||||
```
|
||||
|
||||
## Local Persistence Backend
|
||||
|
||||
Default local store:
|
||||
|
||||
- `shared_preferences` (stable baseline)
|
||||
|
||||
Optional migration path:
|
||||
|
||||
```bash
|
||||
flutter run --dart-define=USE_HIVE_LOCAL_DB=true
|
||||
```
|
||||
|
||||
When enabled, local app state is stored in Hive via the `LocalDataStore` adapter layer.
|
||||
|
||||
## Run Tests
|
||||
|
||||
```bash
|
||||
|
||||
@@ -2,6 +2,29 @@
|
||||
|
||||
Updated: 2026-02-15
|
||||
|
||||
## Latest Milestone (2026-02-15): Local Store Adapter Layer (DB Migration Scaffold)
|
||||
|
||||
Implemented a persistence boundary so local app state is no longer tightly coupled to `shared_preferences` internals:
|
||||
|
||||
- Added local persistence abstraction:
|
||||
- `lib/features/local/storage/local_data_store.dart`
|
||||
- `LocalDataStore` + `LocalDataRecord`
|
||||
- Added concrete store implementations:
|
||||
- `lib/features/local/storage/local_data_store_shared_prefs.dart`
|
||||
- `lib/features/local/storage/local_data_store_hive.dart`
|
||||
- `lib/features/local/storage/local_data_store_in_memory.dart`
|
||||
- provider wiring: `lib/features/local/storage/local_data_store_provider.dart`
|
||||
- Refactored local repository to use store adapter:
|
||||
- `lib/features/local/local_repository.dart`
|
||||
- build/read/write/migration paths now go through `LocalDataStore`
|
||||
- schema migration hook retained and now store-agnostic
|
||||
- Added config flag for local backend selection:
|
||||
- `lib/core/config/app_config.dart` -> `USE_HIVE_LOCAL_DB`
|
||||
- Added setup docs for switching local persistence backend:
|
||||
- `docs/SETUP.md`
|
||||
|
||||
This prepares the app for a true DB migration path while keeping existing UX and tests stable.
|
||||
|
||||
## Latest Milestone (2026-02-15): Cross-View Responsive Pass
|
||||
|
||||
Audited and adjusted the main product views for mobile-first behavior while preserving desktop/web UX:
|
||||
|
||||
Reference in New Issue
Block a user