I have a DetailPage that must return something to the code that called it. The documentation Return data from a screen explains that you must call Navigator.pop(context, whateverYouMustReturn)
on some button.
So far so good, but what happens if the user clicks on the back button on the AppBar
instead?? How do I return something then??
PS I'm using Navigator 1.0, btw
Provide your own leading widget and override the callback.
AppBar(
leading: BackButton(
onPressed: () {
Navigator.of(context).pop(myData);
},
),
),