Files
water-management-system/mobile-app/lib/config/app_config.dart
T
bot_dev2 d9d72405c6 feat(mobile): #24 Flutter三合一APP骨架搭建
- Flutter 3.x 项目初始化(pubspec.yaml + 目录结构)
- 核心依赖:dio/go_router/provider/shared_preferences/hive/geolocator
- 统一登录页 + Token管理(TokenService + AuthInterceptor)
- 底部Tab三合一导航(供水/巡检/营收)
- 供水管理Tab:监测数据列表(MonitorListPage)
- 巡检Tab:任务列表+状态筛选+进度展示(PatrolTaskListPage)
- 营收Tab:抄表页面+账单列表(MeterReadingPage/BillListPage)
- 消息推送服务(PushService)
- GPS定位服务(LocationService)
- 拍照/相册服务(CameraService)
- 离线缓存服务(CacheService)
- Android/iOS打包配置+权限声明
- GoRouter路由+Auth认证守卫
- Provider状态管理
2026-06-15 08:52:55 +08:00

40 lines
835 B
Dart

/// 应用全局配置
class AppConfig {
static AppConfig? _instance;
AppConfig._internal();
factory AppConfig() {
_instance ??= AppConfig._internal();
return _instance!;
}
/// 环境配置
AppEnvironment _environment = AppEnvironment.development;
AppEnvironment get environment => _environment;
/// 切换环境
void setEnvironment(AppEnvironment env) {
_environment = env;
}
/// API 基础地址
String get baseUrl {
switch (_environment) {
case AppEnvironment.development:
return 'https://dev-api.xayunmei.com';
case AppEnvironment.staging:
return 'https://staging-api.xayunmei.com';
case AppEnvironment.production:
return 'https://api.xayunmei.com';
}
}
}
/// 环境枚举
enum AppEnvironment {
development,
staging,
production,
}