28 lines
722 B
Dart
28 lines
722 B
Dart
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;
|
|
}
|