YImage2 function

Widget YImage2(
  1. double? width,
  2. double? height,
  3. String url, {
  4. BoxFit fit = BoxFit.contain,
  5. String? imagePlaceHolder,
})

Implementation

Widget YImage2(double? width, double? height, String url, {BoxFit fit = BoxFit.contain, String? imagePlaceHolder}) {
  if (yIsNullOrEmpty(url)) return Image.asset(yIsNullOrEmpty(imagePlaceHolder) ? YConfig.imagePlaceHolder : imagePlaceHolder!, width: width, height: height, fit: fit);
  return FadeInImage.assetNetwork(placeholder: yIsNullOrEmpty(imagePlaceHolder) ? YConfig.imagePlaceHolder : imagePlaceHolder!, image: url, width: width, height: height, fit: fit);
//  return FadeInImage.memoryNetwork(placeholder: kTransparentImage, image: url, width: width, height: height, fit: fit);
}