Browse Source

Merge remote-tracking branch 'origin/new_revision_app' into new_revision_app

# Conflicts:
#	lib/mine/mine_page.dart
zyh
fmk 3 years ago
parent
commit
97399ce718
  1. 6
      lib/home/home_view/discount_zone.dart
  2. 14
      lib/home/home_view/home_recommend_goods.dart
  3. 26
      lib/home/home_view/shortcut_operation.dart
  4. 12
      lib/home/home_view/top_selling_list.dart
  5. 26
      lib/home/home_view/union_entry.dart
  6. 6
      lib/home/points_mall_view/points_goods_view.dart
  7. 7
      lib/integral_store/integral_store_details_page.dart
  8. 30
      lib/mine/mine_view/mine_calendar.dart
  9. 9
      lib/order/exchange_order_page.dart
  10. 47
      lib/order/order_history_page.dart
  11. 6
      lib/retrofit/data/order_product_vo.dart
  12. 26
      lib/retrofit/data/placeOrderFirst.dart
  13. 6
      lib/retrofit/min_api.dart
  14. 6
      lib/retrofit/min_api.g.dart
  15. 21
      lib/settlement/settlement.dart
  16. 5
      lib/store/store_view/store_order_list.dart
  17. 7
      lib/view_widget/activity_poster.dart
  18. 5
      lib/view_widget/custom_image.dart

6
lib/home/home_view/discount_zone.dart

