105 lines
2.0 KiB
Markdown
105 lines
2.0 KiB
Markdown
# Setup
|
|
|
|
## Backend Base URL
|
|
|
|
Build-time (recommended):
|
|
|
|
```bash
|
|
flutter run --dart-define=BACKEND_BASE_URL=https://api.example.com
|
|
```
|
|
|
|
Runtime override (for future settings screens):
|
|
|
|
```dart
|
|
AppConfig.overrideBackendBaseUrl('https://staging.example.com');
|
|
```
|
|
|
|
## Run With Fake Gateway
|
|
|
|
Use fake gateway for local/offline development:
|
|
|
|
```bash
|
|
flutter run --dart-define=USE_FAKE_BACKEND=true
|
|
```
|
|
|
|
## Background Sync
|
|
|
|
Background sync (startup + resume + periodic ticks while authenticated) is
|
|
enabled by default.
|
|
|
|
In REST mode, auto-triggers are reachability-gated to avoid unnecessary sync
|
|
attempts while offline.
|
|
|
|
Control flags:
|
|
|
|
```bash
|
|
flutter run \
|
|
--dart-define=ENABLE_BACKGROUND_SYNC=true \
|
|
--dart-define=BACKGROUND_SYNC_INTERVAL_SECONDS=180
|
|
```
|
|
|
|
Disable it explicitly:
|
|
|
|
```bash
|
|
flutter run --dart-define=ENABLE_BACKGROUND_SYNC=false
|
|
```
|
|
|
|
## Reminder Delivery Scaffold
|
|
|
|
Reminder scheduling is now wired through `ReminderScheduler` and reconciled
|
|
from `LocalRepository` on startup/state changes.
|
|
|
|
Default implementation now uses local notifications runtime where supported.
|
|
|
|
Control flag:
|
|
|
|
```bash
|
|
flutter run --dart-define=ENABLE_LOCAL_NOTIFICATIONS=true
|
|
```
|
|
|
|
Disable notifications explicitly:
|
|
|
|
```bash
|
|
flutter run --dart-define=ENABLE_LOCAL_NOTIFICATIONS=false
|
|
```
|
|
|
|
Behavior notes:
|
|
|
|
- web: no-op fallback
|
|
- linux: schedule fallback (no-op) due platform scheduling limitations in plugin
|
|
- android/iOS/macOS/windows: scheduled local notifications
|
|
|
|
## Local Persistence Backend
|
|
|
|
Default local store:
|
|
|
|
- `Hive` (`USE_HIVE_LOCAL_DB=true` by default)
|
|
- first-run migration imports legacy `shared_preferences` payload when present
|
|
- applies to both:
|
|
- local product state (`LocalRepository`)
|
|
- sync queue state (`SyncQueueRepository`)
|
|
|
|
Optional migration path:
|
|
|
|
```bash
|
|
flutter run --dart-define=USE_HIVE_LOCAL_DB=true
|
|
```
|
|
|
|
Use legacy mode explicitly if needed:
|
|
|
|
```bash
|
|
flutter run --dart-define=USE_HIVE_LOCAL_DB=false
|
|
```
|
|
|
|
## Run Tests
|
|
|
|
```bash
|
|
flutter test
|
|
```
|
|
|
|
## Generate Code
|
|
|
|
```bash
|
|
dart run build_runner build --delete-conflicting-outputs
|
|
```
|