add dashboard to phone app

This commit is contained in:
root
2026-05-25 05:10:43 -04:00
parent d04c8ce437
commit 277db06d26
67 changed files with 7872 additions and 570 deletions
+18 -4
View File
@@ -1,10 +1,24 @@
import 'dart:io';
class AppConstants {
// Android emulator routes localhost as 10.0.2.2; iOS simulator uses localhost fine
static String get baseUrl => Platform.isAndroid
? 'http://10.0.2.2:4000/api/v1'
: 'http://localhost:4000/api/v1';
static const String apiBaseUrlOverride =
String.fromEnvironment('API_BASE_URL');
static const String developmentAndroidApiUrl = 'http://10.0.2.2:4000/api/v1';
static const String developmentLocalApiUrl = 'http://localhost:4000/api/v1';
// Dev builds stay local by default. Real phones still need a LAN-reachable
// override because their localhost is the phone itself, not the dev machine.
static String get baseUrl {
if (apiBaseUrlOverride.isNotEmpty) {
return apiBaseUrlOverride;
}
if (Platform.isAndroid) {
return developmentAndroidApiUrl;
}
return developmentLocalApiUrl;
}
static const String tokenKey = 'auth_token';
static const String userTypeKey = 'user_type';