Does flutter have a method like Activity.resume() which can tell developer the user has gone back to the activity.
When I pick the data from internet in
Since everyone here is talking about app life cycle and not addressing the question which OP is asking. here is the answer to the question.
The requirement is he want to open page B from page A, let say to choose file from page B, and once file selected he want to go back to page A and need to process that selected file in page A. Like in android we can do it in onActivityResult() method. Below is the way we can achieve in flutter.
You can open the page B from page A as below
Map results = await Navigator.of(context).push(MaterialPageRoute(
builder: (BuildContext context) {
return new PageB(title: "Choose File");
},
));
if (results != null && results.containsKey('selection')) {
setState(() {
_selection = results['selection'];
});
**//here you can do whatever you want to do with selection variable.**
}
In Page B you can select the file or what ever things you need to return to page A as below (return file or any other variable after selection.
Navigator.of(context).pop({'selection':file});