Baseflow / Baseflow/flutter_cached_network_image

While cached image is loading, CachedNetworkImage has no size

Open
#328 7 comments 3 reactions 0 assignees View on GitHub
type: bug
Dominant language
Dart
Stars
2.6k
Forks
731
Avg merge
3d 9h
Merged PRs (30d)
1

Description

I switched from FadeInImage.assetNetwork() to CachedNetworkImage in a ListView and everything appears to be working well. Except I noticed that after the image has been cached, the next time I launched my app to redisplay the list, all of the list tiles started out very short even though I was specifying a height (of 200.0). Once the image is loaded, the list tile is sized as specified.

As a work around, I enclosed the CachedNetworkImage in a Container and now the list is working as desired again:

```
child: Container(
width: double.infinity,
height: 200.0,
child: CachedNetworkImage(
placeholder: (context, url) => Image.asset('assets/placeholder.jpg'),
imageUrl: movie.getBackDropUrl(),
fit: BoxFit.cover,
width: double.infinity,
height: 200.0,
fadeInDuration: Duration(milliseconds: 50),
),
),
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.