getDisplayInfo method

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

Implementation

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

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

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