hnvn / flutter_image_cropper

A Flutter plugin for Android and iOS supports cropping images
1k stars 392 forks source link

7.0.3 WebUiSettings customDialogBuilder expects a Dialog, not a widget #496

Open blaneyneil opened 5 months ago

blaneyneil commented 5 months ago

When creating a stateful widget for WebUiSettings, per your updated example, so that it can be initialized:

@override
    void initState() {
      super.initState();
      /// IMPORTANT: must to call this function
      widget.initCropper();
    }

the customDialogBuilder will not actually take a widget. it's throwing with this error:

The return type '_CropperWidget' isn't a 'Dialog', as required by the closure's context.

hnvn commented 5 months ago

that's my bug, customDialogBuilder should return Widget instead, I've just release 7.0.4 to fix it. Please have a try

blaneyneil commented 5 months ago

Yep, thanks much. I still had to wrap it in a Dialog for my custom design purposes, but it properly takes any widget now.