Closed affansk closed 1 year ago
@affansk
First of all, declare a QueryContorller
.
late final QueryController controller;
@override
void initState() {
...
controller = QueryController();
}
@override
void dispose() {
controller.dispose();
...
}
Then, assign the QueryController
to a QueryBuilder
QueryBuilder(
controller: controller,
...
)
Now you can call the refetch
method on the QueryController
from anywhere. The staleness will be checked before actually executing the fetcher
. If the data is not stale, the refetch
will have no effect.
controller.refetch();
Query invalidation was implemented but I forgot to add it again after refactoring. I promise this feature will be included in the next version.
I'm currently working on the documentation. The documentation will be available with a full website not just on the README.md. Sorry for the current lack of documentation.
how invalidate the cache, refetch again ? do you have proper CRUD Example ?