flutter 判断是否是ipad


import 'package:device_info/device_info.dart';

 

///是否是ipad
static bool isIpad = false;

static checkIpadFunc() async {
if (Platform.isAndroid == false) {
DeviceInfoPlugin deviceInfo = DeviceInfoPlugin();
IosDeviceInfo info = await deviceInfo.iosInfo;
print('======a=======a=======a=======a========a======={info.model}');
print('======a=======a=======a=======a========a======={info.utsname.machine.toLowerCase()}');
print('======a=======a=======a=======a========a=======${info.systemName}');
isIpad = info.utsname.machine.toLowerCase().contains("ipad");
}
}

 

 

参考:https://www.jianshu.com/p/43d6b7fcf343


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM