cachedImgUrlWithPlaceholder static method

Widget cachedImgUrlWithPlaceholder({
  1. required String url,
  2. Widget? placeholder,
  3. Widget? errorWidget,
  4. BoxFit? fit,
})

Implementation

static Widget cachedImgUrlWithPlaceholder({
  required String url,
  Widget? placeholder,
  Widget? errorWidget,
  BoxFit? fit,
}) {
  return CachedNetworkImage(
    imageUrl: url,
    fit: fit,
    placeholder: (context, url) =>
        placeholder ??
        Container(
          width: 270,
          height: 90,
          color: Colors.white,
        ),
    errorWidget: (context, url, error) => errorWidget ?? const Icon(Icons.error),
  );
}