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

Add an option for a static crop #58

Open
mshenawy22 opened this issue Nov 17, 2020 · 1 comment · May be fixed by #95
Open

Add an option for a static crop #58

mshenawy22 opened this issue Nov 17, 2020 · 1 comment · May be fixed by #95

Comments

@mshenawy22
Copy link

mshenawy22 commented Nov 17, 2020

First Thank you for the great work.
Can you please add an option to make the crop size static , just like with facebook profile picture , the user can only drag and move his picture inside a defined area but they can't change the size of the crop of this defined area.

Thanks and keep it up.

@mshenawy22
Copy link
Author

I figured out a way to do it , but still will be nice if this feature is implemented natively in the package

use a stack and put inside it a container with a thick border that basically overrides the grid , this way the image will only move and there's no way to move the grid or change its size because its overriden by a container
Here's the code

```

Stack(

  children: <Widget>[


  Container(
    constraints: BoxConstraints.expand(
      height:300 ,
      width: 300,
    ),
    child :
    Crop.file(_sample, key: cropKey,
      scale : 2.0,
      aspectRatio:2,
      maximumScale : 2.0,
      alwaysShowGrid : false,
    ),
 ),
    Container(
      margin: EdgeInsets.symmetric(vertical: 70.0),
      decoration: BoxDecoration(
          border: Border.all(color: Colors.blueAccent, width: 12),
        //
      ),
      constraints: BoxConstraints.expand(
        height:170 ,
        width: 300,
      ),


    ),

)

@LeGoffMael LeGoffMael linked a pull request Dec 19, 2022 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant