Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0c7fbe5897 | |||
| de127eeef5 | |||
| 01178bc033 | |||
| 724e31ad7d | |||
| e6ea8182e4 | |||
| c585d5ce0d |
@@ -189,6 +189,7 @@ class HttpUtils {
|
||||
}
|
||||
|
||||
if (resultCode.toUpperCase() == "UNLOGIN") {
|
||||
ToastUtils.showToast(msg: map['resultMsg']);
|
||||
unLoginAction?.call();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -133,9 +133,12 @@ class _UploadImagesState extends State<UploadImages> {
|
||||
}) {
|
||||
return GestureDetector(
|
||||
onTap: () => widget.oneTap?.call(index),
|
||||
child: CustomerImagesNetworking(
|
||||
imageUrl: imageUrl,
|
||||
fit: widget.fit ?? BoxFit.cover,
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadiusGeometry.circular(20.r),
|
||||
child: CustomerImagesNetworking(
|
||||
imageUrl: imageUrl,
|
||||
fit: widget.fit ?? BoxFit.cover,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -96,22 +96,21 @@ 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';
|
||||
}
|
||||
String sizeParams = '';
|
||||
if (height != null && width != null) {
|
||||
tempHeight = height!.toInt() <= 300 ? 300 : height!.toInt();
|
||||
sizeParams = '?x-oss-process=image/resize,h_$tempHeight,w_$tempWidth';
|
||||
final h = height!.toInt() <= 1080 ? 1080 : height!.toInt();
|
||||
final w = width!.toInt() <= 1080 ? 1080 : width!.toInt();
|
||||
sizeParams = 'x-oss-process=image/resize,h_$h,w_$w';
|
||||
} else if (width != null) {
|
||||
final w = width!.toInt() <= 1080 ? 1080 : width!.toInt();
|
||||
sizeParams = 'x-oss-process=image/resize,h_$w,w_$w';
|
||||
} else if (height != null) {
|
||||
final h = height!.toInt() <= 1080 ? 1080 : height!.toInt();
|
||||
sizeParams = 'x-oss-process=image/resize,h_$h,w_$h';
|
||||
}
|
||||
final separator = imageUrl.contains('?') ? '&' : '?';
|
||||
return CachedNetworkImage(
|
||||
imageUrl: imageUrl + sizeParams,
|
||||
imageUrl: imageUrl.isEmpty ? imageUrl : '$imageUrl$separator$sizeParams',
|
||||
width: width,
|
||||
height: height,
|
||||
fit: fit,
|
||||
|
||||
Reference in New Issue
Block a user