getDeviceId static method

Future<String?> getDeviceId()

Implementation

static Future<String?> getDeviceId() async {
  // try {
  //   if (Platform.isAndroid) {
  //     var androidInfo = await _deviceInfoPlugin.androidInfo;
  //     return androidInfo.id;
  //   } else if (Platform.isIOS) {
  //     var iosInfo = await _deviceInfoPlugin.iosInfo;
  //     return iosInfo.identifierForVendor;
  //   } else if (Platform.isLinux) {
  //     var linuxInfo = await _deviceInfoPlugin.linuxInfo;
  //     return linuxInfo.machineId;
  //   } else if (Platform.isMacOS) {
  //     var macOsInfo = await _deviceInfoPlugin.macOsInfo;
  //     return macOsInfo.systemGUID;
  //   } else if (Platform.isWindows) {
  //     var windowsInfo = await _deviceInfoPlugin.windowsInfo;
  //     return windowsInfo.deviceId;
  //   } else {
  //     // For web or any other unsupported platform
  //     var webInfo = await _deviceInfoPlugin.webBrowserInfo;
  //     return webInfo.vendor ?? 'Unknown';
  //   }
  // } catch (e) {
  //   print('Failed to get device id: $e');
  // }
  return null;
}