cachedImage function
带缓存的image
Implementation
Widget cachedImage(String url, {double? width, double? height}) {
return CachedNetworkImage(
height: height,
width: width,
fit: BoxFit.cover,
placeholder: (
BuildContext context,
String url,
) =>
Container(color: Colors.grey[200]),
errorWidget: (
BuildContext context,
String url,
dynamic error,
) =>
Icon(Icons.error),
imageUrl: url);
}