getAlbum method
Retrieves detailed information about a specific album.
albumId: The Spotify ID of the album.
Returns an AlbumModel object representing the album's data.
Implementation
Future<AlbumModel?> getAlbum(String albumId) async {
try {
// Make an API request to get album details
final response =
await _dio.get('https://api.spotify.com/v1/albums/$albumId');
return AlbumModel.fromMap(response.data);
} catch (e) {
print('Error fetching album: $e');
return null;
}
}