getDisplayInfo method

  1. @override
Future<DisplayInfo> getDisplayInfo()
override

Returns native Android display capabilities for the active display.

Implementation

@override
Future<DisplayInfo> getDisplayInfo() async {
  final Map<Object?, Object?>? displayMap = await methodChannel
      .invokeMapMethod<Object?, Object?>('getDisplayInfo');

  if (displayMap == null) {
    throw PlatformException(
      code: 'native_lens_empty_display',
      message: 'Android returned empty display information.',
    );
  }

  return DisplayInfo.fromMap(displayMap);
}