|
@@ -63,129 +63,132 @@ class GarageCard extends StatelessWidget {
|
|
String card_publish_name = card_account?['name']?? "";
|
|
String card_publish_name = card_account?['name']?? "";
|
|
bool card_liked = itemObj.getValue("liked", false);
|
|
bool card_liked = itemObj.getValue("liked", false);
|
|
int card_likes_count = itemObj.getValue("likes_count", 0);
|
|
int card_likes_count = itemObj.getValue("likes_count", 0);
|
|
- 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: 166.5,
|
|
|
|
- height: 102.5.ap,
|
|
|
|
- isCircle: false,
|
|
|
|
- fit: BoxFit.cover,
|
|
|
|
- ),
|
|
|
|
- ),
|
|
|
|
- ),
|
|
|
|
- ],
|
|
|
|
- ),
|
|
|
|
- // 标题
|
|
|
|
- Padding(
|
|
|
|
- padding: const EdgeInsets.only(left: 10, right: 10, top: 10, bottom: 10),
|
|
|
|
- child: Row(
|
|
|
|
|
|
+ return SizedBox(
|
|
|
|
+ height: cardHeight!,
|
|
|
|
+ child: Column(
|
|
|
|
+ children: [
|
|
|
|
+ // 图片
|
|
|
|
+ Row(
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.center,
|
|
children: [
|
|
children: [
|
|
Expanded(
|
|
Expanded(
|
|
- child: MyTextView(
|
|
|
|
- card_title,
|
|
|
|
- maxLines: 1,
|
|
|
|
- isTextEllipsis: true,
|
|
|
|
- textAlign: TextAlign.left,
|
|
|
|
- textColor: context.appColors.textBlack,
|
|
|
|
- fontSize: 16,
|
|
|
|
- isFontRegular: true,
|
|
|
|
|
|
+ child: ClipRRect(
|
|
|
|
+ borderRadius: const BorderRadius.only(topLeft: Radius.circular(8), topRight: Radius.circular(8),),
|
|
|
|
+ child: MyLoadImage(
|
|
|
|
+ card_img,
|
|
|
|
+ width: 166.5,
|
|
|
|
+ height: 102.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: MyTextView(
|
|
|
|
- '$card_price',
|
|
|
|
- maxLines: 1,
|
|
|
|
- isTextEllipsis: true,
|
|
|
|
- textAlign: TextAlign.start,
|
|
|
|
- textColor: ColorUtils.string2Color('#4161D0'),
|
|
|
|
- fontSize: 18,
|
|
|
|
- isFontMedium: true,
|
|
|
|
|
|
+ // 标题
|
|
|
|
+ Padding(
|
|
|
|
+ padding: const EdgeInsets.only(left: 10, right: 10, top: 10, bottom: 10),
|
|
|
|
+ child: Row(
|
|
|
|
+ mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
+ children: [
|
|
|
|
+ Expanded(
|
|
|
|
+ child: MyTextView(
|
|
|
|
+ card_title,
|
|
|
|
+ maxLines: 1,
|
|
|
|
+ isTextEllipsis: true,
|
|
|
|
+ textAlign: TextAlign.left,
|
|
|
|
+ textColor: context.appColors.textBlack,
|
|
|
|
+ fontSize: 16,
|
|
|
|
+ isFontRegular: true,
|
|
|
|
+ ),
|
|
),
|
|
),
|
|
- ),
|
|
|
|
- // 动态的 收藏数
|
|
|
|
- CollectionWidget(
|
|
|
|
- collectionNum: card_likes_count,
|
|
|
|
- isCollection: card_liked,
|
|
|
|
- onClickColleciotn: onClickColleciotn,
|
|
|
|
- ),
|
|
|
|
- ],
|
|
|
|
|
|
+ ],
|
|
|
|
+ ),
|
|
),
|
|
),
|
|
- ),
|
|
|
|
- // 发布人信息
|
|
|
|
- Expanded(
|
|
|
|
- child: Padding(
|
|
|
|
- padding: EdgeInsets.only(left: (useType == GarageCardUseType.forSale || useType == GarageCardUseType.forRent)?10:0, right: 10, bottom: 17.5),
|
|
|
|
|
|
+ // 价格 及 收藏
|
|
|
|
+ Padding(
|
|
|
|
+ padding: const EdgeInsets.only(left: 10, right: 10,top: 0, bottom: 0),
|
|
child: Row(
|
|
child: Row(
|
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
children: [
|
|
children: [
|
|
- if (useType == GarageCardUseType.forSale || useType == GarageCardUseType.forRent)
|
|
|
|
- MyLoadImage(
|
|
|
|
- card_avatar,
|
|
|
|
- width: 30,
|
|
|
|
- height: 30,
|
|
|
|
- isCircle: true,
|
|
|
|
- )
|
|
|
|
- else
|
|
|
|
- const SizedBox.shrink(),
|
|
|
|
Expanded(
|
|
Expanded(
|
|
- child: Column(
|
|
|
|
- mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
- crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
- mainAxisSize: MainAxisSize.max,
|
|
|
|
- children: [
|
|
|
|
- if (useType == GarageCardUseType.forSale || useType == GarageCardUseType.forRent)
|
|
|
|
|
|
+ child: MyTextView(
|
|
|
|
+ '$card_price',
|
|
|
|
+ maxLines: 1,
|
|
|
|
+ isTextEllipsis: true,
|
|
|
|
+ textAlign: TextAlign.start,
|
|
|
|
+ textColor: ColorUtils.string2Color('#4161D0'),
|
|
|
|
+ fontSize: 18,
|
|
|
|
+ isFontMedium: true,
|
|
|
|
+ ),
|
|
|
|
+ ),
|
|
|
|
+ // 动态的 收藏数
|
|
|
|
+ CollectionWidget(
|
|
|
|
+ collectionNum: card_likes_count,
|
|
|
|
+ isCollection: card_liked,
|
|
|
|
+ onClickColleciotn: onClickColleciotn,
|
|
|
|
+ ),
|
|
|
|
+ ],
|
|
|
|
+ ),
|
|
|
|
+ ),
|
|
|
|
+ // 发布人信息
|
|
|
|
+ Expanded(
|
|
|
|
+ child: Padding(
|
|
|
|
+ padding: EdgeInsets.only(left: (useType == GarageCardUseType.forSale || useType == GarageCardUseType.forRent)?10:0, right: 10, bottom: 17.5),
|
|
|
|
+ child: Row(
|
|
|
|
+ mainAxisAlignment: MainAxisAlignment.spaceAround,
|
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
+ children: [
|
|
|
|
+ if (useType == GarageCardUseType.forSale || useType == GarageCardUseType.forRent)
|
|
|
|
+ MyLoadImage(
|
|
|
|
+ card_avatar,
|
|
|
|
+ width: 30,
|
|
|
|
+ height: 30,
|
|
|
|
+ isCircle: true,
|
|
|
|
+ )
|
|
|
|
+ else
|
|
|
|
+ const SizedBox.shrink(),
|
|
|
|
+ Expanded(
|
|
|
|
+ child: Column(
|
|
|
|
+ mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
+ mainAxisSize: MainAxisSize.max,
|
|
|
|
+ children: [
|
|
|
|
+ if (useType == GarageCardUseType.forSale || useType == GarageCardUseType.forRent)
|
|
|
|
+ MyTextView(
|
|
|
|
+ card_publish_name,
|
|
|
|
+ maxLines: 1,
|
|
|
|
+ isTextEllipsis: true,
|
|
|
|
+ textAlign: TextAlign.start,
|
|
|
|
+ marginLeft: 13,
|
|
|
|
+ fontSize: 12,
|
|
|
|
+ textColor: ColorUtils.string2Color('#2956B7'),
|
|
|
|
+ isFontRegular: true,
|
|
|
|
+ )
|
|
|
|
+ else
|
|
|
|
+ const SizedBox.shrink(),
|
|
MyTextView(
|
|
MyTextView(
|
|
- card_publish_name,
|
|
|
|
|
|
+ card_created_at,
|
|
maxLines: 1,
|
|
maxLines: 1,
|
|
isTextEllipsis: true,
|
|
isTextEllipsis: true,
|
|
textAlign: TextAlign.start,
|
|
textAlign: TextAlign.start,
|
|
marginLeft: 13,
|
|
marginLeft: 13,
|
|
- fontSize: 12,
|
|
|
|
- textColor: ColorUtils.string2Color('#2956B7'),
|
|
|
|
|
|
+ marginTop: 5,
|
|
|
|
+ fontSize: 10,
|
|
|
|
+ textColor: context.appColors.textBlack,
|
|
isFontRegular: true,
|
|
isFontRegular: true,
|
|
- )
|
|
|
|
- else
|
|
|
|
- const SizedBox.shrink(),
|
|
|
|
- MyTextView(
|
|
|
|
- card_created_at,
|
|
|
|
- maxLines: 1,
|
|
|
|
- isTextEllipsis: true,
|
|
|
|
- textAlign: TextAlign.start,
|
|
|
|
- marginLeft: 13,
|
|
|
|
- marginTop: 5,
|
|
|
|
- fontSize: 10,
|
|
|
|
- textColor: context.appColors.textBlack,
|
|
|
|
- isFontRegular: true,
|
|
|
|
- ),
|
|
|
|
- ]
|
|
|
|
- )
|
|
|
|
- ),
|
|
|
|
- ]
|
|
|
|
- )
|
|
|
|
- ),
|
|
|
|
- )
|
|
|
|
- ],
|
|
|
|
|
|
+ ).expanded(),
|
|
|
|
+ ]
|
|
|
|
+ )
|
|
|
|
+ ),
|
|
|
|
+ ]
|
|
|
|
+ )
|
|
|
|
+ ),
|
|
|
|
+ )
|
|
|
|
+ ],
|
|
|
|
+ ),
|
|
);
|
|
);
|
|
}
|
|
}
|
|
}
|
|
}
|