Initial project import
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
import 'dart:io';
|
||||
|
||||
class UpdateConfig {
|
||||
UpdateConfig._();
|
||||
|
||||
static const baseUrl = String.fromEnvironment(
|
||||
'UPDATE_BASE_URL',
|
||||
defaultValue: 'https://version.nxsir.cn',
|
||||
);
|
||||
static const appKey = String.fromEnvironment(
|
||||
'UPDATE_APP_KEY',
|
||||
defaultValue: 'MvSyHJ7d8mlLbylIub04epC7g5AsCSqB',
|
||||
);
|
||||
static const internalBuild = bool.fromEnvironment('INTERNAL_BUILD');
|
||||
|
||||
static String? get platform {
|
||||
if (Platform.isAndroid) return 'android';
|
||||
if (Platform.isIOS) return 'ios';
|
||||
return null;
|
||||
}
|
||||
|
||||
static String get channel => internalBuild ? 'beta' : 'stable';
|
||||
|
||||
static bool get supportsUpdates => platform != null;
|
||||
|
||||
static bool get canInstallInApp => Platform.isAndroid && internalBuild;
|
||||
}
|
||||
Reference in New Issue
Block a user