Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter dismissible background

Tags:

flutter

I have a stateful widget who's root widget is a Dismissible. When I pull down on the screen the dismissible reveals the background, which is black. What I would like to see is the previous screen peeking out from behind. I did come up with a hack that sort of works. I stashed the previous stateful widget in a global variable, and set it as the background of the dismissible. This is not a great solution and there are a number of issues that it causes, like some screen blinking. Is there an official way to make this work?

like image 414
user1686620 Avatar asked Nov 16 '22 23:11

user1686620


1 Answers

Try push a PageRouteBuilder rathe than a MaterialPageRoute.

Navigator.push(context, PageRouteBuilder(opaque: false, pageBuilder: (_, __, ___) => DismissableScreen()));

enter image description here

like image 177
Callum Avatar answered Jun 25 '23 10:06

Callum