1

Trying to crop the video of a video to display a preview as a square without changing its width and height.

J. Diaz
  • 371
  • 1
  • 6
  • 16

1 Answers1

1

This is how it makes a square video

Container(
  width: 200, //Crop width
  height: 200, //Crop height
  child: FittedBox(
    // alignment: Alignment.center, //Move around the crop
    fit: BoxFit.cover,
    clipBehavior: Clip.hardEdge,
    child: SizedBox(
      width: videoController.value.size.width,
      height: videoController.value.size.height,
      child: AspectRatio(
        aspectRatio: videoController.value.aspectRatio,
        child: VideoPlayer(
          videoController,
        ),
      ),
    ),
  ),
);
J. Diaz
  • 371
  • 1
  • 6
  • 16