app-starlock/star_lock/lib/flavors.dart

44 lines
1017 B
Dart

enum Flavor {
dev,
pre,
sky,
xhj,
}
class F {
static Flavor? appFlavor;
static String get name => appFlavor?.name ?? '';
static String get title {
switch (appFlavor) {
case Flavor.dev:
return '星锁-dev';
case Flavor.pre:
return '星锁-pre';
case Flavor.sky:
return '锁通通';
case Flavor.xhj:
return '鑫锁';
default:
throw Exception('flavor[$name] title not found');
}
}
static String get apiPrefix {
switch (appFlavor) {
case Flavor.dev:
return 'https://dev.lock.star-lock.cn';
case Flavor.pre:
return 'https://pre.lock.star-lock.cn';
case Flavor.sky:
return 'https://lock.skychip.top';
case Flavor.xhj:
return 'https://lock.xhjcn.ltd';
default:
// "http://192.168.1.15:8022"; //谢总本地
// "https://ge.lock.star-lock.cn"; //葛工开发环境地址
throw Exception('flavor[$name] apiPrefix not found');
}
}
}