4b92772535
- 优化日历、待办、消息等页面交互 - 更新 ChatBloc 与 UI Schema 渲染 - 优化联系人、首页、设置页面体验
23 lines
524 B
Dart
23 lines
524 B
Dart
import 'dart:io';
|
|
|
|
class Env {
|
|
static String get apiUrl {
|
|
final backendUrl = const String.fromEnvironment('BACKEND_URL');
|
|
if (backendUrl.isNotEmpty && backendUrl != 'false') {
|
|
return backendUrl;
|
|
}
|
|
if (Platform.isAndroid) {
|
|
return 'http://10.0.2.2:5775';
|
|
}
|
|
return 'http://localhost:5775';
|
|
}
|
|
|
|
static bool get isMockApi {
|
|
final fromDefine = const String.fromEnvironment('MOCK_API');
|
|
if (fromDefine.isNotEmpty) {
|
|
return fromDefine == 'true';
|
|
}
|
|
return false;
|
|
}
|
|
}
|