hsbijarniya / image_editor_plus

Flutter Image Editor Plugin with simple, easy support for image editing using Paints, Text, Filters, Emoji and Sticker like stories.
MIT License
103 stars 103 forks source link

Possible to disable the landscape mode in the ImageCropper? #79

Open gd08xxx opened 2 months ago

gd08xxx commented 2 months ago

I am trying to force the user to crop the Image to 16:9 with the following code

                    final Uint8List? croppedImage =
                        await Navigator.push<Uint8List?>(
                      context,
                      MaterialPageRoute<Uint8List?>(
                        builder: (_) => ImageCropper(
                          image: _image,
                          availableRatios: const <options.AspectRatio>[
                            options.AspectRatio(title: '16:9', ratio: 16 / 9),
                          ],
                        ),
                      ),
                    );
                    if (croppedImage == null) return;
                    if (!context.mounted) return;
                    final Uint8List? editedImage =
                        await Navigator.push<Uint8List?>(
                      context,
                      MaterialPageRoute<Uint8List?>(
                        builder: (_) => ImageEditor(
                          image: croppedImage,
                          cropOption: null,
                          rotateOption: null,
                        ),
                      ),
                    );
                  },
Screenshot 2024-04-19 at 02 18 16

However the is a landscape button that the user can press to change the image to 9:16 (circled in red). Is there a way to disable it?