The Complete Flutter Course: Build Android, iOS and Web Apps
Flutter REST APIs and networking with Dio
Firebase is not the only back end an app talks to: many apps also call APIs that someone else wrote. This guide picks out the networking lessons of The Complete Flutter Course: Build Android, iOS and Web Apps, from what an API is to requests sent with Dio, with the lesson that turns stored data into Dart model classes. It is plain that the responses are read in the console and not yet shown in a screen.
Taught by Sagnik Bhattacharya and Paulina Knop
What you will be able to do
You will be able to:
- Explain what an API is and how a client app and a server exchange requests and responses.
- Name REST, GraphQL, SOAP and gRPC as kinds of API, and read HTTP methods, status codes, JSON and XML.
- Send a GET request with Dio and read the status code, the headers and the data that come back.
- Follow code that creates, replaces, partly updates and deletes data with POST, PUT, PATCH and DELETE.
- Write a model class whose fromJson constructor turns a map of data into a typed Dart object.
Projects
What you will build.
The course has nine projects. These two matter most here.
-
Project 09
REST API app
Requests to JSONPlaceholder, a free practice back end, read for their status code, headers and data.
-
Project 08
Budget app
Its Firestore documents turned into model objects with fromJson, the same step you take with JSON from any API.
Lessons
The lessons that matter, in course order.
The Complete Flutter Course: Build Android, iOS and Web Apps has 223 lessons. This page picks out 7 of them, 2 h 27 min of video. Each lesson keeps its number in the course.
Where to start
Lesson 217 Networking overview
Start at Lesson 217; the networking lessons need no earlier project, only Dart, which the course teaches from Lesson 28. Watch async and await at Lesson 80 first if Futures are new, and come to the model class in Lesson 216 once the budget app is built.
7 of 223 lessons · 2 h 27 min
23 Budget app: performance optimisation and code reuse The model class arrives at the end of the budget app's performance lesson: each Firestore document turned into an object through a fromJson constructor.
- 216 Performance optimisation and code reuse StreamProvider for sign-in, shared widgets and a model class 58 min
24 Flutter Networking: Build Robust Apps with API Integration Networking from the ground up: APIs pictured as a restaurant menu, REST beside GraphQL, SOAP and gRPC, methods, status codes and versioning, a Dio GET request, then POST, PUT, PATCH and DELETE.
- 217 Start here Networking overview Beyond Firebase: APIs to back ends in PHP, Django or Java 23 min
- 218 What is an API? A restaurant-menu analogy, client-server apps and API uses 13 min
- 219 Types of API: REST, GraphQL and gRPC A recap of API basics that names REST, GraphQL, SOAP and gRPC 13 min
- 220 Introduction to REST APIs HTTP methods, status codes, JSON and XML, and versioning 8 min
- 221 A Dio GET request that prints comments JSONPlaceholder data, status code and headers in the console 21 min
- 222 POST, PUT, PATCH and DELETE with Dio A code walk-through: create, replace, update and delete posts 10 min
Instructors
Who teaches it.
Instructor, Flutter
Paulina Knop
Flutter developer and curriculum designer. Teaches the Flutter course.
Questions
Asked before starting.
Where can I learn to call REST APIs from a Flutter app?
The Complete Flutter Course: Build Android, iOS and Web Apps from Coding Liquids has a networking section for it: what an API is and how REST works, then a GET request with the Dio package to a practice back end, read for its status code and headers, and a walk-through of POST, PUT, PATCH and DELETE. This guide picks out 7 lessons (2 hours 27 minutes), with the lesson where data becomes model classes; it does not cover authentication tokens or GraphQL clients.
Does the course use Dio or the http package?
Dio. The http package, published by the Dart team, is a small library for making requests; Dio adds interceptors, global configuration, request cancellation, timeouts and file uploads, which some apps want from the start. Either reaches the same APIs. The Complete Flutter Course: Build Android, iOS and Web Apps teaches Dio only, from Lesson 221, and does not cover the http package.
Will I learn GET, POST, PUT, PATCH and DELETE requests?
All five, at two depths. The Complete Flutter Course: Build Android, iOS and Web Apps has you write and run a GET request with Dio at Lesson 221, then walks through code that creates a post with POST, replaces it with PUT, updates part of it with PATCH and removes it with DELETE at Lesson 222. Those four are shown in code rather than built step by step.
Does it explain status codes, headers and JSON?
Yes. The Complete Flutter Course: Build Android, iOS and Web Apps introduces HTTP methods, status codes such as 200 and 404, the JSON and XML formats and API versioning at Lesson 220, then prints a real response's status code and headers in the console at Lesson 221, using JSONPlaceholder, a free fake back end for practice.
Does the course show API data on screen, or only in the console?
Only in the console. The Complete Flutter Course: Build Android, iOS and Web Apps prints the responses to its Dio requests rather than building a screen from them. The pieces for that screen are taught elsewhere in the course, such as ListView.builder for a list of items, so joining them up makes a good first exercise of your own.
How do I turn JSON into Dart model classes?
With a model class whose fromJson constructor reads each field out of a map, so the rest of the app works with typed objects instead of raw maps. The Complete Flutter Course: Build Android, iOS and Web Apps writes one in the budget app's lesson on performance and code reuse, turning each Firestore document into a model object. It also shows an online generator that writes such a class from sample data; code-generation packages such as json_serializable are not taught.
Are GraphQL and gRPC covered as well as REST?
Only by name. The Complete Flutter Course: Build Android, iOS and Web Apps sets REST beside GraphQL, SOAP and gRPC at Lesson 219, and teaches REST alone in code. Authentication tokens, retries and the http package also fall outside its networking lessons.
Flutter
See the whole course.
The Complete Flutter Course: Build Android, iOS and Web Apps: 25 hours of video in 223 lessons, built around 9 projects, with lifetime access, a Certificate of Completion and a 14-day money-back guarantee.
The same course
For another background, goal, topic or comparison.
By background
By goal
By topic
- Dart
- State management
- Firebase
- Widgets and layouts
- UI design and styling
- Riverpod
- App architecture
- Sign-in and authentication
- Cloud Firestore
- Navigation and routing
- Responsive layouts
- Animations and gestures
- Flutter web
- Set-up on Windows and Mac
- Forms and validation
- Futures and Streams
- CI with GitHub Actions
- Reusable widgets
- Debugging
- Packages from pub.dev
Comparisons
- Flutter or React Native
- Which framework to learn
- Course or free tutorials
- Flutter or native Android
- Flutter or Swift
- Flutter or Kotlin Multiplatform
- Flutter or FlutterFlow
- Learn Flutter or use AI
- Riverpod, BLoC or Provider
- Firebase or Supabase
- Flutter web or React
- Dart or JavaScript
- Flutter or Ionic
- Flutter or .NET MAUI
- VS Code or Android Studio