The app has exactly two environments, chosen at build time. There is no in-app server picker: a debug build talks to development, a release build talks to production, and the organization is part of the sign-in rather than a setting.
Video tutorials for this topic
The two environments
EnvironmentConfig in lib/config/environment.dart is the single source:
| Key | Development | Production |
|---|---|---|
appengineEndpoint | http://192.168.1.239:3300 | https://appengine.appmint.io |
apiBaseUrl | http://192.168.1.239:4050/api | https://api.appmint.io |
appUrl | http://192.168.1.239:4050 | https://appmint.io |
defaultOrgId | demo | (empty — typed at sign-in) |
main.dart selects production when kReleaseMode is true and development otherwise. flutter run is therefore always development; flutter build apk, flutter build ipa and flutter build web --release are always production.
A phone on the same Wi-Fi cannot reach localhost on your Mac, so the development endpoint is the machine's LAN IP. Supply the intended endpoint with APPENGINE_URL when the machine or network changes.
Derived behaviour
Build-time endpoint overrides take precedence over the environment defaults. Pass --dart-define=APPENGINE_URL=<backend-url> for the backend and --dart-define=STUDIO_URL=<studio-url> for the web account-recovery destination. Use a reachable LAN address on a physical phone; localhost on that phone refers to the phone itself.
These defaults follow from the environment:
| Flag | Development | Production |
|---|---|---|
enableDebugLogs | on — every request and response is logged to the console | off |
enableCrashReporting | off | on |
enableAnalytics | off | on |
| "Fast Login (Dev)" button | shown | hidden — it is gated on kDebugMode, and the credentials are the demo organization's |
Timeouts are 30 seconds for connect and receive, with 3 retries. Lists page at 20 by default and 100 at most.
Organization and tokens
The organization id is entered on the sign-in screen (or filled from defaultOrgId in development) and sent as a lowercase orgid header on every request. Sign-in returns an access token and a refresh token.
The app has no app credential: no App ID or app secret ships in it, and it does not use app/key or app/attest. Every call is made as the signed-in staff member, with their token in Authorization: Bearer (lib/services/http_client.dart). App sign-in (Phone apps without a secret) is for apps that act before a person signs in, such as a customer app or a site's chat widget.
| Stored value | Where | Key |
|---|---|---|
| Access token | Secure storage (Keychain / Keystore) | access_token |
| Refresh token | Secure storage | refresh_token |
| User record | Shared preferences | user_data |
| Organization | Shared preferences | orgId, remembered_org |
| Contact details | Shared preferences | userEmail, userPhone |
| Saved sessions | Shared preferences | saved_sessions |
A 401 triggers one refresh (POST /profile/user/refresh) and one retry. A second failure signs the user out.
Legal and support links
lib/config/legal_urls.dart holds the links surfaced in the app: privacy at https://appmint.io/privacy, terms at https://appmint.io/terms, and support to [email protected] with the subject "Appmint Mobile — Support Request".
Platform identifiers
| Value | |
|---|---|
| Android application id | io.appmint.appmint_mobile |
| iOS bundle id | io.appmint.appmintMobile |
| Current version | 1.0.2+9 |
