I am trying to crop in a square ratio my camera preview but I keep getting stretched camera even tho I tried almost everything here : How to square crop a Flutter camera preview But nothing worked.
Here is my current code :
return Column(
children: [
Stack(
children: [
AspectRatio(
aspectRatio: 1,
child: ClipRect(
child: Transform.scale(
scale: 1 / cameraController.value.aspectRatio,
child: Center(
child: AspectRatio(
aspectRatio: cameraController.value.aspectRatio,
child: CameraPreview(cameraController),
),
),
),
),
),
