I am trying to use Dismissible
in a Container
with BorderRadius
but the onDismissed
Animation don't work properly, because the back ground don't have the same shape.
I have tried this:
Stack(
overflow: Overflow.clip,
children: <Widget>[
MyBackgroundWidget(), // instead of background
Dismissible(
child: MyForegroundWidget(),
// no background
)
],
);
Key — Each Dismissible widget should contain a Key to uniquely identify widgets. Background — The background of an item is set to red while performing dismissal action. This is called 'Leave Behind' indicator in Flutter.
In flutter, it is simple to create an easy rectangle and sq. form using container widget however they need sharp edges and therefore the corner is sharp however using the BoxDecoration property of box decoration we are able to simply and make the perimeters rounded. Container( decoration: BoxDecoration( border: Border.
A widget that can be dismissed by dragging in the indicated direction. Dragging or flinging this widget in the DismissDirection causes the child to slide out of view.
Try wrapping the dismissible widget under ClipRRect and add border radius to only CLipRRect and not the child widgets. That should fix your problem.
This question has already been discussed in: How to fix this dismissible widget border
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With