getSystemInfo method

  1. @override
Future<Map<String, dynamic>> getSystemInfo()
override

Implementation

@override
Future<Map<String, dynamic>> getSystemInfo() async {
  Map<String, dynamic> result = <String, dynamic>{};

  try {
    final systemInfo = await methodChannel
        .invokeMethod<Map<dynamic, dynamic>>('getSystemInfo');

    return jsonDecode(_jsonEncoder.convert(systemInfo));
  } on PlatformException catch (error) {
    return result
      ..addEntries(
          [MapEntry("code", error.code), MapEntry("message", error.message)]);
  }
}