withoutCache method

Widget withoutCache(
  1. BuildContext context,
  2. String defaultImage
)

Implementation

Widget withoutCache(BuildContext context, String defaultImage) {
  if (imageUrl == null) return _defaultImage(context);

  return Image.network(
    imageUrl ?? defaultImage,
    key: ValueKey(imageUrl),
    width: width,
    height: height ?? width,
    fit: boxFit,
    errorBuilder: (context, error, stackTrace) => Container(
      decoration: BoxDecoration(
        color: context.color.background(BackgroundColorType.errorPrimary),
        borderRadius: borderRadius ?? BorderRadius.circular(radius),
      ),
      width: width,
      height: height ?? width,
      child: Center(
        child: OneIcons.get(
          AlertsFeedbackIcon.alertCircle,
          color: context.color.foreground(ForegroundColorType.errorPrimary),
        ),
      ),
    ),
    loadingBuilder: (context, child, loadingProgress) {
      if (loadingProgress == null) return child;
      return SizedBox(
        width: width,
        height: height ?? width,
        child: const Center(
          child: CircularProgressIndicator(),
        ),
      );
    },
  );
}