Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter- drag down to dismiss

Tags:

I'd like to dismiss page with drag down like this. But I don't know whether use gesture or draggable either way I have no idea how to show previous page as you drag down. Anyone know how to do?

.

Edit

I ended it up like this.
I'm not sure if this is the best way but at least it works fine for me.
Hope it helps someone:)

return Dismissible(   key: Key('some key here'),   direction: DismissDirection.down,   onDismissed: (_) => Navigator.pop(context),   child: Scaffold(     body: Center(       child: Image.network(         'URL',         fit:BoxFit.cover       ),     ),   ), ); 
like image 723
Daibaku Avatar asked Aug 19 '18 00:08

Daibaku


1 Answers

A simple example of drag up/down to dismiss a page using Dismissible:

Dismissible(     direction: DismissDirection.vertical,     key: const Key('key'),     onDismissed: (_) => Navigator.of(context).pop(),     child: ... ) 
like image 173
Andrey Gordeev Avatar answered Sep 30 '22 23:09

Andrey Gordeev