Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crop view doesnt let me crop at the edges with certain aspect ratio #65

Closed
Mayb3Nots opened this issue May 30, 2021 · 2 comments
Closed

Comments

@Mayb3Nots
Copy link

Mayb3Nots commented May 30, 2021

I cant seem to get the plugin to work.
Here is my code

class CustomImageEditor extends StatefulWidget {
  final File data;

  CustomImageEditor({
    Key? key,
    required this.data,
  }) : super(key: key);

  @override
  _CustomImageEditorState createState() => _CustomImageEditorState();
}

class _CustomImageEditorState extends State<CustomImageEditor> {
  
  late CropController _controller;

  @override
  void initState() {
    _controller = CropController(aspectRatio: 1);

    super.initState();
  }

  @override
  void dispose() {
    _controller.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Crop(
      onChanged: (decomposition) {},
      controller: _controller,
      child: Image.file(
        widget.data,
        fit: BoxFit.cover,
      ),
      helper: IgnorePointer(
        child: DecoratedBox(
          decoration: BoxDecoration(border: Border.all(color: Colors.white)),
        ),
      ),
    );
  }
}

This is wrapped in an aspect ratio of 1 under a column.

Here is the video to show the issue

@Mayb3Nots Mayb3Nots changed the title Crop view doesnt let me to crop some part Crop view doesnt let me crop some part May 30, 2021
@Mayb3Nots Mayb3Nots changed the title Crop view doesnt let me crop some part Crop view doesnt let me crop at the edges with certain aspect ratio May 30, 2021
@Mayb3Nots
Copy link
Author

Mayb3Nots commented May 30, 2021

Here is another example from the example app. You can see I am trying to crop on the corners of the image. But for certain aspect ratio it just doesn't let me
Video

It seems that it only happens for certain ratio like 1:1

@xclud
Copy link
Owner

xclud commented May 30, 2021

@Mayb3Nots This is a dup of #27. I close this issue. Please feel free to open a new issue.

@xclud xclud closed this as completed May 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants