Search code examples
imageflutterdartcropreact-image-crop

How can the user crop the picture completely freely


I have a question about the image_cropper plugin... I want the user to be able to crop the photo himself and not have to use the preset options (3:2, 4:3, 16:9, ...), but I find no instructions how this works. I've seen it work on the internet, but I don't know how.

These are the possibilities that you can use up to now, but I want the user to be able to decide completely freely:

 aspectRatioPresets: [
        CropAspectRatioPreset.square,
        CropAspectRatioPreset.ratio3x2,
        CropAspectRatioPreset.original,
        CropAspectRatioPreset.ratio4x3,
        CropAspectRatioPreset.ratio16x9
      ],

Does anyone know how it works?


Solution

  • Replace the the androidUiSettings with:

    androidUiSettings: AndroidUiSettings(
              toolbarColor: Colors.yellow,
              toolbarTitle: 'Bild zuschneiden',
              initAspectRatio: CropAspectRatioPreset.original,
              lockAspectRatio: false),