Provide an http.Client to the function. This allows providing the
correct http.Client depending on the situation.
For Flutter and server-side projects, provide an http.IOClient.
For Browser apps, provide an http.BrowserClient.
For tests, provide a mock http.Client.

Use the provided client to fetch data from the internet,
rather than the static http.get() method, which is difficult to mock.

The function should now look like this:

In your app code, you can provide an http.Client to the fetchAlbum method 
directly with fetchAlbum(http.Client()). http.Client() creates a default
http.Client.

3. Create a test file with a mock http.Client

Next, create a test file.

Following the advice in the Introduction to unit testing recipe,
create a file called fetch_album_test.dart in the root test folder.