getMachineCode static method

Future<String?> getMachineCode()

Implementation

static Future<String?> getMachineCode() async {
  final DeviceInfoPlugin deviceInfo = DeviceInfoPlugin();
  String? machineCode = uuid.v4();
  if (Platform.isAndroid) {
    final AndroidDeviceInfo androidInfo = await deviceInfo.androidInfo;
    machineCode = androidInfo.androidId;
    // model = androidInfo.model;
    // os = androidInfo.brand;
  } else if (Platform.isIOS) {
    final IosDeviceInfo iosInfo = await deviceInfo.iosInfo;
    machineCode = iosInfo.identifierForVendor;
    // model = iosInfo.model;
    // os = iosInfo.utsname.sysname;
  }
  return machineCode;
}