This commit is contained in:
wgh19
2024-05-31 19:58:06 +08:00
parent fd63b02b60
commit 61c6ed0e1b

View File

@@ -48,18 +48,20 @@ class _App {
init() async { init() async {
cachePath = (await getApplicationCacheDirectory()).path; cachePath = (await getApplicationCacheDirectory()).path;
dataPath = (await getApplicationSupportDirectory()).path; dataPath = (await getApplicationSupportDirectory()).path;
final deviceInfoPlugin = DeviceInfoPlugin(); if (App.isWindows) {
final deviceInfo = await deviceInfoPlugin.windowsInfo; final deviceInfoPlugin = DeviceInfoPlugin();
if (deviceInfo.majorVersion <= 6) { final deviceInfo = await deviceInfoPlugin.windowsInfo;
if (deviceInfo.minorVersion < 2) { if (deviceInfo.majorVersion <= 6) {
_windowsVersion = 7; if (deviceInfo.minorVersion < 2) {
_windowsVersion = 7;
} else {
_windowsVersion = 8;
}
} else if (deviceInfo.buildNumber < 22000) {
_windowsVersion = 10;
} else { } else {
_windowsVersion = 8; _windowsVersion = 11;
} }
} else if (deviceInfo.buildNumber < 22000) {
_windowsVersion = 10;
} else {
_windowsVersion = 11;
} }
} }