Delete data on the internet

Make authenticated requests

Fetch data from the internet

Cookbook

Networking

Fetch data from the internet

1. Add the http package

2. Make a network request

3. Convert the response into a custom Dart object

Create an Album class
Convert the http.Response to an Album

4. Fetch the data

5. Display the data

Why is fetchAlbum() called in initState()?

Testing

Complete example

Fetching data from the internet is necessary for most apps.
Luckily, Dart and Flutter provide tools, such as the
http package, for this type of work.

This recipe uses the following steps:

Add the http package.

Make a network request using the http package.