imageloader static method
Implementation
static imageloader(String src) {
if (src.contains('http')) {
return CachedNetworkImage(
imageUrl: src,
fit: BoxFit.fill,
progressIndicatorBuilder: (context, url, downloadProgress) =>
CircularProgressIndicator(value: downloadProgress.progress),
errorWidget: (context, url, error) => const Icon(Icons.error),
);
} else {
return Image.asset(
src,
fit: BoxFit.fill,
);
}
}