You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's more so for current specific needs but might also be useful to others.
The ability to zoom out on an image and have it bounce back in place to fit the specified crop area.
I have tried experimenting with the onMoved, initialArea and the cropController, but it doesn't seem to work.
I think having it as animateArea as an addition to the controller functions would do it.
Could we bake in this feature?
Here's a snippet of what I tried:
Crop(
...
controller: cropController,
initialAreaBuilder: (rect) {
/// Save the initial cropping area
setState(() {
initialCroppingArea = rect;
});
return Rect.fromLTRB(
rect.left,
rect.top,
rect.right,
rect.bottom,
);
},
fixArea: true,
onMoved: (newRect) {
// Check if the newRect is outside the boundaries
if (newRect.left < initialCroppingArea!.left ||
newRect.top < initialCroppingArea!.top ||
newRect.right > initialCroppingArea!.right ||
newRect.bottom > initialCroppingArea!.bottom) {
// Animate back to the initial cropping area
cropController.crop();
// .animateArea(initialCroppingArea!, duration: 500);
// .cropTo(initialCroppingArea);
} else {
// do something with current cropping area.
}
},
...
),
Here's a video of what this looks like (sourced from Instagram).
-4305794482942258531rpreplay_final1692791961.mov
The text was updated successfully, but these errors were encountered:
It's more so for current specific needs but might also be useful to others.
The ability to zoom out on an image and have it bounce back in place to fit the specified crop area.
I have tried experimenting with the
onMoved
,initialArea
and thecropController
, but it doesn't seem to work.I think having it as
animateArea
as an addition to the controller functions would do it.Could we bake in this feature?
Here's a snippet of what I tried:
Here's a video of what this looks like (sourced from Instagram).
-4305794482942258531rpreplay_final1692791961.mov
The text was updated successfully, but these errors were encountered: