image_crop
image_crop copied to clipboard
How can I use 16:9 type aspectRatio?
How can I use 16:9 type aspectRatio? I need the crop area be fixed and I need to move only image. I need rectangle type crop area to certain width and height. How can I do that?
child: Crop.file( _sample, key: cropKey, alwaysShowGrid: true, aspectRatio: 4.0 / 3.0,),
@NTMS2017 If I understand you correctly, then it’s quite simple
final media = MediaQuery.of(context);
final height = (media.size.width / 16) * 9;
SizedBox(
width: media.size.width,
height: height,
child: Crop.file(
image,
key: _cropKey,
aspectRatio: 16 / 9,
),
);