getMemoryInfo method

  1. @override
Future<MemoryInfo> getMemoryInfo()
override

Implementation

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