/// 集中管理应用配置,通过 --dart-define=KEY=value 注入环境变量 /// /// 默认值 = 线上服务(jiu.51yanmei.com):本地 flutter run 不带 define 也连生产。 /// 需连本地后端时显式覆盖:flutter run \ /// --dart-define=BASE_URL=http://localhost:8080 \ /// --dart-define=PUBLIC_URL=http://localhost:8081 class AppConfig { const AppConfig._(); static const _baseUrl = String.fromEnvironment( 'BASE_URL', defaultValue: 'https://jiu.51yanmei.com', ); static const _publicUrl = String.fromEnvironment( 'PUBLIC_URL', defaultValue: 'https://jiu.51yanmei.com', ); static const shopName = String.fromEnvironment( 'SHOP_NAME', defaultValue: '酒库管理系统', ); static const shopAddress = String.fromEnvironment( 'SHOP_ADDRESS', defaultValue: '', ); static const shopPhone = String.fromEnvironment( 'SHOP_PHONE', defaultValue: '', ); static const aboutUrl = String.fromEnvironment( 'ABOUT_URL', defaultValue: 'https://jiu.51yanmei.com', ); static String get baseUrl => _baseUrl; static String get apiBaseUrl => '$_baseUrl/api/v1'; static String get healthUrl => '$_baseUrl/health'; static String get versionUrl => '$_baseUrl/version'; static String get publicBaseUrl => _publicUrl; }