isIOSSimulator function

Future<bool> isIOSSimulator({
  1. bool? overrideIsWeb,
})

Implementation

Future<bool> isIOSSimulator({
  bool? overrideIsWeb,
}) async {
  if (!isAppleOS(supportWeb: false, overrideIsWeb: overrideIsWeb)) {
    return false;
  }

  final deviceInfo = DeviceInfoPlugin();

  final osInfo = await deviceInfo.deviceInfo;

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