diff --git a/lib/view_widget/coupon_widget.dart b/lib/view_widget/coupon_widget.dart index 83a495aa..c4ac2a11 100644 --- a/lib/view_widget/coupon_widget.dart +++ b/lib/view_widget/coupon_widget.dart @@ -3,6 +3,7 @@ import 'dart:math'; import 'package:flutter/material.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/retrofit/data/coupon.dart'; +import 'package:huixiang/view_widget/custom_image.dart'; import 'package:huixiang/view_widget/round_button.dart'; import 'package:huixiang/view_widget/separator.dart'; @@ -70,20 +71,23 @@ class CouponWidget extends StatelessWidget { children: [ Container( margin: EdgeInsets.only(left: 20), - child: Image.network( - (coupon == null || - coupon.couponImg == null || - coupon.couponImg == "") - ? "" - : coupon.couponImg, - width: 60, - height: 60, - fit: BoxFit.cover, - errorBuilder: (context, error, e) { - return Image.asset( - "assets/image/default_1.png"); - }, - ), + child: MImage( + (coupon == null || + coupon.couponImg == null || + coupon.couponImg == "") + ? "" + : coupon.couponImg, + ) + // Image.network( + + // width: 60, + // height: 60, + // fit: BoxFit.cover, + // errorBuilder: (context, error, e) { + // return Image.asset( + // "assets/image/default_1.png"); + // }, + // ), ), Expanded( flex: 1, diff --git a/lib/view_widget/custom_image.dart b/lib/view_widget/custom_image.dart index 0c4319c3..d3e3bf80 100644 --- a/lib/view_widget/custom_image.dart +++ b/lib/view_widget/custom_image.dart @@ -28,7 +28,7 @@ class MImage extends StatelessWidget { var clipRRect = ClipRRect( borderRadius: radius, child: CachedNetworkImage( - imageUrl: src, + imageUrl: "$src?imageMogr2/thumbnail/640x640/format/webp/blur/1x0/quality/75", cacheManager: DefaultCacheManager(), fadeInDuration: Duration(milliseconds: 300), fadeOutDuration: Duration(milliseconds: 300),