0
In my flutter app I want to display images, and these images will be grouped by categories/albums. These images are brought in the form of an array, in this format:
This is my current function to bring these images
class ImagensApiProvider {
Future<List<Imagens>> imagens() async {
final response = await Dio().get(
ApplicationConsts.BASE_API_URI + 'images/' + '3/' + '20',
);
if (response.statusCode == 200) {
final parsed = response.data.cast<Map<String, dynamic>>();
return parsed.map<Imagens>((json) => Imagens.fromJson(json)).toList();
} else {
throw Exception('Falha ao carregar Imagens');
}
}
}
'/3' and '20' are respectively the user id and the album id (this I resolve later).
The fact is that I came across the following mistake:
And in Sponse.data I get the following:
How do I fix it?
From now on, I appreciate any help!
If my answer has helped you or even solved your problem, please mark it as accepted, of course, if you are not expecting other answers.
– Matheus Ribeiro