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 ), ), ), );
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: ... )
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