simple static method

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

Implementation

static Widget simple({
  required String imageUrl,
  GlobalKey? key,
  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(
    key: key,
    children: _getImages(
      image,
      borderRadius,
      borderWidth,
      borderColor,
      width,
      height,
    ),
  );
}