Friday, May 24, 2024
HomeiOS Developmentios - "System detection situation with iPad Professional 13 inch (M4) utilizing...

ios – “System detection situation with iPad Professional 13 inch (M4) utilizing device_info_plus package deal in Flutter”


I exploit the Beneath dependency in my Flutter challenge to search out whether it is iPhone, iPad or Android machine. It will completely work till the brand new XCODE replace which has iPad simulators with M2 and M4 Chip.

Once I run my app in iPad Professional 13 inch (M4) from under perform, I obtained False which implies that is not iPad

So is there anybody who going through the identical situation or has the answer to this drawback or has any various dependency that finds the iPad with M Chips.

I’d be very grateful in case you learn it right here.

device_info_plus: ^10.1.0
import 'package deal:device_info_plus/device_info_plus.dart';
Future<bool> isIpad() async {
  print('isIpad Perform Known as');
  DeviceInfoPlugin deviceInfo = DeviceInfoPlugin();
  IosDeviceInfo data = await deviceInfo.iosInfo;
  if (data.mannequin.toLowerCase().comprises("ipad")) {
    print('That is iPad');
    return true;
  } else if (data.mannequin.toLowerCase().comprises("iphone")) {
    print('That is iPhone');
    return false;
  } else {
    print('That is Android');
    return false;
  }
}



Supply hyperlink

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments