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

Use the following steps to update the createAlbum()
function to return a Future<Album>:

Convert the response body into a JSON Map with the
dart:convert package.

If the server returns a CREATED response with a status
code of 201, then convert the JSON Map into an Album
using the fromJson() factory method.