initializeDeviceType method

Future<void> initializeDeviceType ()

Initializes the platform the app is running on at the start of the app. This method is normally called within initializeContext and usually not called directly.

Implementation

Future<void> initializeDeviceType() async {
  final iosInfo = await DeviceInfoPlugin().iosInfo;
  print('App running on ' + iosInfo.name);
  if (iosInfo.name.toLowerCase().contains('ipad')) {
    print('is ipad');
    platformState = PlatformState.IPAD;
  } else if (iosInfo.name.toLowerCase().contains('iphone')) {
    platformState = PlatformState.IPHONE;
  } else {
    platformState = PlatformState.GENERIC;
  }
}