app-starlock/star_lock/lib/flavors.dart

76 lines
2.0 KiB
Dart

enum Flavor {
dev,
pre,
sky,
xhj,
}
class StarLockAMapKey {
//iOS平台的key
final String iosKey;
//Android平台的key
final String androidKey;
const StarLockAMapKey({required this.iosKey, required this.androidKey});
}
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');
}
}
// StarLockAMapKey
static StarLockAMapKey get aMapKey {
switch (appFlavor) {
case Flavor.dev:
return const StarLockAMapKey(
androidKey: 'b56b681ee89f4db43a5aa1879ae8cbfe',
iosKey: 'bd4496e6598ef49796e3a80715035b4d');
case Flavor.pre:
return const StarLockAMapKey(
androidKey: '11d49b3f4fc09c04a02bbb7500925ba2',
iosKey: '883a3355d2d77c2fdc2667030dc97ffe');
// case Flavor.sky:
// return const StarLockAMapKey(
// androidKey: 'todo',
// iosKey: 'todo');
// case Flavor.xhj:
// return const StarLockAMapKey(
// androidKey: 'todo',
// iosKey: 'todo');
default:
throw Exception('flavor[$name] aMapKey not found');
}
}
}