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