simple static method

Widget simple({
  1. required String imageUrl,
  2. double? width = double.infinity,
  3. double? height,
  4. BoxFit fit = BoxFit.cover,
  5. Widget? placeholder,
  6. Widget? errorWidget,
  7. BorderRadius? borderRadius,
  8. double? borderWidth,
  9. Color borderColor = Colors.white,
})

Implementation

static Widget simple({
  required String imageUrl,
  double? width = double.infinity,
  double? height,
  BoxFit fit = BoxFit.cover,
  Widget? placeholder,
  Widget? errorWidget,
  BorderRadius? borderRadius,
  double? borderWidth,
  Color borderColor = Colors.white,
}) {
  var image = CachedNetworkImage(
    width: width,
    height: height,
    fit: fit,
    imageUrl: imageUrl,
    placeholder: (context, url) =>
        placeholder ?? const Icon(Icons.downloading),
    errorWidget: (context, url, error) =>
        errorWidget ?? const Icon(Icons.error),
  );

  return Stack(
    children: _getImages(
      image,
      borderRadius,
      borderWidth,
      borderColor,
      width,
      height,
    ),
  );
}