import 'dart:io';

import 'package:device_info_plus/device_info_plus.dart';

Future<bool> isEmulator() async {
  DeviceInfoPlugin deviceInfo = DeviceInfoPlugin();

  if (Platform.isAndroid) {
    AndroidDeviceInfo androidInfo = await deviceInfo.androidInfo;
    return !androidInfo.isPhysicalDevice;
  } else if (Platform.isIOS) {
    IosDeviceInfo iosInfo = await deviceInfo.iosInfo;
    return !iosInfo.isPhysicalDevice;
  } else {
    return false;
  }
}
