I have an interface with two buttons that pop and return true or false, like so:
onPressed: () => Navigator.pop(context, false)
I need t
The simplest way to achieve this is to :
In your body take a WillPopScope as the parent widget And on its onWillPop : () {} call
WillPopScope
onWillPop : () {}
Navigator.pop(context, false);
onWillPop of WillPopScope will be triggered automatically when you’ll press the back button on your AppBar
onWillPop