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

posted @ 2021-01-02 11:14  lude1994  阅读(2458)  评论(0编辑  收藏  举报