QueryClient created twice during hot reloads and restarts.
I've noticed that when setting up the library according to the tutorial here https://fl-query.krtirtho.dev/docs/getting-started/overview
the MyApp build functions runs twice after hot reload & restart, which creates two QueryClients, which leads to two query clients being existing in the app. The queries are still saved in the old query client, whereas useQueryClient retrieves the new one. On rebuild of the widgets, the queries get saved correctly to the new client.
My solution was to create the client in the main() function and then pass it to MyApp and QueryClientProvider as parameter.
@PetrKubes97 could you possibly provide an example cause I'm struggling with the same problem.
Edit: Nevermind I looked through the API docs and found the solution.
Solution: https://pub.dev/documentation/fl_query/latest/fl_query/QueryClient-class.html