getResolution method
Method to get device display resolution in pixels
Implementation
@override
Future<Size?> getResolution() async {
final size = await methodChannel
.invokeMethod<Map<Object?, Object?>>('getResolution');
return switch (size) {
{'width': 0, 'height': 0} => null,
{'width': final num width, 'height': final num height} =>
Size(width.toDouble(), height.toDouble()),
_ => null
};
}