# As-Saaliyah — app Flutter (Dart) cross-platform client for Android, iOS, and Web. It consumes the `website/` backend API and works **offline-first** (local cache via `shared_preferences`). ## Clean architecture (per [`archit`](https://pub.dev/packages/archit)) ``` lib/ ├── core/ │ ├── constants/ app_config (API base url), app_strings (trilingual) │ ├── di/ GetIt service locator (injection.dart) │ ├── errors/ exceptions (data layer) → failures (domain layer) │ ├── network/ Dio ApiClient ({data}/{error} envelope) │ ├── routes/ GoRouter config │ ├── theme/ Material 3 colors + theme │ ├── usecases/ abstract UseCase base │ └── utils/ Result (Ok/Err), date helpers ├── features/ │ └── daily_activities/ │ ├── domain/ entities · repositories (abstract) · usecases (+ pure scheduling) │ ├── data/ models (JSON) · datasources (remote Dio / local prefs) · repository impl │ └── presentation/ providers (ChangeNotifier) · screens · widgets ├── app.dart MaterialApp.router + theme └── main.dart DI bootstrap → runApp ``` **Dependency rule:** `presentation → domain ← data`. The domain knows nothing of Flutter, Dio, or the API. Data is offline-first: remote when reachable, local cache otherwise; UI writes apply locally first then sync best-effort. ## Run ```bash flutter pub get # website backend must be running (see ../website) flutter run --dart-define=API_BASE_URL=http://localhost:3000 ``` - Default `API_BASE_URL` is `http://10.0.2.2:3000` (Android emulator → host). - For a physical device, pass your machine's LAN IP. - Web: `flutter run -d chrome --dart-define=API_BASE_URL=http://localhost:3000`. ## Quality ```bash flutter analyze # static analysis — currently clean (no issues) flutter test # add widget/unit tests under test/ ``` ## Adding a feature (archit convention) Create `lib/features//{domain,data,presentation}`, mirror the Daily Activities layering, register dependencies in `core/di/injection.dart`, and add a route in `core/routes/app_router.dart`. ## Stack `get_it` (DI) · `go_router` (routing) · `provider` (state) · `equatable` (value equality) · `dio` (HTTP) · `shared_preferences` (offline cache) · `intl`.