-
Notifications
You must be signed in to change notification settings - Fork 296
Open
Description
Although it’s convenient, it’s not recommended to put an API call in a build() method.
Flutter calls the build() method every time it wants to change anything in the view, and this happens surprisingly often. If you leave the fetch call in your build() method, you’ll flood the API with unnecessary calls and slow down your app.
Source: https://flutter.dev/docs/cookbook/networking/fetch-data#why-is-fetchpost-called-in-initstate
Metadata
Metadata
Assignees
Labels
No labels