getImageSize method

Size getImageSize(
  1. BuildContext context
)

Implementation

Size getImageSize(BuildContext context) {
  assert(_cameraController != null, 'Camera controller not initialized');
  assert(_cameraController!.value.previewSize != null, 'Preview size is null');
  final width = MediaQuery.of(context).size.width;
  final height = MediaQuery.of(context).size.height;
  return Size(
    _cameraController?.value.previewSize?.height ?? height,
    _cameraController?.value.previewSize?.width ?? width,
  );
}