-1

I am using WillPopScope and to navigate I am using Navigator.pushNamed(), so that onWillPop is not working fine, if I remove pushNamed and add pushAndRemoveUntil and make route false it works. But, I do not need like that I need to use pushNamed. How can I achieve this.

Riadh Adrani
  • 486
  • 2
  • 5
  • 16

1 Answers1

0

Try the below code :

onWillPop: () async {
        Navigator.pushNamed();
        return false;
      },
Rahul Variya
  • 1,257
  • 1
  • 6
  • 15