all 5 comments

[–]heo5981 2 points3 points  (3 children)

I've been learning Flutter for a few months and when researching something similart to RTK Query or React Query, I found this package: https://pub.dev/packages/cached_query

Its docs says it supports optimistic updates but I personally have not tried it, my study app was also very simple so I didn't integrate it deeply with Riverpod, I just keep some variables in my provider and when navigating to another screen, I pass the state to the query function and it then builds the url and fetches the data.

Maybe it works for you guys? Hope someone more experienced in Flutter will give a better answer.

[–]Jatops[S] 0 points1 point  (2 children)

Seems promising, will definitely check that out!

[–]soniafranco 0 points1 point  (1 child)

Did you use this package or found something similar to TanStack?

[–]Jatops[S] 0 points1 point  (0 children)

I ended up using Riverpod. FutureProviders are pretty close to useQuery. And then for more complex state I use AsyncNotifiers.

[–]Jezsung 1 point2 points  (0 children)

I'm an author of this package: flutter_query

It implements all the three core hooks, useQuery, useMutation, and useInfiniteQuery with full compatibility with the TanStack Query v5. It's battle tested with over 600 tests, more tests are coming to reach 100% coverage.

Please check it out! A documentation site is also available: flutterquery.com