crop_your_image icon indicating copy to clipboard operation
crop_your_image copied to clipboard

`maskColor` is displayed beyond the imageRect inside of a `Stack`

Open Azhng opened this issue 1 year ago • 3 comments

When rendering the Crop widget inside of a Stack widget, the maskColor fills the parent Stack widget instead of displaying the underlying color of the parent widget.

IMG_3089B13072C7-1

Code sample:

class _Body extends StatelessWidget {
  const _Body({Key? key, required this.bytes}) : super(key: key);
  final UInt8List bytes;

  @override
  Widget build(BuildContext context) {
    return LayoutBuilder(
      builder: (_, constraints) {
        return Scaffold(
          backgroundColor: Colors.white,
          body: Stack(
            children: [
              Align(
                alignment: Alignment.center,
                child: Padding(
                  padding: const EdgeInsets.all(24),
                  child: Crop(
                    controller: CropController(),
                    image: bytes,
                    onCropped: (croppedData) {},
                    aspectRatio: 1,
                    initialSize: 1.0,
                    cornerDotBuilder: (size, _) => const DotControl(),
                    baseColor: AppColors.scaffoldBackgroundColor,
                  ),
                ),
              ),
            ],
          ),
        );
      },
    );
  }
}

Azhng avatar Jun 12 '23 15:06 Azhng

@Azhng Thank you for your feedback. I'm afraid fixing this is challenging as the size of images (and outside of images) can be changed depending on zooming. I'll check the code and think about it in detail.

chooyan-eng avatar Jun 30 '23 11:06 chooyan-eng

Thank you so much!

Azhng avatar Jun 30 '23 14:06 Azhng

Any news on this ?

geosebas avatar Feb 05 '24 10:02 geosebas