getEffectivPreviewSize static method

Future<PreviewSize> getEffectivPreviewSize()

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