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