getScreenResolution method

  1. @override
Future<Map<String, double>?> getScreenResolution()
override

Fetches the screen resolution in pixels (width and height).

Implementation

@override
Future<Map<String, double>?> getScreenResolution() async {
  final Map<dynamic, dynamic>? result = await methodChannel
      .invokeMethod<Map<dynamic, dynamic>>('getScreenResolution');
  if (result != null) {
    return {
      'width': result['width'],
      'height': result['height'],
    };
  }
  return null;
}