I’m working on a Flutter app where I’m using the camera package to integrate camera functionality. I want to display the camera preview with a 3:4 aspect ratio while ensuring that it takes the full width of the screen. However, when I try the following code snippet:
Container(
width: double.infinity,
child: AspectRatio(
aspectRatio: 3 / 4,
child: CameraPreview(controller.controllerCamera),
),
);
The camera preview appears stretched vertically. How can I maintain the 3:4 aspect ratio for the camera preview while ensuring it takes the full width of the screen without stretching the image vertically? Any insights or suggestions would be greatly appreciated. Thank you!
I am using camera: ^0.10.5+5