Course Curriculum (length: 2h40m)
- RESTful APIs: The Basics (3:24)
- The nCoV 2019 Coronavirus API: Setup instructions, API Keys and Access Tokens (7:37)
- nCoV 2019 API Status Updates
- REST Client for VS Code: Initial setup & sending requests (6:06)
- REST Client: Using Environment Variables and excluding sensitive data with .gitignore (5:02)
- REST Client: Adding the remaining requests (4:41)
- UPDATE: Using the alternative nCoV Admin API (6:36)
- App Architecture Overview (2:48)
- Installing the http package (1:14)
- Saving the API key + GitHub source code + the Error Lens extension (2:37)
- The API class (3:38)
- The APIService class: requesting an access token (4:04)
- Parsing the http response and retrieving the access token (2:47)
- Using the API Service to show the access token (3:14)
- Adding the remaining endpoints to the API class (2:44)
- UPDATE: Changes needed to support the nCoV 2019 Admin API
- Requesting and parsing data from the remaining endpoints (5:31)
- Using the APIService class to show endpoint data (3:51)
- Recap on the APIService class (2:19)
- The Data Repository (2:44)
- Loading and refreshing the access token when needed (2:50)
- Adding a Provider for the DataRepository (2:58)
- Creating a basic dashboard UI (3:47)
- Creating a custom card widget to show endpoint data (4:01)
- Loading the initial endpoint data from the API (2:28)
- Adding a refresh indicator (2:25)
- Showing when the data was last updated: client vs server approach (1:10)
- Parsing date information from the API response data (1:59)
- Creating a new data model to hold the date and value from the API (3:19)
- Showing the last updated date in the UI (2:30)
- Formatting dates with the "intl" package (5:08)
- Add thousands' separators with the NumberFormat class (2:14)
- Error handling overview, and understanding the call stack (6:17)
- Showing an alert dialog to the user (5:21)
- Completing the error handling code (3:19)
- Introduction to data persistence with Shared Preferences (1:46)
- Writing a DataCacheService (8:32)
- Integrating the DataCacheService in the DataRepository (3:14)
- Injecting the DataCacheService in main.dart (4:15)
- Hot fix: The getter 'date' was called on null (5:08)
- Conclusion & next steps (1:49)
Welcome to this crash course, where you will learn how to use REST APIs with Dart and Flutter.
I created this course because REST APIs are used everywhere in today's web. And if you master the basics of the Dart http library, you can write Flutter apps that can tap into thousands of web APIs.
In this crash course you will build a simple but completely functional Coronavirus tracker application in Flutter.
Included in this course
- Short introduction to REST: what it is and how it works.
- Overview of the nCoV 2019 health API. This is used to fetch global data about the Coronavirus outbreak.
- Api keys & access tokens: what they are and how to use them.
- REST Client: a VSCode extension that you can use to send HTTP requests and view the response directly in VS Code.
- Design a REST API service using the Dart http package.
- Make requests and parse the JSON response data into strongly-typed model classes.
- Build a dashboard UI with nice-looking cards that show the data from the API.
- Combine multiple API requests into a single response by using futures.
- Use a RefreshIndicator to get updated data from the API.
- Error handling, and how to show alert dialogs to the user.
- Data caching with Shared Preferences, so that the data is saved on device for offline use.
Most importantly, you will learn about good app architecture as a way to structure our code and keep it modular.
This course is all about mastering the basics. It covers many important topics, with attention to detail, and emphasis on how to write a production-ready app.
By the end of this course, you will be able to build Flutter apps that connect with any other REST API that you want to use.
Frequently Asked Questions
Is this a complete Flutter course?
No. This is a crash course showing you how to use REST APIs with Dart & Flutter.
You will build a simple yet complete application, and become familiar with REST and the Dart http package.
With this knowledge, you can build Flutter apps with many other REST APIs.
Who is this course for?
This beginner to intermediate-level course is all about mastering the basics.
While we will only build a single page application, you will get all the knowledge you need to work with REST APIs in Dart, and use them to build slick-looking UIs in Flutter.
What are the prerequisites?
- Familiarity with the Dart Language (see my YouTube playlist for an introduction).
- Basic knowledge of Flutter, including stateless and stateful widgets.
- VSCode or Android Studio installed and configured for Flutter development.
Is the course updated to the latest Flutter & Dart packages?
Yes, I will update the course if there are any breaking changes.
Does this course include support?
Yes, this course offers premium support. I aim to answer all questions within 24 hours.
Is the source code included?
Yes, the full source code is available for free at this page on GitHub.
Can I get a student discount?
I'm happy to offer a 40% discount to students. Send me an email at [email protected] showing that you are a student, and I'll give you a discount code.
I have to pay VAT and that makes it too expensive.
VAT is added to the final price if you live in the EU. If that's the case, I can offer a 20% discount on the course price. Email me at [email protected] to get a discounted coupon.
This course is not valuable for me and I want a refund.
You can get 100% money back guarantee within 30 days. No questions asked. I only want happy students and I'm happy to give a full refund.
Hi, I’m Andrea.
I have extensive experience in mobile app development, having built complex apps for various clients and as an independent developer.
My courses are clear, concise, and based on real-world examples. Just like my code. Watch my videos for a first-hand experience.
They include a lot of practical advice and tips that will make you more productive, and a better software developer.
Life is short. Your time matters. I want to help you make the most of it, and enjoy your journey.