import 'dart:core'; import 'package:dio/dio.dart'; import 'package:funkblubber/funkentity.dart'; import 'package:funkblubber/console.dart' as console; Future download({required final FunkObject object}) async { switch (object.kind) { case FunkEntity.album: await _downloadAlbum(object); return; default: return; } } Future _downloadAlbum(final FunkObject object) async { final response = await Dio().get( 'https://${object.domain}/api/v1/tracks/?' 'album=${object.id}&ordering=creation_date&' 'page=1&page_size=16&scope=all', ); for (final songResponse in response.data['results']) {} }