Files
social-app/apps/lib/core/config/env.dart
T
qzl 4b92772535 feat: 优化前端 UI 组件与交互体验
- 优化日历、待办、消息等页面交互
- 更新 ChatBloc 与 UI Schema 渲染
- 优化联系人、首页、设置页面体验
2026-03-16 16:11:28 +08:00

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;
}
}