Dart Tutorial

Flutter Chapter 8 of 16

Async UI and Networking

Show data that arrives later: FutureBuilder, StreamBuilder, HTTP requests, JSON models, loading and error states, and pagination.

Most apps display data from a server. This chapter covers fetching it, turning it into Dart objects, and showing loading, error and empty states properly. It builds on the Dart lessons about async and await and JSON.

Lessons in this chapter

  1. FutureBuilder in FlutterLearn FutureBuilder in Flutter: build UI from a Future, handle loading, error and data states, and avoid restarting the future on rebuild.
  2. StreamBuilder in FlutterLearn StreamBuilder in Flutter: rebuild UI for every stream event, handle connection states, and use it for timers, sockets and live data.
  3. HTTP Requests in Flutter: Fetching Data from an APIFetch and send data in Flutter with the http package: GET and POST requests, status codes, headers, timeouts and displaying results.
  4. JSON and Model Classes in FlutterTurn JSON into typed Dart model classes in Flutter: fromJson, toJson, nested objects, null handling, and code generation tools.
  5. Loading, Error and Empty States in FlutterDesign robust data screens in Flutter: model loading, error, empty and data states, add retry and pull to refresh, and show skeletons.
  6. Pagination and Infinite Scroll in FlutterLoad long lists page by page in Flutter: infinite scroll with ListView.builder, loading indicators, end detection and error handling.