getEffectivPreviewSize static method
android has a limits on preview size and fallback to 1920x1080 if preview is too big So to prevent having different ratio we get the real preview Size directly from nativ side
Implementation
static Future<Size> getEffectivPreviewSize() async {
final sizeMap = await _channel
.invokeMapMethod<String, dynamic>("getEffectivPreviewSize");
final int width = sizeMap?["width"] ?? 0;
final int height = sizeMap?["height"] ?? 0;
return Size(width.toDouble(), height.toDouble());
}