WallPaper_FSX_Flutter/lib/common/utils/device_info_util.dart
fengshengxiong 9caadfb09a 1.按照UI图修改
2.完善其他功能
2024-05-17 17:02:22 +08:00

22 lines
715 B
Dart

// Author: fengshengxiong
// Date: 2024/5/11
// Description: 设备信息
import 'package:device_info_plus/device_info_plus.dart';
class DeviceInfoUtil {
/// 获取当前Android设备的系统版本
static Future<int> getAndroidSystemVersion() async {
DeviceInfoPlugin deviceInfoPlugin = DeviceInfoPlugin();
AndroidDeviceInfo androidDeviceInfo = await deviceInfoPlugin.androidInfo;
return androidDeviceInfo.version.sdkInt;
}
/// 获取当前iOS设备的系统版本
static Future<String> getIOSSystemVersion() async {
DeviceInfoPlugin deviceInfoPlugin = DeviceInfoPlugin();
IosDeviceInfo iosDeviceInfo = await deviceInfoPlugin.iosInfo;
return iosDeviceInfo.systemVersion;
}
}