prepareDisplayedImage method
Implementation
Widget prepareDisplayedImage(String image) => Image.network(
image,
fit: widget.imageFit,
headers: widget.httpHeaders,
errorBuilder: widget.errorBuilder,
loadingBuilder: (context, img, loadingProgress) {
// Download started
if (loading == false) {
loading = true;
widget.onStarted?.call();
}
if (loadingProgress == null) {
// Image is now loaded, trigger the event
loaded = true;
widget.onReady?.call();
return _DisplayImage(
child: img,
duration: widget.duration,
curve: widget.curve,
onCompleted: () => widget.onDisplayed?.call(),
);
} else {
return const SizedBox();
}
},
);