getHardwareInformation method

Future<JHardwareInfo> getHardwareInformation()

Future method called getHardwareInformation has JHardwareInfo return type.

Implementation

Future<JHardwareInfo> getHardwareInformation() async {
  JHardwareInfo hardwareInfo = JHardwareInfo();
  try {
    final value = await _methodChannel.invokeMethod<String>(_DEVICE_INFO);
    if (value != null) {
      final val = json.decode(value);
      hardwareInfo = JHardwareInfo.fromMap(val);
    }
    return hardwareInfo;
  } catch (e) {
    return hardwareInfo;
  }
}