i have a method _func() in HomeScreen.
i have a button in HomeScreen that navigate the user to ViewScreen from HomeScreen like this
Navigator.push(
context,
CupertinoModalPopupRoute(
builder: (context) => ViewScreen(
listItem: item,
icon: icon,
),
),
);
from that ViewScreen there is another button that navigates to AddEditScreen from ViewScreen like this
Navigator.of(context).pushReplacement(
CupertinoPageRoute(
builder: (context) => AddEditScreen(
item: item,
),
),
);
when i pop back from AddEditScreen i will be navigate back to HomeScreen.
and when that happens i want the _func() method in HomeScreen to run.
how can i do that?
2
Answers
In your homescreen do this:
In you Viewscreen do this:
In your AddEditScreen do this:
Check out this sample example :