How can I pass some data back to Navigator when I close the page with iOS swipe back gesture? If I close the page manually, obviously everything works correctly, because when I close it, I call the Navigator.pop() method and pass the data in the arguments. But how do I do this when I go back with swipe gesture?
PS WillPopScope will not help, only relevant for Android.
I don't think there's a way to directly pass the result without using Navigator.pop()
. I can think of two ways for solving the issue:
Navigator.pop(result)
), then you can distinguish these 2 cases by checking if result of Navigator.push()
is not null.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.