|
@@ -58,120 +58,123 @@ class HomeServiceCard extends StatelessWidget {
|
|
|
int card_likes_count = itemEntity.likesCount?? 0;
|
|
|
|
|
|
final company_name = itemEntity.merchant?.name?? "";
|
|
|
- return Column(
|
|
|
- children: [
|
|
|
- // 图片
|
|
|
- Row(
|
|
|
- mainAxisAlignment: MainAxisAlignment.center,
|
|
|
- crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
- children: [
|
|
|
- Expanded(
|
|
|
- child: ClipRRect(
|
|
|
- borderRadius: const BorderRadius.only(topLeft: Radius.circular(8), topRight: Radius.circular(8),),
|
|
|
- child: MyLoadImage(
|
|
|
- card_img,
|
|
|
- width: 172.5,
|
|
|
- height: 80.5.ap,
|
|
|
- isCircle: false,
|
|
|
- fit: BoxFit.cover,
|
|
|
- ),
|
|
|
- ),
|
|
|
- ),
|
|
|
- ],
|
|
|
- ),
|
|
|
- // 标题
|
|
|
- Padding(
|
|
|
- padding: const EdgeInsets.only(left: 10, right: 10, top: 10,),
|
|
|
- child: Row(
|
|
|
+ return Container(
|
|
|
+ height: cardHeight,
|
|
|
+ child: Column(
|
|
|
+ children: [
|
|
|
+ // 图片
|
|
|
+ Row(
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
children: [
|
|
|
Expanded(
|
|
|
- child: SizedBox(
|
|
|
- height: 30.ap,
|
|
|
- child: MyTextView(
|
|
|
- card_name,
|
|
|
- maxLines: 2,
|
|
|
- isTextEllipsis: true,
|
|
|
- textAlign: TextAlign.left,
|
|
|
- textColor: context.appColors.textBlack,
|
|
|
- fontSize: 15,
|
|
|
- isFontRegular: true,
|
|
|
+ child: ClipRRect(
|
|
|
+ borderRadius: const BorderRadius.only(topLeft: Radius.circular(8), topRight: Radius.circular(8),),
|
|
|
+ child: MyLoadImage(
|
|
|
+ card_img,
|
|
|
+ width: 172.5,
|
|
|
+ height: 80.5.ap,
|
|
|
+ isCircle: false,
|
|
|
+ fit: BoxFit.cover,
|
|
|
),
|
|
|
),
|
|
|
),
|
|
|
],
|
|
|
),
|
|
|
- ),
|
|
|
- // 价格 及 收藏
|
|
|
- Padding(
|
|
|
- padding: const EdgeInsets.only(left: 10, right: 10,top: 0, bottom: 0),
|
|
|
- child: Row(
|
|
|
- mainAxisAlignment: MainAxisAlignment.spaceAround,
|
|
|
- crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
- children: [
|
|
|
- Expanded(
|
|
|
- child: Row(
|
|
|
- mainAxisAlignment: MainAxisAlignment.start,
|
|
|
- crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
- children: [
|
|
|
- MyTextView(
|
|
|
- 'from',
|
|
|
- maxLines: 1,
|
|
|
+ // 标题
|
|
|
+ Padding(
|
|
|
+ padding: const EdgeInsets.only(left: 10, right: 10, top: 10,),
|
|
|
+ child: Row(
|
|
|
+ mainAxisAlignment: MainAxisAlignment.center,
|
|
|
+ children: [
|
|
|
+ Expanded(
|
|
|
+ child: SizedBox(
|
|
|
+ height: 40.ap,
|
|
|
+ child: MyTextView(
|
|
|
+ card_name,
|
|
|
+ maxLines: 2,
|
|
|
isTextEllipsis: true,
|
|
|
- textAlign: TextAlign.start,
|
|
|
- textColor: ColorUtils.string2Color('#666666'),
|
|
|
- fontSize: 11,
|
|
|
- isFontMedium: true,
|
|
|
- ),
|
|
|
- MyTextView(
|
|
|
- '\$$card_price',
|
|
|
- maxLines: 1,
|
|
|
- isTextEllipsis: true,
|
|
|
- textAlign: TextAlign.start,
|
|
|
- textColor: ColorUtils.string2Color('#4161D0'),
|
|
|
+ textAlign: TextAlign.left,
|
|
|
+ textColor: context.appColors.textBlack,
|
|
|
fontSize: 15,
|
|
|
- isFontMedium: true,
|
|
|
- marginLeft: 2,
|
|
|
+ isFontRegular: true,
|
|
|
),
|
|
|
- // MyTextView(
|
|
|
- // '$',
|
|
|
- // maxLines: 1,
|
|
|
- // isTextEllipsis: true,
|
|
|
- // textAlign: TextAlign.start,
|
|
|
- // textColor: ColorUtils.string2Color('#666666'),
|
|
|
- // fontSize: 11,
|
|
|
- // isFontMedium: true,
|
|
|
- // ),
|
|
|
- ],
|
|
|
+ ),
|
|
|
),
|
|
|
- ),
|
|
|
- // 动态的 收藏数
|
|
|
- CollectionWidget(
|
|
|
- collectionNum: card_likes_count,
|
|
|
- isCollection: card_liked,
|
|
|
- onClickColleciotn: onClickColleciotn,
|
|
|
- ),
|
|
|
- ],
|
|
|
+ ],
|
|
|
+ ),
|
|
|
),
|
|
|
- ),
|
|
|
- // 公司名称
|
|
|
- Expanded(
|
|
|
- child: Padding(
|
|
|
- padding: const EdgeInsets.only(bottom: 5),
|
|
|
- child: MyTextView(
|
|
|
- company_name,
|
|
|
- maxLines: 1,
|
|
|
- isTextEllipsis: true,
|
|
|
- textAlign: TextAlign.start,
|
|
|
- marginLeft: 13,
|
|
|
- fontSize: 11,
|
|
|
- textColor: ColorUtils.string2Color('#666666'),
|
|
|
- alignment: Alignment.centerLeft,
|
|
|
- isFontRegular: true,
|
|
|
+ // 价格 及 收藏
|
|
|
+ Padding(
|
|
|
+ padding: const EdgeInsets.only(left: 10, right: 10,top: 0, bottom: 0),
|
|
|
+ child: Row(
|
|
|
+ mainAxisAlignment: MainAxisAlignment.spaceAround,
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
+ children: [
|
|
|
+ Expanded(
|
|
|
+ child: Row(
|
|
|
+ mainAxisAlignment: MainAxisAlignment.start,
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
+ children: [
|
|
|
+ MyTextView(
|
|
|
+ 'from',
|
|
|
+ maxLines: 1,
|
|
|
+ isTextEllipsis: true,
|
|
|
+ textAlign: TextAlign.start,
|
|
|
+ textColor: ColorUtils.string2Color('#666666'),
|
|
|
+ fontSize: 11,
|
|
|
+ isFontMedium: true,
|
|
|
+ ),
|
|
|
+ MyTextView(
|
|
|
+ '\$$card_price',
|
|
|
+ maxLines: 1,
|
|
|
+ isTextEllipsis: true,
|
|
|
+ textAlign: TextAlign.start,
|
|
|
+ textColor: ColorUtils.string2Color('#4161D0'),
|
|
|
+ fontSize: 15,
|
|
|
+ isFontMedium: true,
|
|
|
+ marginLeft: 2,
|
|
|
+ ),
|
|
|
+ // MyTextView(
|
|
|
+ // '$',
|
|
|
+ // maxLines: 1,
|
|
|
+ // isTextEllipsis: true,
|
|
|
+ // textAlign: TextAlign.start,
|
|
|
+ // textColor: ColorUtils.string2Color('#666666'),
|
|
|
+ // fontSize: 11,
|
|
|
+ // isFontMedium: true,
|
|
|
+ // ),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ // 动态的 收藏数
|
|
|
+ CollectionWidget(
|
|
|
+ collectionNum: card_likes_count,
|
|
|
+ isCollection: card_liked,
|
|
|
+ onClickColleciotn: onClickColleciotn,
|
|
|
+ ),
|
|
|
+ ],
|
|
|
),
|
|
|
),
|
|
|
- )
|
|
|
- ],
|
|
|
+ // 公司名称
|
|
|
+ Expanded(
|
|
|
+ child: Padding(
|
|
|
+ padding: const EdgeInsets.only(bottom: 0),
|
|
|
+ child: MyTextView(
|
|
|
+ company_name,
|
|
|
+ maxLines: 1,
|
|
|
+ isTextEllipsis: true,
|
|
|
+ textAlign: TextAlign.start,
|
|
|
+ marginLeft: 13,
|
|
|
+ fontSize: 11,
|
|
|
+ textColor: ColorUtils.string2Color('#666666'),
|
|
|
+ alignment: Alignment.centerLeft,
|
|
|
+ isFontRegular: true,
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ )
|
|
|
+ ],
|
|
|
+ ),
|
|
|
);
|
|
|
}
|
|
|
}
|