We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 987d866 commit d478152Copy full SHA for d478152
1 file changed
lib/views/image/image_favorites_page.dart
@@ -38,7 +38,18 @@ class _ImageFavoritesPageState extends State<ImageFavoritesPage> {
38
@override
39
void initState() {
40
super.initState();
41
- _imageFuture = fetchFavorites();
+ _imageFuture = fetchFavorites().then((response) {
42
+ if (response.hasData) {
43
+ setState(() {
44
+ final int? total = response.data!['total_count'];
45
+ if (total != null) {
46
+ _nbImages = total;
47
+ }
48
+ _imageList = response.data!['images'].cast<ImageModel>() ?? [];
49
+ });
50
51
+ return response;
52
53
}
54
55
0 commit comments