Baseflow / Baseflow/flutter_cached_network_image
While cached image is loading, CachedNetworkImage has no size
- 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.