getCpuInfo method

  1. @override
Future<CpuInfo> getCpuInfo()
override

Implementation

@override
Future<CpuInfo> getCpuInfo() async {
  try {
    final Map<dynamic, dynamic>? res = await methodChannel.invokeMethod('getCpuInfo');
    if (res == null) return const CpuInfo();
    return CpuInfo.fromMap(res.cast<String, dynamic>());
  } on PlatformException catch (e) {
    throw DeviceInspectorException(_mapErrorCode(e.code), e.message ?? 'Failed to get CPU info', cause: e);
  } catch (e) {
    return const CpuInfo();
  }
}