loadImageWidthSize method
Implementation
Widget loadImageWidthSize(String url, double width, double height,
{Map<String, String>? header,
Color backgroundColor = Colors.black,
TextStyle? textStyle}) {
return CachedNetworkImage(
imageUrl: url,
httpHeaders: header ?? {"Content-Type": "application/json"},
imageBuilder: (context, imageProvider) => SizedBox(
child: Container(
decoration: BoxDecoration(
image:
DecorationImage(image: imageProvider, fit: BoxFit.cover),
),
),
width: width,
height: height,
),
placeholder: (context, url) => loadDefaultImage(width, height,
ext: "Loading",
backgroundColor: backgroundColor,
textStyle: textStyle),
errorWidget: (context, url, error) => loadDefaultImage(width, height,
backgroundColor: backgroundColor, textStyle: textStyle));
}