Browse Source

UI

null_safety
fmk 3 years ago
parent
commit
76db8de048
  1. 6
      lib/view_widget/custom_image.dart

6
lib/view_widget/custom_image.dart

@ -13,6 +13,8 @@ class MImage extends StatelessWidget {
final BoxFit fit;
final bool isCircle;
double scaleIndex = 2.5;
MImage(
this.src, {
this.errorSrc = "assets/image/default_2_1.png",
@ -30,8 +32,8 @@ class MImage extends StatelessWidget {
Widget image = LayoutBuilder(builder: (context, constraints) {
String imageUrl = "";
if (src != null && src != "") {
imageUrl = "$src?imageMogr2/thumbnail/${constraints.constrainWidth() * 2}"
"x${constraints.constrainHeight() * 2}/format/webp/blur/1x0/quality/75";
imageUrl = "$src?imageMogr2/thumbnail/${constraints.constrainWidth() * scaleIndex}"
"x${constraints.constrainHeight() * scaleIndex}/format/webp/blur/1x0/quality/75";
}
print("imageUrl: $imageUrl");
return CachedNetworkImage(

Loading…
Cancel
Save