diff --git a/lib/utils/customer.dart b/lib/utils/customer.dart index 995c13c..0f85f99 100644 --- a/lib/utils/customer.dart +++ b/lib/utils/customer.dart @@ -96,16 +96,29 @@ class CustomerImagesNetworking extends StatelessWidget { @override Widget build(BuildContext context) { + String? sizeParams = ''; + int tempHeight = 300; + int tempWidth = 300; + if (height != null) { + sizeParams = '?x-oss-process=image/resize,h_$tempHeight,w_$tempHeight'; + } + if (width != null) { + tempWidth = width!.toInt() <= 300 ? 300 : width!.toInt(); + sizeParams = '?x-oss-process=image/resize,h_$tempWidth,w_$tempWidth'; + } + if (height != null && width != null) { + tempHeight = height!.toInt() <= 300 ? 300 : height!.toInt(); + sizeParams = '?x-oss-process=image/resize,h_$tempHeight,w_$tempWidth'; + } return CachedNetworkImage( - imageUrl: imageUrl, + imageUrl: imageUrl + sizeParams, width: width, height: height, fit: fit, errorWidget: (_, object, s) { - return Container( + return SizedBox( width: width, height: height, - padding: EdgeInsets.all((width ?? 0) / 2), child: Center( child: Image.asset( 'assets/images/noContainer.png',