I have some optimizations recommended by flutterflow and one of them made me think about bad and good practices. Here is the case of use I want to know your opinion.
Case of use
I created a Header Page component that I'm using in every page of my project. In the header, I have to show the amount of savings that the user has and a filter, both are consuming 2 different api calls. In the "Optimizations and Enhancement" tips of FF, it shows that case as "Unused Backend Query", probably because its in the component. So here is my question:
Is it a bad practice to have api calls inside the components? Or is it better to make the api call inside the page (or direct in the component applied on the page)?
If its a bad practice and its recommended to call the api on the component in each page, how can I handle 2 different api calls in a component (if there is only 1 backend query option per component)?