isIOSSimulator function

Future<bool> isIOSSimulator()

Implementation

Future<bool> isIOSSimulator() async {
  if (!isAppleOS()) {
    return false;
  }

  final deviceInfo = DeviceInfoPlugin();

  final osInfo = await deviceInfo.deviceInfo;

  if (osInfo is IosDeviceInfo) {
    final iosInfo = osInfo;
    return !iosInfo.isPhysicalDevice;
  }
  return false;
}