The http.Response class contains the data received from a successful
http call.

The updateAlbum() method takes an argument, title,
which is sent to the server to update the Album.

3. Convert the http.Response to a custom Dart object

While it’s easy to make a network request,
working with a raw Future<http.Response>
isn’t very convenient. To make your life easier,
convert the http.Response into a Dart object.

Create an Album class

First, create an Album class that contains the data from the
network request. It includes a factory constructor that
creates an Album from JSON.

Converting JSON by hand is only one option.
For more information, see the full article on
JSON and serialization.

Convert the http.Response to an Album

Now, use the following steps to update the updateAlbum()
function to return a Future<Album>: