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

Custom corners - option to hide corners #48

Open
hedi-ghodhbane opened this issue Mar 26, 2024 · 2 comments
Open

Custom corners - option to hide corners #48

hedi-ghodhbane opened this issue Mar 26, 2024 · 2 comments

Comments

@hedi-ghodhbane
Copy link
Contributor

I find that this package is great, but it's missing some basic features like:

  • Building Custom corners, we can pass a callBack to build a custom corner instead of showing the default one. So it would be great if this package was headless.
  • Option to hide corners, i need this when i have a loading state ( for example edget detection algorithm ). I want to hide corners, then show them when loading is finished. This also can be achieved if we have the option to build custom corners
@deakjahn
Copy link
Owner

deakjahn commented Apr 21, 2024

@hedi-ghodhbane The corners are already disappearing based on some logic (if the resizing is disabled by setting the minimum and the maximum sizes to the same value). You probably would like to override this behavior then?

See:

final double maxWidth =
constraints.maxWidth - 2 * widget.paddingSize;
final double maxHeight =
constraints.maxHeight - 2 * widget.paddingSize;
final double width = _getWidth(maxWidth, maxHeight);
final double height = _getHeight(maxWidth, maxHeight);
size = Size(width, height);
final bool showCorners =
widget.minimumImageSize != widget.maximumImageSize;

deakjahn added a commit that referenced this issue Apr 21, 2024
@deakjahn
Copy link
Owner

This part was straightforward but the other suggestion should be discussed. There are several ways to solve that, the simpler one being just a callback with the canvas passed, the more complicated (and probably not really necessary) one would be to accept a replacement CustomPainter.

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