imageNetwork static method

Widget imageNetwork({
  1. required String path,
  2. bool isFitted = true,
  3. double? radius,
})

The isFitted parameter is true by default. If the radius parameter is empty, its value is 15. If you don't want it to happen, change the value to 0.

Implementation

static Widget imageNetwork(
    {required String path, bool isFitted = true, double? radius}) {
  return CachedNetworkImage(
    imageUrl: path,
    fit: isFitted ? BoxFit.cover : BoxFit.contain,
    progressIndicatorBuilder: (context, url, progress) {
      return Container(
        color: context.placeholderColor,
        child: context.indicator(value: progress.progress).center,
      );
    },
    errorWidget: (context, url, error) {
      return Container(
        color: context.placeholderColor,
        child: const Icon(Icons.error).center,
      );
    },
  ).radiusAll(radius);
}