Qqq
Qqq

Reputation: 179

Swipe back in flutter. without any button

How Can I swipe for back in Flutter? not tap back button. Without any button...... Just swipe from left to right. And go to the back page enter image description here

Upvotes: 0

Views: 1743

Answers (1)

Munsif Ali
Munsif Ali

Reputation: 5842

you can wrap your screen widget with gesture detector and on detecting swipe left you can pop the screen like this

GestureDetector(
  onPanUpdate: (details) {
    if (details.delta.dx > 0) {
      Navigator.of(context).pop();
    }
  },
  child: Scaffold(
    body: ///your body
  ),
);

Edit:

The above solution was the one that came to my mind and i got another answer on stack-overflow maybe that one is the correct way to do it here is the answer https://stackoverflow.com/a/55577584/14466860

Upvotes: 2

Related Questions