diff --git a/assets/images/wo/loan_wo.svg b/assets/images/wo/loan_wo.svg new file mode 100644 index 00000000..86f1bcae --- /dev/null +++ b/assets/images/wo/loan_wo.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/lib/new_views/pages/land_page/create_request_type_bottom_sheet.dart b/lib/new_views/pages/land_page/create_request_type_bottom_sheet.dart index 7c1bdb87..0f6a103f 100644 --- a/lib/new_views/pages/land_page/create_request_type_bottom_sheet.dart +++ b/lib/new_views/pages/land_page/create_request_type_bottom_sheet.dart @@ -142,7 +142,7 @@ class CreateRequestModel { // }); if (context.settingProvider.isUserFlowMedical) { - list.add(CreateRequestModel('Loan Equipment Request'.addTranslation, "add_icon", CreateLoanRequestPage.id)); + list.add(CreateRequestModel('Loan Equipment Request'.addTranslation, "wo/loan_wo", CreateLoanRequestPage.id)); // list.add(CreateRequestModel('Demo Request'.addTranslation, "add_icon", CreateDemoRequestPage.id)); } } diff --git a/lib/views/widgets/bottom_sheets/asset_detail_bottom_sheet.dart b/lib/views/widgets/bottom_sheets/asset_detail_bottom_sheet.dart index fd203840..b255ab52 100644 --- a/lib/views/widgets/bottom_sheets/asset_detail_bottom_sheet.dart +++ b/lib/views/widgets/bottom_sheets/asset_detail_bottom_sheet.dart @@ -6,6 +6,8 @@ import 'package:test_sa/extensions/text_extensions.dart'; import 'package:test_sa/extensions/widget_extensions.dart'; import 'package:test_sa/models/device/asset.dart'; import 'package:test_sa/new_views/app_style/app_color.dart'; +import 'package:test_sa/views/widgets/item_views/info_header_widget.dart'; +import 'package:test_sa/views/widgets/item_views/info_text_widget.dart'; class AssetDetailBottomSheet extends StatelessWidget { Asset? asset; @@ -16,14 +18,14 @@ class AssetDetailBottomSheet extends StatelessWidget { Widget build(BuildContext context) { return Padding( padding: EdgeInsets.only( - bottom: MediaQuery.of(context).viewInsets.bottom + - MediaQuery.of(context).padding.bottom, + bottom: MediaQuery.of(context).viewInsets.bottom + MediaQuery.of(context).padding.bottom, ), child: Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: [ - (asset?.modelDefinition?.assetName?.cleanupWhitespace.capitalizeFirstOfEach ?? "-").heading5(context).custom(color: AppColor.textStyleColor(context)), + // (asset?.modelDefinition?.assetName?.cleanupWhitespace.capitalizeFirstOfEach ?? "-").heading5(context).custom(color: AppColor.textStyleColor(context)), + InfoHeader16Widget(asset?.modelDefinition?.assetName?.cleanupWhitespace.capitalizeFirstOfEach ?? "-"), 16.height, AspectRatio( aspectRatio: 358 / 136, @@ -52,33 +54,70 @@ class AssetDetailBottomSheet extends StatelessWidget { Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - "${context.translation.assetNo}: ${asset!.assetNumber}".bodyText(context), - "${context.translation.modelName}: ${asset!.modelDefinition?.modelName}".bodyText(context), - "${context.translation.supplier}: ${asset!.supplier?.suppliername?.cleanupWhitespace.capitalizeFirstOfEach ?? "-"}".bodyText(context), - "${context.translation.manufacture}: ${asset!.modelDefinition?.manufacturerName?.cleanupWhitespace.capitalizeFirstOfEach}".bodyText(context), - //"${context.translation.location}: ${assetModel.site.custName?.cleanupWhitespace?.capitalizeFirstOfEach}".bodyText(context), + InfoTextWidget( + label: context.translation.assetNo, + value: asset!.assetNumber, + showEmptyValue: true, + ), + InfoTextWidget( + label: context.translation.modelName, + value: asset!.modelDefinition?.modelName, + showEmptyValue: true, + ), + InfoTextWidget( + label: context.translation.supplier, + value: asset!.supplier?.suppliername?.cleanupWhitespace.capitalizeFirstOfEach, + showEmptyValue: true, + ), + InfoTextWidget( + label: context.translation.manufacture, + value: asset!.modelDefinition?.manufacturerName?.cleanupWhitespace.capitalizeFirstOfEach, + showEmptyValue: true, + ), ], ).expanded, 8.width, Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - "${context.translation.snNo}: ${asset!.assetSerialNo}".bodyText(context), - "${context.translation.site}: ${asset?.site?.custName?.cleanupWhitespace.capitalizeFirstOfEach ?? "-"}".bodyText(context), - "${context.translation.building}: ${asset?.building?.name?.cleanupWhitespace.capitalizeFirstOfEach ?? "-"}".bodyText(context), - "${context.translation.floor}: ${asset?.floor?.name?.cleanupWhitespace.capitalizeFirstOfEach ?? "-"}".bodyText(context), - "${context.translation.md}: ${asset?.department?.departmentName?.cleanupWhitespace.capitalizeFirstOfEach ?? "-"}".bodyText(context), - "${context.translation.room}: ${asset?.room?.name ?? "-"}".bodyText(context), + InfoTextWidget( + label: context.translation.snNo, + value: asset!.assetSerialNo, + showEmptyValue: true, + ), + InfoTextWidget( + label: context.translation.site, + value: asset?.site?.custName?.cleanupWhitespace.capitalizeFirstOfEach, + showEmptyValue: true, + ), + InfoTextWidget( + label: context.translation.building, + value: asset?.building?.name?.cleanupWhitespace.capitalizeFirstOfEach, + showEmptyValue: true, + ), + InfoTextWidget( + label: context.translation.floor, + value: asset?.floor?.name?.cleanupWhitespace.capitalizeFirstOfEach, + showEmptyValue: true, + ), + InfoTextWidget( + label: context.translation.md, + value: asset?.department?.departmentName?.cleanupWhitespace.capitalizeFirstOfEach, + showEmptyValue: true, + ), + InfoTextWidget( + label: context.translation.room, + value: asset?.room?.name, + showEmptyValue: true, + ), ], ).expanded, ], ), 8.height, if ((asset?.modelDefinition?.assetDescription ?? "").isNotEmpty) ...[ - 8.height, - const Divider(color: AppColor.neutral30, height: 1, thickness: 1), - 8.height, - asset!.modelDefinition!.assetDescription!.bodyText(context), + const Divider().defaultStyle(context), + InfoTextWidget(label: asset!.modelDefinition!.assetDescription!, isMsg: true, showEmptyValue: true), ] ], ) diff --git a/lib/views/widgets/equipment/asset_picker.dart b/lib/views/widgets/equipment/asset_picker.dart index ff8a06a5..9d5ad7a7 100644 --- a/lib/views/widgets/equipment/asset_picker.dart +++ b/lib/views/widgets/equipment/asset_picker.dart @@ -69,16 +69,16 @@ class AssetPicker extends StatelessWidget { decoration: BoxDecoration( color: buttonColor ?? backgroundColor ?? AppColor.primary10, borderRadius: BorderRadius.circular(10), - border: showBorder ? Border.all(color: borderColor ?? AppColor.blueStatus(context), width: 2) : null, + border: showBorder ? Border.all(color: borderColor ?? AppColor.border2Color(context), width: 1) : null, // boxShadow: [BoxShadow(color: Colors.black.withOpacity(0.03), blurRadius: 14)], ), padding: EdgeInsets.symmetric(horizontal: 16.toScreenWidth, vertical: 8.toScreenHeight), child: Row( mainAxisSize: MainAxisSize.min, children: [ - "scan_asset".toSvgAsset(height: 22, fit: BoxFit.fitHeight, color: AppColor.icon2Color(context)), + "scan_asset".toSvgAsset(height: 22, fit: BoxFit.fitHeight, color: AppColor.white10), 8.width, - ' ${label ?? "Scan or Pick Asset"}'.bodyText(context).custom(color: AppColor.icon2Color(context)), + ' ${label ?? "Scan or Pick Asset"}'.bodyText(context).custom(color: AppColor.white10), ], ), ).onPress(() async { @@ -120,7 +120,7 @@ class AssetPicker extends StatelessWidget { children: [ "scan_asset".toSvgAsset(height: 22, fit: BoxFit.fitHeight, color: AppColor.icon2Color(context)), 8.width, - "Re-Scan or Pick Asset".bodyText(context).custom(color: AppColor.textStyleColor(context)), + "Re-Scan or Pick Asset".bodyText(context).custom(color: AppColor.icon2Color(context)), ], ), ).onPress(() async { diff --git a/lib/views/widgets/item_views/info_header_widget.dart b/lib/views/widgets/item_views/info_header_widget.dart index 72dfc7df..6f8e93bf 100644 --- a/lib/views/widgets/item_views/info_header_widget.dart +++ b/lib/views/widgets/item_views/info_header_widget.dart @@ -10,3 +10,11 @@ class InfoHeaderWidget extends StatelessWidget { @override Widget build(BuildContext context) => Text(label, style: AppTextStyles.bodyText.copyWith(color: AppColor.textStyleColor(context))); } +class InfoHeader16Widget extends StatelessWidget { + final String label; + + InfoHeader16Widget(this.label, {Key? key}) : super(key: key); + + @override + Widget build(BuildContext context) => Text(label, style: AppTextStyles.heading6.copyWith(color: AppColor.textStyleColor(context))); +} \ No newline at end of file