如何放大/调整大小/缩放已使用已定义的 Rect 裁剪的小部件?

问题描述 投票:0回答:0

我从图像裁剪器包中获取矩形,它就像一个魅力,它裁剪了我想要的确切矩形,问题是,我如何放大/缩放/调整 ClipRect 内的小部件以适合屏幕或所有可用空间可能吗?

class Clipper extends CustomClipper<Rect> {
  const Clipper(this.rect);
  final Rect rect;
  @override
  Rect getClip(Size size) => rect;

  @override
  bool shouldReclip(covariant CustomClipper<Rect> oldClipper) => true;
}

ClipRect(
    clipper: Clipper(provider.initialCropArea!),
       child: Center(
        child: Image.memory(
            _imageBytes,
        fit: BoxFit.fill,
               ),
             ),
           ),

This is the original imageThis is the desired output This is the result

我试过这个解决方案但它对我根本不起作用,this is what happens when I try it

flutter crop
© www.soinside.com 2019 - 2024. All rights reserved.