getDeviceModel static method

Future<String?> getDeviceModel()

Implementation

static Future<String?> getDeviceModel() async {
  DeviceInfoPlugin deviceInfo = DeviceInfoPlugin();
  if (Platform.isAndroid == true) {
    AndroidDeviceInfo androidInfo = await deviceInfo.androidInfo;
    return androidInfo.model;
  } else if (Platform.isIOS == true) {
    IosDeviceInfo iphoneInfo = await deviceInfo.iosInfo;
    return iphoneInfo.model;
  }
  return null;
}