Speed Application
Hi ,
flutter community member I am trying to increase app speed some complex and icon based design in my flutter application if we calling 4 api’s in initState because its necessary so application taking time using async and await also
we want fast application how it will possible
2
Answers
The speed of API calls depends on several factors,
Optimization Tips
To measure the speed you can do like this:
For parellel API calls use Future.wait
To speed up your app you can follow below steps:
Combine API Requests:
Discuss with your backend developer to merge the APIs into a single request that returns all the required data in one response, or reduce it from 4 to 2 or something like that. For example, if one API fetches homepage details and another fetches user details, pass user-specific parameters in a single request and get everything at once.
Optimize Frontend Loading:
If combining APIs isn’t possible, prioritize loading essential data first. Use shimmer placeholders or similar for sections dependent on secondary APIs. Fetch secondory prioritized data in background using asynchronous updates (e.g., StreamBuilder or FutureBuilder).
Caching:
Cache static or semi-static data to reduce repeated API calls.
UI Optimization:
Simplify widget trees for complex designs and avoid unnecessary rebuilds