it's 2021 and still there's no any solid fix that I've found regarding this issue.
So I was able to remove the ClipRect
whenever the child of the Dismissiable widget
is moving by modifying theDismissiable widget
package and add a Listener
to the AnimationController
to check if the child is actually moving . and I'm quit happy with the result.
you can do this by:
First:
open the Dismissable widget
and define a clipBackground
boolean and then right before the line 616 when it say's if (background != null)
you should add this code :
// Adding a Listener
_moveAnimation.addListener(() {
if (_moveController!.isDismissed) {
setState(() {
clipBackground = true;
});
}
if (_moveController!.isCompleted) {
setState(() {
clipBackground = true;
});
}
// if child stop moving
if (_moveController!.value == 0) {
setState(() {
clipBackground = true;
});
}
//If child is moving
if (_moveController!.value != 0) {
setState(() {
clipBackground = false;
});
}
});
Surely you can use the OR operator ||
to make code shorter.
Second:
modify the code where it say's if (background != null)
and add a ternary operator so it will look like this :
if (background != null) {
content = Stack(children: <Widget>[
if (!_moveAnimation.isDismissed)
Positioned.fill(
child: ClipRect(
//If true add a ClipRect to the widget
clipper: clipBackground!
? _DismissibleClipper(
axis: _directionIsXAxis ? Axis.horizontal : Axis.vertical,
moveAnimation: _moveAnimation,
)
: null,
child: background,
),
),
content,
]);
}