Skip to content
Articles
Article

Your Flutter Screen Fetches on Every Build. It Should Fetch Once.

by Sohail Khan dev.to

5 min read

Your Flutter screen fetches on every build. It should fetch once. A screen I reviewed called the API inside build. Every rebuild fired the request again, so a keyboard opening, a theme change, or any setState on the screen sent the same call to the server. The list flickered, the loading spinner came back, and the server saw traffic the user never asked for. What actually happened The screen show…

Forum

Questions about this, or something to add?

Discuss on the forum

Report this · Wrote this? Claim it

FlutterX is supported by