loadImageDynamic function
Load dynamic image or url or svg
Implementation
Widget loadImageDynamic(String imageUrl, {BoxFit fit = BoxFit.cover, double? width, double? height, Widget? placeHolder, Widget? errorWidget}){
return NUIFutureWidget<String?>(
futureValue: imageUrlContentType(imageUrl),
callback: (state, data, message){
if(data!= null && data.contains("svg")){
return SizedBox(width: width, height: height, child: SvgPicture.network(imageUrl));
}
return loadImage(
imageUrl,
width: width,
height: height,
fit: fit,
);
},
);
}