77 lines
1.9 KiB
Dart
77 lines
1.9 KiB
Dart
import 'package:flutter/foundation.dart';
|
||
|
||
enum Flavor { sky, xhj }
|
||
|
||
class F {
|
||
static late final Flavor appFlavor;
|
||
|
||
static String get name => appFlavor.name;
|
||
|
||
static String get title {
|
||
switch (appFlavor) {
|
||
case Flavor.sky:
|
||
return '星勤-sky';
|
||
case Flavor.xhj:
|
||
return '星勤-xhj';
|
||
}
|
||
}
|
||
|
||
static String get apiHost {
|
||
if (kReleaseMode) {
|
||
// Release环境的API地址
|
||
switch (appFlavor) {
|
||
case Flavor.sky:
|
||
return 'https://192.168.1.121:8112/api'; // 生产环境API
|
||
case Flavor.xhj:
|
||
return 'https://api.xhjcn.ltd/api'; // 生产环境API
|
||
}
|
||
} else {
|
||
// Debug/Profile环境的API地址(开发环境)
|
||
switch (appFlavor) {
|
||
case Flavor.sky:
|
||
return 'http://197o136q43.oicp.vip/api';
|
||
case Flavor.xhj:
|
||
return 'https://loacl.work.star-lock.cn/api';
|
||
}
|
||
}
|
||
}
|
||
|
||
static String get starCloudClientId {
|
||
switch (appFlavor) {
|
||
case Flavor.sky:
|
||
return '0JLrKMhBSSHH0VlRLcIko5NrESfzDJ8B';
|
||
case Flavor.xhj:
|
||
return '0JLrKMhBSSHH0VlRLcIko5NrESfzDJ8B';
|
||
}
|
||
}
|
||
|
||
static String get starCloudSecret {
|
||
switch (appFlavor) {
|
||
case Flavor.sky:
|
||
return 'KS8KvZKPKKHgsoDbcfQCCScvyyqeolDt';
|
||
case Flavor.xhj:
|
||
return 'KS8KvZKPKKHgsoDbcfQCCScvyyqeolDt';
|
||
}
|
||
}
|
||
|
||
static String get starCloudUrl {
|
||
if (kReleaseMode) {
|
||
// Release环境的StarCloud地址
|
||
switch (appFlavor) {
|
||
case Flavor.sky:
|
||
return 'https://cloud.star-lock.cn'; // 生产环境
|
||
case Flavor.xhj:
|
||
return 'https://cloud.star-lock.cn'; // 生产环境
|
||
}
|
||
} else {
|
||
// Debug/Profile环境的StarCloud地址(开发环境)
|
||
switch (appFlavor) {
|
||
case Flavor.sky:
|
||
return 'http://192.168.1.121:8111/sdk';
|
||
case Flavor.xhj:
|
||
return 'http://local.cloud.star-lock.cn';
|
||
}
|
||
}
|
||
}
|
||
}
|