I am building an app, where I have the following scenario:
Homepage -> Chatpage -> Profilepage
The “->” indicates routing in form of push for example like this:
navigatorKey.currentState?.push(
MaterialPageRoute(
builder: (context) => ScreenPartyInfo(partyId: partyId),
),
);
On my Homepage I am watching a provider:
final partyListData = ref.watch(partyListStateProvider);
If routed to my Profilepage and modify that provider the Homepage, which is not visible at this point, gets updated. How can I prevent this behaviour?
I want it to refresh on changes if it is open and visible. Routing also must be like this, because i need the go back function.
The partyListStateProvider is a normal StateNotifierProvider.