Solution 1 :
Why don’t you try to use Flutter Route Observer, simply you can check if you pop back to page A then you fetch the updated list of groups.
For more info you can check this link
Route Observer Class
Inside the didPopNext()
method you can write code that will get executed when you pop to this page
Problem :
my question is how to perform the following action in fluttter:
I have page with lists of groups (Page A) then I am pushing to group detail (Page B) and from Page B I am pushing to other screen to edit detail (Page C). What I want to achieve is that when I will pop back to Page A it will contain refreshed list with updated detail of specific group. How can I achieve this ?
WHAT I TRIED:
I know that when I am pushing from page A to page B and popping back from B is performing refresh (I can achieve this with then callback when going from A to B) … but this approach is not working when going from A->B->C and then popping to A.
Comments
Comment posted by Hreso
Hi thanks for tip I will try it. But which widget should implement this observer ? Page A ?
Comment posted by Ahmed Adel
You need to implement it in page A, and inside the didPopNext() method add the code you want to execute when you pop to this page, which will be the code to fetch the updated list of groups