Baseflow / Baseflow/flutter_cached_network_image

Provide a child parameter in progressIndicatorBuilder

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

Description

What if I only want to display the placeholder when the image is loaded from the network, and display it if the image is already cached? It seems like you should provide a child parameter, just like the loadingBuilder parameter for the Image widget.
```dart
Image.network(
'https://flutter.github.io/assets-for-api-docs/assets/widgets/falcon.jpg',
loadingBuilder: (BuildContext context, Widget child,
ImageChunkEvent? loadingProgress) {
if (loadingProgress == null) {
return child;
}
return Center(
child: CircularProgressIndicator(
value: loadingProgress.expectedTotalBytes != null
? loadingProgress.cumulativeBytesLoaded /
loadingProgress.expectedTotalBytes!
: null,
),
);
},
```

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.