|
@@ -13,6 +13,7 @@ import 'package:shared/utils/log_utils.dart';
|
|
|
import 'package:widgets/ext/ex_widget.dart';
|
|
|
import 'package:widgets/my_button.dart';
|
|
|
import 'package:widgets/my_text_view.dart';
|
|
|
+import 'package:widgets/utils/dark_theme_util.dart';
|
|
|
|
|
|
import '../constants_services.dart';
|
|
|
|
|
@@ -49,7 +50,7 @@ class StausCardItem extends HookConsumerWidget {
|
|
|
height: cardHeight,
|
|
|
alignment: Alignment.center,
|
|
|
child: Padding(
|
|
|
- padding: const EdgeInsets.only(left: 18.0, right: 18.0, ),
|
|
|
+ padding: const EdgeInsets.only(left: 15.0, right: 15.0, ),
|
|
|
child: Column(
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
@@ -74,14 +75,37 @@ class StausCardItem extends HookConsumerWidget {
|
|
|
),
|
|
|
),
|
|
|
// 状态
|
|
|
- MyTextView(
|
|
|
- item?.orderStatus??"-",
|
|
|
- fontSize: 14,
|
|
|
- maxLines: 1,
|
|
|
- isFontRegular: true,
|
|
|
- textAlign: TextAlign.left,
|
|
|
- textColor: context.appColors.textPrimary,
|
|
|
- ),
|
|
|
+ // MyButton(
|
|
|
+ // onPressed: null,
|
|
|
+ // text: item?.orderStatus??"-",
|
|
|
+ // textColor: getStatusColor(context, item!),
|
|
|
+ // fontSize: 14,
|
|
|
+ // backgroundColor: DarkThemeUtil.multiColors(context, context.appColors.whiteBG, darkColor: Colors.black),
|
|
|
+ // minHeight: 30,
|
|
|
+ // minWidth: 60,
|
|
|
+ // padding: const EdgeInsets.symmetric(horizontal: 10),
|
|
|
+ // radius: 5,
|
|
|
+ // side: BorderSide(color: getStatusColor(context, item!), width: 1),
|
|
|
+ // enableOverlay: false,
|
|
|
+ // elevation: 0,
|
|
|
+ // // fontWeight: FontWeight.w500,
|
|
|
+ // )
|
|
|
+ Container(
|
|
|
+ padding: const EdgeInsets.all(5),
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ borderRadius: BorderRadius.circular(5),
|
|
|
+ border: Border.all(
|
|
|
+ color: getStatusColor(context, item!),
|
|
|
+ width: 1,
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ child: MyTextView(
|
|
|
+ item?.orderStatus ?? '',
|
|
|
+ fontSize: 12,
|
|
|
+ fontWeight: FontWeight.w500,
|
|
|
+ textColor: getStatusColor(context, item!),
|
|
|
+ ),
|
|
|
+ )
|
|
|
],
|
|
|
),
|
|
|
// 公司名称
|
|
@@ -219,4 +243,19 @@ class StausCardItem extends HookConsumerWidget {
|
|
|
minHeight: btnItem['btnHeight']?.toDouble() + 5,
|
|
|
).marginOnly(left: 5);
|
|
|
}
|
|
|
+
|
|
|
+ Color getStatusColor(BuildContext context,GarageSaleHistoryList item) {
|
|
|
+ switch (item.orderStatus) {
|
|
|
+ case 'Wait Paid':
|
|
|
+ return ColorUtils.string2Color('#FE4066');
|
|
|
+ case 'Wait Service':
|
|
|
+ return ColorUtils.string2Color('#01B5EB');
|
|
|
+ case 'Complete':
|
|
|
+ return ColorUtils.string2Color('#00B03E');
|
|
|
+ case 'Canceled':
|
|
|
+ return ColorUtils.string2Color('#939393');
|
|
|
+ default:
|
|
|
+ return context.appColors.textPrimary;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|