# KiyoHR TimeX Flutter

Flutter mobile app for HRMS attendance flows, integrated with Laravel API routes under `/api`.

## Run the app

```bash
flutter pub get
flutter run
```

Update API base URL and feature flags in `assets/config/app_config.json`.
Set base as your domain root (example: `http://hrms.saas.laravel/`); app adds `/api` from config.
If the device cannot resolve local domain names, add fallback base URLs (for emulator/localhost) in `apiFallbackBaseUrls`.
For mixed setups (virtual host + local emulator), use `apiFullBaseUrls` to list complete API URLs (including `/api`).

## Camera attendance flow

- Dashboard `Clock In` and `Clock Out` actions open a real camera preview.
- User captures an image before attendance submit.
- Captured image is converted to base64 and included in request payload as `captured_photo_base64`.

## Local Laravel API integration tests

The integration tests call your local Laravel API and are opt-in.

```bash
flutter test test/integration/local_laravel_api_test.dart \
  --dart-define=API_BASE_URL=http://hrms.saas.laravel/ \
  --dart-define=TEST_EMAIL=admin@example.com \
  --dart-define=TEST_PASSWORD=your_password
```

If defines are not provided, the integration test file is skipped.
