|
|
|
@ -35,14 +35,19 @@ class MImage extends StatelessWidget {
|
|
|
|
|
builder: (context, constraints) { |
|
|
|
|
String imageUrl = ""; |
|
|
|
|
///压缩图片 |
|
|
|
|
if (src != null && src != "" && src.startsWith("http")) { |
|
|
|
|
String oper = src.contains("?") ? "" :"?"; |
|
|
|
|
imageUrl = |
|
|
|
|
"$src$oper/imageMogr2/thumbnail/${constraints.constrainWidth() * scaleIndex}" |
|
|
|
|
"x${constraints.constrainHeight() * scaleIndex}/format/webp/quality/100"; |
|
|
|
|
// if (src != null && src != "" && src.startsWith("http")) { |
|
|
|
|
// String oper = src.contains("?") ? "" :"?"; |
|
|
|
|
// imageUrl = |
|
|
|
|
// "$src$oper/imageMogr2/thumbnail/${constraints.constrainWidth() * scaleIndex}" |
|
|
|
|
// "x${constraints.constrainHeight() * scaleIndex}/format/webp/quality/100"; |
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
///压缩图片 |
|
|
|
|
if (src != "" && src.startsWith("http")) { |
|
|
|
|
imageUrl = "$src?imageView2/1/w/${(constraints.constrainWidth() * scaleIndex).toInt()}/h/${(constraints.constrainHeight() * scaleIndex).toInt()}/format/jpg/q/75"; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// print(imageUrl); |
|
|
|
|
// print("imageUrl:$imageUrl"); |
|
|
|
|
// print("constrainWidth: ${constraints.constrainWidth()}"); |
|
|
|
|
// print("constrainHeight: ${constraints.constrainHeight()}"); |
|
|
|
|
|
|
|
|
|