getDeviceName function

Future<String> getDeviceName()

Implementation

Future<String> getDeviceName() async {
  String brand = '';
  String id = '';
  if (Platform.isAndroid) {
    final deviceInfo = await PlatformDeviceId.deviceInfoPlugin.androidInfo;
    brand = deviceInfo.device;
    id = deviceInfo.androidId;
  } else {
    final deviceInfo = await PlatformDeviceId.deviceInfoPlugin.iosInfo;
    brand = deviceInfo.model;
    id = deviceInfo.identifierForVendor;
  }

  return '$brand|$id';
}