9

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.

This is a screen shot of the problem.

I have tried this:

 Stack(
     overflow: Overflow.clip,
     children: <Widget>[
         MyBackgroundWidget(), // instead of background
         Dismissible(
             child: MyForegroundWidget(),
             // no background
         )
     ],
 );

and that works if you don't have padding. But don't work in my case, because i have padding in my container. So it will look like this when onDismissed, before the animation its completely done.

Pingolin
  • 3,161
  • 6
  • 25
  • 40
Andres Diaz
  • 421
  • 1
  • 5
  • 10

2 Answers2

1

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

Rohith Nambiar
  • 2,957
  • 4
  • 17
  • 37
0

you can try to use a container behind the Widget

Container(
    color : Colors.blue,
    child : YourDismissible(),
)
yassine
  • 88
  • 9