|
@@ -5,29 +5,12 @@ import 'package:flutter/material.dart';
|
|
|
import 'package:flutter/widgets.dart';
|
|
|
import 'package:flutter_hooks/flutter_hooks.dart';
|
|
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
|
|
-import 'package:plugin_platform/engine/toast/toast_engine.dart';
|
|
|
import 'package:shared/utils/color_utils.dart';
|
|
|
import 'package:shared/utils/ext_dart.dart';
|
|
|
-import 'package:shared/utils/log_utils.dart';
|
|
|
import 'package:widgets/ext/ex_widget.dart';
|
|
|
import 'package:widgets/my_load_image.dart';
|
|
|
import 'package:widgets/my_text_view.dart';
|
|
|
|
|
|
-import '../../../constants_services.dart';
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
class RepairHomeServiceCard extends StatelessWidget {
|
|
|
String? cleanServiceType;
|
|
|
RepairServiceList itemEntity;
|
|
@@ -43,114 +26,134 @@ class RepairHomeServiceCard extends StatelessWidget {
|
|
|
this.onClickColleciotn,
|
|
|
double? cardHeight,
|
|
|
}) : super(key: key) {
|
|
|
- this.cardHeight ??= 170;
|
|
|
+ this.cardHeight ??= 180;
|
|
|
}
|
|
|
|
|
|
@override
|
|
|
Widget build(BuildContext context) {
|
|
|
+ List? card_resources = itemEntity.resources?? [];
|
|
|
int card_id = itemEntity.id?? 0;
|
|
|
- List? card_resources = [];
|
|
|
String card_img = card_resources.length>0? card_resources[0]:"";
|
|
|
String card_name = itemEntity.name?? "";
|
|
|
+
|
|
|
bool card_liked = itemEntity.liked??false;
|
|
|
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!.ap,
|
|
|
+ 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.ap,
|
|
|
+ height: 70.ap,
|
|
|
+ isCircle: false,
|
|
|
+ fit: BoxFit.fitWidth,
|
|
|
),
|
|
|
),
|
|
|
),
|
|
|
],
|
|
|
),
|
|
|
- ),
|
|
|
-
|
|
|
- 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(
|
|
|
- 'get a quote',
|
|
|
- maxLines: 1,
|
|
|
+
|
|
|
+ Padding(
|
|
|
+ padding: EdgeInsets.only(left: 10.ap, right: 10.ap, top: 5.ap,),
|
|
|
+ child: Row(
|
|
|
+ mainAxisAlignment: MainAxisAlignment.center,
|
|
|
+ children: [
|
|
|
+ Expanded(
|
|
|
+ child: SizedBox(
|
|
|
+ height: 36.ap,
|
|
|
+ child: MyTextView(
|
|
|
+ card_name,
|
|
|
+ maxLines: 2,
|
|
|
isTextEllipsis: true,
|
|
|
- textAlign: TextAlign.start,
|
|
|
- textColor: ColorUtils.string2Color('#666666'),
|
|
|
- fontSize: 11,
|
|
|
- isFontMedium: true,
|
|
|
+ textAlign: TextAlign.left,
|
|
|
+ textColor: context.appColors.textBlack,
|
|
|
+ fontSize: 14,
|
|
|
+ isFontRegular: true,
|
|
|
),
|
|
|
- ],
|
|
|
+ ),
|
|
|
),
|
|
|
- ),
|
|
|
-
|
|
|
- CollectionWidget(
|
|
|
- collectionNum: card_likes_count,
|
|
|
- isCollection: card_liked,
|
|
|
- onClickColleciotn: onClickColleciotn,
|
|
|
- ),
|
|
|
- ],
|
|
|
+ ],
|
|
|
+ ),
|
|
|
),
|
|
|
- ),
|
|
|
-
|
|
|
- Expanded(
|
|
|
- child: Padding(
|
|
|
- padding: const EdgeInsets.only(bottom: 5),
|
|
|
+
|
|
|
+ Padding(
|
|
|
+ padding: EdgeInsets.only(left: 10.ap, right: 10.ap,top: 5.ap, bottom: 0),
|
|
|
+ child: Row(
|
|
|
+ mainAxisAlignment: MainAxisAlignment.spaceAround,
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
+ children: [
|
|
|
+ Expanded(
|
|
|
+ child: Row(
|
|
|
+ mainAxisAlignment: MainAxisAlignment.start,
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
+ children: [
|
|
|
+ MyTextView(
|
|
|
+ 'get a quote',
|
|
|
+ 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: MyTextView(
|
|
|
company_name,
|
|
|
maxLines: 1,
|
|
|
isTextEllipsis: true,
|
|
|
textAlign: TextAlign.start,
|
|
|
- marginLeft: 13,
|
|
|
+ marginLeft: 10,
|
|
|
fontSize: 11,
|
|
|
textColor: ColorUtils.string2Color('#666666'),
|
|
|
alignment: Alignment.centerLeft,
|
|
|
isFontRegular: true,
|
|
|
),
|
|
|
- ),
|
|
|
- )
|
|
|
- ],
|
|
|
+ )
|
|
|
+ ],
|
|
|
+ ),
|
|
|
);
|
|
|
}
|
|
|
}
|
|
@@ -172,8 +175,6 @@ class CollectionWidget extends HookConsumerWidget {
|
|
|
final collectionNumState = useState(collectionNum);
|
|
|
final isCollectionState = useState(isCollection);
|
|
|
return Container(
|
|
|
- width: 60,
|
|
|
- height: 30,
|
|
|
alignment: Alignment.center,
|
|
|
|
|
|
|