4. Fetch the data

Call the fetchAlbum() method in either the
initState() or didChangeDependencies()
methods.

The initState() method is called exactly once and then never again.
If you want to have the option of reloading the API in response to an
InheritedWidget changing, put the call into the
didChangeDependencies() method.
See State for more details.

This Future is used in the next step.

5. Display the data

To display the data on screen, use the
FutureBuilder widget.
The FutureBuilder widget comes with Flutter and
makes it easy to work with asynchronous data sources.

You must provide two parameters:

The Future you want to work with.
In this case, the future returned from
the fetchAlbum() function.

A builder function that tells Flutter
what to render, depending on the
state of the Future: loading, success, or error.