You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have implemented a global app-wide RefreshIndicator, which should refresh all data, that is fetched from the server by Operaton widgets (auth data and mutations are fetched / executed manually, so they shouldn't be affected).
My solution was to handle the refresh by clearing the Ferry cache (which is a HiveStore) and then rebuilding all children of the global app layout widget.
But, whenever I activate this callback, the active view goes into an endless loading state. If I navigate to a different view and then back, the view reloads as expected.
This is what the RefreshIndicator looks like:
Consumer<GraphqlProvider>(
builder: (context, provider, child) =>RefreshIndicator(
onRefresh: () async {
provider.client.cache.clear();
_rebuildAllChildren(context);
},
// Pull from top to show refresh indicator.
child:this.child,
),
),
Yes, if you clear the cache, you'll need to manually execute the requests to populate it again.
Rebuilding all widgets does nothing here, as a mere rebuild keeps the state. If you really want to go with a solution like this, you will have to throw away the state of all stateful widgets, e.g. like this (though I would recommend a more granular approach, like keeping track of all currently watched graphql queries, and -re-executing them)
I have implemented a global app-wide RefreshIndicator, which should refresh all data, that is fetched from the server by Operaton widgets (auth data and mutations are fetched / executed manually, so they shouldn't be affected).
My solution was to handle the refresh by clearing the Ferry cache (which is a HiveStore) and then rebuilding all children of the global app layout widget.
But, whenever I activate this callback, the active view goes into an endless loading state. If I navigate to a different view and then back, the view reloads as expected.
This is what the RefreshIndicator looks like:
And this is the _rebuildAllChildren function:
flutter doctor
output:The text was updated successfully, but these errors were encountered: