getDeviceName static method

Future<String> getDeviceName()

Implementation

static Future<String> getDeviceName() async {
  var deviceInfo = DeviceInfoPlugin();
  if (Platform.isAndroid) {
    var androidDeviceInfo = await deviceInfo.androidInfo;
    return androidDeviceInfo.model; // Or any other property that makes sense
  } else if (Platform.isIOS) {
    var iosDeviceInfo = await deviceInfo.iosInfo;
    return iosDeviceInfo.utsname.machine;
  }
  return "Unknown";
}