API base URL
The app learns your Veldriq origin at compile time. There is no production “server URL” settings screen. Technicians only type email and password.
--dart-define=API_BASE_URL must be origin only:
https://fsm.example.comNot https://fsm.example.com/api/v1, not /backend, not a trailing path. The Git folder backend/ is not an HTTP path. A trailing slash on the origin is stripped. A path is not supported.
Production (APP_ENV=production / prod) refuses HTTP. A missing or non-HTTPS URL fails closed and the app shows Invalid configuration (“The API base URL is missing or invalid. Production requires HTTPS.”). There is no silent localhost fallback.
The only dart-defines in V1
Section titled “The only dart-defines in V1”| Define | Required | Notes |
|---|---|---|
API_BASE_URL |
Production: yes | Origin only. No /backend, no /api, no /api/v1 |
APP_ENV |
No (default development) |
development or production (also accepts prod) |
APP_DISPLAY_NAME |
No | In-app title. Default Veldriq Field. Does not change the home-screen label |
Do not invent dart-defines for licences, Firebase, or Envato.
If APP_ENV is not production and you omit API_BASE_URL, the loader uses http://127.0.0.1:8000. That is a convenience default, not a production fallback.
Android emulator to a host machine Laravel: http://10.0.2.2:8000 (not 127.0.0.1 on the emulator). On a physical device on the same LAN, use the machine’s LAN IP instead of 10.0.2.2.
How to pass them
Section titled “How to pass them”# Laptop / iOS Simulator against local Laravelflutter run --flavor development \ --dart-define=APP_ENV=development \ --dart-define=API_BASE_URL=http://127.0.0.1:8000 \ --dart-define=APP_DISPLAY_NAME=Field\ Dev
# Android emulator against Laravel on the hostflutter run --flavor development \ --dart-define=APP_ENV=development \ --dart-define=API_BASE_URL=http://10.0.2.2:8000 \ --dart-define=APP_DISPLAY_NAME=Field\ Dev
# Store-bound Androidflutter build apk --flavor production --release \ --dart-define=APP_ENV=production \ --dart-define=API_BASE_URL=https://fsm.example.com \ --dart-define=APP_DISPLAY_NAME=Acme\ FieldThe HTTP client uses your define as baseUrl and then requests paths that already start with /api/v1/mobile/… (login) and /api/v1/field/… (sync). If you put /api or /api/v1 in the define, treat that as a builder mistake. Do not publish an author hostname as the buyer default.
This tree does not ship networkSecurityConfig / usesCleartextTraffic. Android or iOS may still block cleartext HTTP even when APP_ENV=development. Do not turn platform ATS / cleartext policy off for production.
License is activated on the web product
Section titled “License is activated on the web product”Activate Field on the web deployment. Until Field is activated there, login shows Access denied. See Licence.
If it fails
Section titled “If it fails”- Wrong path in the define → rebuild without
/api. - Android emulator still on 127.0.0.1 → switch to
10.0.2.2and rebuild. - Certificate name mismatch → devices fail TLS even when a desktop browser shows a click-through.
- Native Field does not use CORS or CSRF cookies — do not add the origin to SPA CORS lists as a Field fix.
Splash Checking server… should become Welcome back, not Invalid configuration. Rebuild to change the origin.