starwork_flutter/lib/flavors.dart
2025-09-03 09:39:06 +08:00

50 lines
1.1 KiB
Dart

enum Flavor {
skyDev,
skyPre,
skyRelease,
xhjDev,
xhjPre,
xhjRelease,
}
class F {
static late final Flavor appFlavor;
static String get name => appFlavor.name;
static String get title {
switch (appFlavor) {
case Flavor.skyDev:
return '星勤-sky-dev';
case Flavor.skyPre:
return '星勤-sky-pre';
case Flavor.skyRelease:
return '星勤-sky-release';
case Flavor.xhjDev:
return '星勤-xhj-dev';
case Flavor.xhjPre:
return '星勤-xhj-pre';
case Flavor.xhjRelease:
return '星勤-xhj-release';
}
}
static String get apiHost {
switch (appFlavor) {
case Flavor.skyDev:
return 'http://10.0.2.2/api';
case Flavor.skyPre:
return 'https://loacl.work.star-lock.cn/api';
case Flavor.skyRelease:
return 'https://loacl.work.star-lock.cn/api';
case Flavor.xhjDev:
return 'https://loacl.work.star-lock.cn/api';
case Flavor.xhjPre:
return 'https://loacl.work.star-lock.cn/api';
case Flavor.xhjRelease:
return 'https://loacl.work.star-lock.cn/api';
}
}
}