showNetImageWhClip static method
Implementation
static Widget showNetImageWhClip(
{String? url,
String? asset,
double width = 200,
double height = 100,
double circular = 8,
BoxFit fit = BoxFit.contain}) {
if (url != null) {
return CachedNetworkImage(
width: width,
height: height,
// imageUrl: "${HttpService.urlBase}$url?${DateTime.now().millisecondsSinceEpoch}",
imageUrl: url,
imageBuilder: (context, imageProvider) => Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(circular),
image: DecorationImage(
image: imageProvider,
fit: fit,
colorFilter: const ColorFilter.mode(
Colors.transparent, BlendMode.colorBurn)),
),
),
placeholder: (context, url) => Center(
child: Container(
height: height,
width: width,
margin: const EdgeInsets.all(5),
child: SkeletonBox(
width: width,
height: height,
isCircle: true,
raduis: width*2,
baseColor: Colors.grey.withOpacity(0.034),
highlightColor:Colors.grey.withOpacity(0.033) ,
),
),
),
errorWidget: (context, url, error) => Container(
alignment: Alignment.center,
width: width,
height: height,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(circular),
image: DecorationImage(image: const AssetImage("assets/img/img_avatar.png"), fit: fit)),
),
);
} else {
return Container(
alignment: Alignment.center,
width: width,
height: height,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(circular),
image: DecorationImage(image: AssetImage(asset!), fit: fit)),
);
}
}