APIs, JSON and async UI
Handle requests, validate JSON and represent loading, failure, pagination and success.
This chapter covers apis, json and async ui through specific problems and worked examples. Read the lesson descriptions before choosing a starting point. Complete runnable examples are labelled; project configuration and code fragments explain where they belong.
Your lessons
One clear step at a time- 01Show loading, data and failure deliberatelyUse FutureBuilder with a stable future and make every visible asynchronous state understandable.2 min
- 02Turn JSON into a model at the boundaryValidate decoded JSON and create typed Dart objects before using remote data inside widgets.2 min
- 03Flutter HTTP requests with status and timeout handlingSeparate request execution from JSON parsing, inspect response status and make timeout behavior explicit.2 min
- 04Flutter pagination without duplicate requestsTrack an in-flight request, page cursor and end-of-list state while preserving already loaded items after a later failure.2 min