@ -102,7 +102,7 @@ class _DiscountZone extends State<DiscountZone> {
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 14.sp,
height: 1.5,
height: 1.5.h,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFFFFA607),
),
@ -206,7 +206,7 @@ class _DiscountZone extends State<DiscountZone> {
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
padding: EdgeInsets.only(bottom:10,top: 7,left: 12),
padding: EdgeInsets.only(bottom:10.h,top: 7.h,left: 12.w),
child: Text(
S.of(context).duihuanquan,
style: TextStyle(
@ -232,7 +232,7 @@ class _DiscountZone extends State<DiscountZone> {
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
padding: EdgeInsets.only(bottom:10,top: 7,left: 12),
padding: EdgeInsets.only(bottom:10.h,top: 7.h,left: 12.w),
child: Text(
S.of(context).duihuanquan,
style: TextStyle(

14
lib/home/home_view/home_recommend_goods.dart

@ -86,14 +86,14 @@ class _HomeRecommendGoods extends State<HomeRecommendGoods> {
children: [
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4),
borderRadius: BorderRadius.circular(4.r),
),
child: MImage(
commodityZone?.productImg ?? "",
fit: BoxFit.contain,
radius: BorderRadius.circular(4),
width: 158,
height: 158,
radius: BorderRadius.circular(4.r),
width: 158.w,
height: 158.h,
errorSrc: "assets/image/default_2_1.webp",
fadeSrc: "assets/image/default_2_1.webp",
),
@ -116,7 +116,7 @@ class _HomeRecommendGoods extends State<HomeRecommendGoods> {
SizedBox(
height: 4.h,
),
Row(
Expanded(child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
@ -128,7 +128,7 @@ class _HomeRecommendGoods extends State<HomeRecommendGoods> {
color: Color(0xFFF85400),
),
),
SizedBox(width: 5,),
SizedBox(width: 5.w,),
Text(
"¥${AppUtils.calculateDouble(double.tryParse(commodityZone?.price) ?? 0)}",
style: TextStyle(
@ -139,7 +139,7 @@ class _HomeRecommendGoods extends State<HomeRecommendGoods> {
),
),
],
),
)),
],
),
);

26
lib/home/home_view/shortcut_operation.dart

@ -30,7 +30,7 @@ class _ShortcutOperation extends State<ShortcutOperation> {
return Container(
height: 80.h,
width: double.infinity,
margin: EdgeInsets.only(bottom:15,left: 10,right: 10),
margin: EdgeInsets.only(bottom:15.h,left: 10.w,right: 10.w),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
@ -85,8 +85,8 @@ class _ShortcutOperation extends State<ShortcutOperation> {
SizedBox(width: 3.w),
Expanded(child: Image.asset(
"assets/image/home_lm.webp",
width:36,
height:36,
width:36.w,
height:36.h,
),),
],
),
@ -98,7 +98,7 @@ class _ShortcutOperation extends State<ShortcutOperation> {
},
child: Container(
width: double.infinity,
margin: EdgeInsets.symmetric(horizontal:5),
margin: EdgeInsets.symmetric(horizontal:5.w),
padding: EdgeInsets.all(10.h),
decoration: BoxDecoration(
color: Colors.white,
@ -110,7 +110,7 @@ class _ShortcutOperation extends State<ShortcutOperation> {
spreadRadius: 0,
)
],
borderRadius: BorderRadius.circular(4),
borderRadius: BorderRadius.circular(4.r),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
@ -128,7 +128,7 @@ class _ShortcutOperation extends State<ShortcutOperation> {
color: Color(0xFF0D0D0D),
),
),
SizedBox(height: 5),
SizedBox(height: 5.h),
Text(
"充值福利多",
style: TextStyle(
@ -142,8 +142,8 @@ class _ShortcutOperation extends State<ShortcutOperation> {
SizedBox(width: 3.w),
Expanded(child: Image.asset(
"assets/image/home_recharge.webp",
width:36,
height:36,
width:36.w,
height:36.h,
),),
],
),
@ -156,7 +156,7 @@ class _ShortcutOperation extends State<ShortcutOperation> {
},
child:Container(
width: double.infinity,
margin: EdgeInsets.symmetric(horizontal:5),
margin: EdgeInsets.symmetric(horizontal:5.w),
padding: EdgeInsets.all(10.h),
decoration: BoxDecoration(
color: Colors.white,
@ -168,7 +168,7 @@ class _ShortcutOperation extends State<ShortcutOperation> {
spreadRadius: 0,
)
],
borderRadius: BorderRadius.circular(4),
borderRadius: BorderRadius.circular(4.r),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
@ -186,7 +186,7 @@ class _ShortcutOperation extends State<ShortcutOperation> {
color: Color(0xFF0D0D0D),
),
),
SizedBox(height: 5),
SizedBox(height: 5.h),
Text(
"天天得福利",
style: TextStyle(
@ -200,8 +200,8 @@ class _ShortcutOperation extends State<ShortcutOperation> {
SizedBox(width: 3.w),
Expanded(child: Image.asset(
"assets/image/home_welfare.webp",
width:36,
height:36,
width:36.w,
height:36.h,
),),
],
),

12
lib/home/home_view/top_selling_list.dart

@ -88,7 +88,7 @@ class _TopSellingList extends State<TopSellingList> {
return Container(
width: 290.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4),
borderRadius: BorderRadius.circular(4.r),
color: Color(0xB3FFFFFF),
),
margin: EdgeInsets.only(right:8.w,top: 12.h),
@ -147,15 +147,15 @@ class _TopSellingList extends State<TopSellingList> {
goodList.productImg ?? "",
fit: BoxFit.cover,
radius: BorderRadius.circular(4),
width: 54,
height: 54,
width: 54.w,
height: 54.h,
errorSrc: "assets/image/default_2_1.webp",
fadeSrc: "assets/image/default_2_1.webp",
),
Image.asset(
index == 0 ? "assets/image/ranking1.webp" :(index == 1 ? "assets/image/ranking2.webp": "assets/image/ranking3.webp"),
width: 25,
height: 25,
width: 25.w,
height: 25.h,
fit: BoxFit.cover,
),
],
@ -189,7 +189,7 @@ class _TopSellingList extends State<TopSellingList> {
color: Color(0xFF0D0D0D),
),
),
SizedBox(width: 5,),
SizedBox(width: 5.w,),
Text(
"¥${AppUtils.calculateDouble(double.tryParse(goodList?.applyPrice) ?? 0)}",
style: TextStyle(

26
lib/home/home_view/union_entry.dart

@ -30,7 +30,7 @@ class _UnionEntry extends State<UnionEntry> {
return Container(
height: 130.h,
width: double.infinity,
margin: EdgeInsets.only(bottom:10,left: 10,right: 10,top: 14.h),
margin: EdgeInsets.only(bottom:10.h,left: 10.w,right: 10.w,top: 14.h),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
@ -41,7 +41,7 @@ class _UnionEntry extends State<UnionEntry> {
},
child: Container(
width: double.infinity,
margin: EdgeInsets.symmetric(horizontal:5),
margin: EdgeInsets.symmetric(horizontal:5.w),
padding: EdgeInsets.symmetric(vertical:12.h),
decoration: BoxDecoration(
color: Colors.white,
@ -53,7 +53,7 @@ class _UnionEntry extends State<UnionEntry> {
spreadRadius: 0,
)
],
borderRadius: BorderRadius.circular(6),
borderRadius: BorderRadius.circular(6.r),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
@ -62,8 +62,8 @@ class _UnionEntry extends State<UnionEntry> {
Image.asset(
"assets/image/home_chi.webp",
fit: BoxFit.cover,
width: 60,
height: 60,
width: 60.w,
height: 60.h,
),
SizedBox(height:4.h),
Text(
@ -84,7 +84,7 @@ class _UnionEntry extends State<UnionEntry> {
},
child: Container(
width: double.infinity,
margin: EdgeInsets.symmetric(horizontal:5),
margin: EdgeInsets.symmetric(horizontal:5.w),
// padding: EdgeInsets.symmetric(vertical:12.h),
decoration: BoxDecoration(
color: Colors.white,
@ -96,7 +96,7 @@ class _UnionEntry extends State<UnionEntry> {
spreadRadius: 0,
)
],
borderRadius: BorderRadius.circular(6),
borderRadius: BorderRadius.circular(6.r),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
@ -105,8 +105,8 @@ class _UnionEntry extends State<UnionEntry> {
Image.asset(
"assets/image/home_he.webp",
fit: BoxFit.cover,
width: 60,
height: 60,
width: 60.w,
height: 60.h,
),
SizedBox(height:4.h),
Text(
@ -127,7 +127,7 @@ class _UnionEntry extends State<UnionEntry> {
},
child: Container(
width: double.infinity,
margin: EdgeInsets.symmetric(horizontal:5),
margin: EdgeInsets.symmetric(horizontal:5.w),
padding: EdgeInsets.symmetric(vertical:12.h),
decoration: BoxDecoration(
color: Colors.white,
@ -139,7 +139,7 @@ class _UnionEntry extends State<UnionEntry> {
spreadRadius: 0,
)
],
borderRadius: BorderRadius.circular(6),
borderRadius: BorderRadius.circular(6.r),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
@ -148,8 +148,8 @@ class _UnionEntry extends State<UnionEntry> {
Image.asset(
"assets/image/home_wan.webp",
fit: BoxFit.cover,
width: 60,
height: 60,
width: 60.w,
height: 60.h,
),
SizedBox(height:4.h),
Text(

6
lib/home/points_mall_view/points_goods_view.dart

@ -111,7 +111,7 @@ class _PointGoods extends State<PointGoods> {
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
Expanded(child: Text(
goods.name,
overflow: TextOverflow.ellipsis,
maxLines: 2,
@ -120,8 +120,8 @@ class _PointGoods extends State<PointGoods> {
fontWeight: MyFontWeight.medium,
fontSize: 15.sp,
),
),
SizedBox(height: 5,),
)),
SizedBox(height: 5.h,),
Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,

7
lib/integral_store/integral_store_details_page.dart

@ -247,11 +247,6 @@ class _IntegralStoreDetailsPage extends State<IntegralStoreDetailsPage> {
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
// goods?.onePrice == null || goods?.onePrice == "0"?
// ((goods?.price == null || goods?.price == "0"?"":S.of(context).jifen_(goods?.price)) +
// (goods?.money == null|| goods?.money == "0.00" ?"":" + ${goods.money}"))==""?
// (goods?.oneMoney == null || goods?.oneMoney == "0.00"?"":"${goods?.oneMoney}"):""
// :S.of(context).jifen_(goods?.onePrice),
pointPrice(),
style: TextStyle(
fontWeight: MyFontWeight.semi_bold,
@ -264,7 +259,7 @@ class _IntegralStoreDetailsPage extends State<IntegralStoreDetailsPage> {
),
Expanded(
child: Text(
S.of(context).yuan_(goods?.worth ?? goods?.worth ?? ""),
S.of(context).yuan_(AppUtils.calculateDouble(double.tryParse(goods?.worth ?? goods?.worth ?? "") ?? 0)),
style: TextStyle(
color: Color(0xFF585858),
decoration: TextDecoration.lineThrough,

30
lib/mine/mine_view/mine_calendar.dart

@ -46,27 +46,27 @@ class _MineCalendar extends State<MineCalendar> {
child: Row(
children: [
Expanded(child: Text(
"我的5月足迹日历",
"我的${DateTime.now().month}月足迹日历",
style: TextStyle(
color: Color(0xFF0D0D0D),
fontWeight: MyFontWeight.semi_bold,
fontSize: 15.sp,
),
),),
Text(
"查看绿叶",
style: TextStyle(
color: Color(0xFF000000),
fontWeight: MyFontWeight.regular,
fontSize: 15.sp,
),
),
Icon(
Icons.navigate_next,
size: 24,
color: Colors.black,
),
SizedBox(width:12,),
// Text(
// "查看绿叶",
// style: TextStyle(
// color: Color(0xFF000000),
// fontWeight: MyFontWeight.regular,
// fontSize: 15.sp,
// ),
// ),
// Icon(
// Icons.navigate_next,
// size: 24,
// color: Colors.black,
// ),
// SizedBox(width:12,),
],
),
),

9
lib/order/exchange_order_page.dart

@ -10,6 +10,7 @@ import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/user_info.dart';
import 'package:huixiang/retrofit/data/wx_pay.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/flutter_utils.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/custom_image.dart';
import 'package:huixiang/view_widget/my_appbar.dart';
@ -616,12 +617,12 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> {
: ((widget.arguments["price"] == null ||
widget.arguments["price"] == "0"
? ""
: "${(double.parse(widget.arguments["onePrice"]) * buyNum).toInt()}积分") +
: "${(double.parse(widget.arguments["price"]) * buyNum).toInt()}积分") +
(widget.arguments["money"] == null ||
widget.arguments["money"] ==
"0.00"
? ""
: " + ${double.parse(widget.arguments["money"]) * buyNum}")),
: " + ${AppUtils.calculateDouble(double.tryParse(widget.arguments["money"]) * buyNum) ?? 0}")),
style: TextStyle(
fontSize: 12,
decoration: (widget.arguments["payType"] == 3)
@ -1015,9 +1016,9 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> {
(widget.arguments["money"] == null ||
widget.arguments["money"] == "0.00"
? ""
: " + ${double.parse(widget.arguments["money"]) * buyNum}");
: " + ${AppUtils.calculateDouble(double.tryParse(widget.arguments["money"]) * buyNum) ?? 0}");
}else if(widget.arguments["payType"] == 3){
return "${double.parse(widget.arguments["oneMoney"]) * buyNum}";
return "${AppUtils.calculateDouble(double.tryParse(widget.arguments["oneMoney"]) * buyNum) ?? 0}";
}
}

47
lib/order/order_history_page.dart

@ -560,6 +560,24 @@ class _OrderHistoryList extends State<OrderHistoryList>
});
}
queryDetails(id) async {
if (apiService == null) {
SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(
Dio(),
context: context,
token: value.getString("token"),
showLoading: true
);
}
BaseData<OrderInfo> baseData = await apiService
.orderDetail(id)
.catchError((error) {});
if (baseData != null && baseData.isSuccess) {
return baseData.data;
}
}
paySelected(OrderInfo orderInfo, MinApiService minService) async {
var payChannel = await showModalBottomSheet(
context: context,
@ -568,30 +586,23 @@ class _OrderHistoryList extends State<OrderHistoryList>
return OrderPaySelected();
},
);
// if (payChannel != null && payChannel > 0) {
// OrderUtils.carryOnPay(
// payChannel,
// minService,
// orderInfo,
// (BaseData baseData) {
// SmartDialog.showToast(baseData?.msg == "ok" ?"订单支付成功" :baseData?.msg,alignment: Alignment.center);
// Future.delayed(Duration(seconds: 3), () {
// _onRefresh();
// });
// },
// );
// }
if (payChannel != null && payChannel > 0) {
OrderUtils.carryOnPay(payChannel, minService, orderInfo, payResult);
}
}
payResult(BaseData baseData) {
orderInfo = await queryDetails(orderInfo.id);
OrderUtils.carryOnPay(
payChannel,
minService,
orderInfo,
(BaseData baseData) {
SmartDialog.showToast(baseData?.msg == "ok" ?"订单支付成功" :baseData?.msg,alignment: Alignment.center);
Future.delayed(Duration(seconds: 3), () {
_onRefresh();
});
},
);
}
}
payResult(BaseData baseData) {}
orderCancel(String orderId) async {
BaseData baseData =

6
lib/retrofit/data/order_product_vo.dart

@ -10,9 +10,9 @@ class OrderProductVOList {
String id,
String productId,
String productName,
String returnCode,
String returnStatus,
String returnType,
dynamic returnCode,
dynamic returnStatus,
dynamic returnType,
String sellPrice,
String skuId,
String skuImg,

26
lib/retrofit/data/placeOrderFirst.dart

@ -5,25 +5,25 @@ import 'package:huixiang/retrofit/data/shoppingCart.dart';
class PlaceOrderFirst {
int cartNum;
String cartSum;
String addressId;
dynamic cartSum;
dynamic addressId;
bool isSubscribe;
num isTakeOut;
String notes;
String id;
String numberOfPeople;
num orderSource;
String orderType;
num orderTypeId;
String parentCode;
String parentId;
num payChannel;
int isTakeOut;
dynamic notes;
dynamic id;
dynamic numberOfPeople;
int orderSource;
dynamic orderType;
int orderTypeId;
dynamic parentCode;
dynamic parentId;
int payChannel;
PromotionInfoDTOBean promotionInfoDTO;
String recMobile;
List<OrderProductVOList> orderProductVOList;
List<OrderProductVOList> shoppingCartSkuItemList;
List<dynamic> skuItemDTOList;
num source;
int source;
String storeId;
String subcribeTime;
String tableId;

6
lib/retrofit/min_api.dart

@ -65,8 +65,8 @@ abstract class MinApiService {
}
headers["Environment"] = "app";
dio.options = BaseOptions(
connectTimeout: 15000,
receiveTimeout: 15000,
connectTimeout: 18000,
receiveTimeout: 18000,
headers: headers,
responseType: ResponseType.json,
);
@ -191,7 +191,7 @@ abstract class MinApiService {
///
@POST("order/addOrder")
Future<BaseData<DownOrder>> addOrder(@Body() Map<String, dynamic> param);
Future<BaseData<dynamic>> addOrder(@Body() Map<String, dynamic> param);
///
@POST("order/settlement")

6
lib/retrofit/min_api.g.dart

@ -292,7 +292,7 @@ class _MinApiService implements MinApiService {
}
@override
Future<BaseData<DownOrder>> addOrder(param) async {
Future<BaseData<dynamic>> addOrder(param) async {
ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
@ -306,9 +306,9 @@ class _MinApiService implements MinApiService {
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<DownOrder>.fromJson(
final value = BaseData<dynamic>.fromJson(
_result.data,
(json) => json??""==""?null:DownOrder.fromJson(json),
(json) => json,
);
return value;
}

21
lib/settlement/settlement.dart

@ -78,6 +78,7 @@ class _Settlement extends State<Settlement> {
String productSkuId;
int count1 = 0;
String productId;
bool orderButton = false;
@override
void initState() {
@ -437,6 +438,7 @@ class _Settlement extends State<Settlement> {
.catchError((error) {
print("error: $error");
});
// orderButton =false;
if (baseData != null && baseData.isSuccess) {
placeOrder = true;
this.downOrder = DownOrder.fromJson(baseData.data);
@ -446,7 +448,7 @@ class _Settlement extends State<Settlement> {
}
} else {
///
BaseData<DownOrder> baseData;
BaseData<dynamic> baseData;
if (placeOrder) {
//
querySettlement();
@ -467,9 +469,10 @@ class _Settlement extends State<Settlement> {
});
}
}
orderButton =false;
if (baseData != null && baseData.isSuccess) {
placeOrder = true;
this.downOrder = baseData.data;
this.downOrder = DownOrder.fromJson(baseData.data);
queryOrderDetails(
(parentId == null || parentId == "") ? baseData.data.id : parentId);
setState(() {});
@ -482,7 +485,7 @@ class _Settlement extends State<Settlement> {
///
querySettlement() async {
placeOrderFirst.id = parentId != "" ? parentId : downOrder.id;
placeOrderFirst.orderProductVOList = downOrder == null
placeOrderFirst.orderProductVOList = (downOrder == null)
? minOrderInfo.orderProductVOList
: downOrder.orderProductVOList;
if (placeOrderFirst.payChannel == 1) {
@ -499,6 +502,7 @@ class _Settlement extends State<Settlement> {
.catchError((error) {
print(error);
});
orderButton =false;
if (baseData != null && baseData.isSuccess) {
WxPay wxPay = baseData.data;
await registerWxApi(
@ -522,8 +526,9 @@ class _Settlement extends State<Settlement> {
.catchError((error) {
print(error);
});
orderButton =false;
if (baseData != null && baseData.isSuccess) {
SmartDialog.showToast(baseData?.msg == "ok" ? "订单支付成功":"", alignment: Alignment.center);
SmartDialog.showToast(baseData.data, alignment: Alignment.center);
toOrderDetails(placeOrderFirst.id);
} else {
SmartDialog.show(
@ -531,7 +536,7 @@ class _Settlement extends State<Settlement> {
() {
toOrderDetails(placeOrderFirst.id);
},
text: "${baseData.msg}",
text: "${baseData?.msg}",
));
}
}
@ -780,6 +785,12 @@ class _Settlement extends State<Settlement> {
vertical: 5.h,
),
callback: () {
if(orderButton){
SmartDialog.showToast("订单正在提交中...",alignment: Alignment.center);
return;
}
else
orderButton = true;
pageType != null
? bargainOrderId != null
? activityPay()

5
lib/store/store_view/store_order_list.dart

@ -129,6 +129,11 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {
if (widget.storeInfo.posType.code ==
"NORMALSTORE" &&
widget.storeInfo.storeName == "百年川椒(光谷店)"||widget.storeInfo.storeName == "百年川椒(汉街店)")
return;
else
goShopDetailsPage(position);
},
child: goodsItem(position),

7
lib/view_widget/activity_poster.dart

@ -24,7 +24,6 @@ class _ActivityPoster extends State<ActivityPoster> {
Widget build(BuildContext context) {
return Container(
width: double.infinity,
height: 332.h,
alignment: Alignment.center,
margin: EdgeInsets.only(
left:27.w,
@ -45,9 +44,9 @@ class _ActivityPoster extends State<ActivityPoster> {
),
child:MImage(
widget?.activityPos?.showImage ?? "",
width: double.infinity,
height: MediaQuery.of(context).size.height / 2,
fit: BoxFit.fill,
aspectRatio: 0.75,
fit: BoxFit.cover,
noCompress: true,
radius: BorderRadius.all(Radius.circular(12)),
errorSrc: "assets/image/default_1.webp",
fadeSrc: "assets/image/default_1.webp",

5
lib/view_widget/custom_image.dart

@ -14,6 +14,7 @@ class MImage extends StatelessWidget {
double height;
final BoxFit fit;
final bool isCircle;
final bool noCompress;//
double scaleIndex = 2.5;
@ -26,6 +27,7 @@ class MImage extends StatelessWidget {
this.height,
this.fit,
this.isCircle = false,
this.noCompress = false,
this.radius = BorderRadius.zero,
});
@ -52,6 +54,9 @@ class MImage extends StatelessWidget {
MediaQuery.of(context).size.height:constraints.constrainHeight()) * scaleIndex).toInt();
///
if ((src??"").startsWith("http")) {
if(!noCompress)
imageUrl = src;
else
imageUrl = "$src?imageView2/1/w/${_w}/h/${_h}/format/jpg/q/75";
}

Loading…
Cancel
Save