getDeviceId function

Future<String> getDeviceId()

Implementation

Future<String> getDeviceId() async {
  var info = DeviceInfoPlugin();

  if (Platform.isAndroid) {
    var androidInfo = await info.androidInfo;
    return androidInfo.androidId!;
  } else if (Platform.isIOS) {
    var iosInfo = await info.iosInfo;
    return iosInfo.identifierForVendor!;
  }

  return "";
}