My API call:
Future<List<SongData>> _getMetadata() async {
Uri url = Uri.parse('https://radioactivefm.gr/live/api/getCoverJson.php');
final response = await http.get(url);
var data = jsonDecode(response.body);
print('data: $data');
return SongData.fromJson(data);
}
I can't declare this way, showing A value of type 'SongData' can't be returned from the method '_getMetadata' because it has a return type of 'Future<List>