getEffectivPreviewSize static method

Future<PreviewSize> getEffectivPreviewSize(
  1. int index
)

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<PreviewSize> getEffectivPreviewSize(int index) async {
  final ps = await CameraInterface().getEffectivPreviewSize(index);
  if (ps != null) {
    return PreviewSize(width: ps.width, height: ps.height);
  } else {
    // TODO Should not be null?
    return PreviewSize(width: 0, height: 0);
  }
}