You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
450 B
17 lines
450 B
class AppConfig {
|
|
final String baseUrl;
|
|
|
|
const AppConfig._(this.baseUrl);
|
|
|
|
// 根据不同环境返回不同配置
|
|
static AppConfig fromEnv(String env) {
|
|
switch (env) {
|
|
case 'prod':
|
|
return const AppConfig._('https://api.example.com');
|
|
case 'test':
|
|
return const AppConfig._('https://test-api.example.com');
|
|
default:
|
|
return const AppConfig._('https://dating-agency-api-test.qniao.cn');
|
|
}
|
|
}
|
|
}
|