From d71ddcdf1a83f9517c6a5ae4f340609f191c9c0d Mon Sep 17 00:00:00 2001 From: Sikander Saleem Date: Sun, 26 Jul 2026 16:19:10 +0300 Subject: [PATCH] ui/ux asset delivery improvements --- .../firebase_notification_manger.dart | 22 ++- .../pages/asset_delivery_item_view.dart | 8 +- .../pages/asset_delivery_line_card_view.dart | 59 ++------ .../pages/asset_delivery_page.dart | 16 +-- .../pages/asset_delivery_table_card_view.dart | 22 +-- .../delivery_inspection_form_view.dart | 126 ++++-------------- .../inpection_bottomsheet.dart | 11 +- .../oracle_user_autocomplete_field.dart | 16 ++- .../pages/history_log_view.dart | 4 +- .../asset_auto_complete_field.dart | 16 +-- .../widgets/date_and_time/date_picker.dart | 2 +- .../widgets/e_signature/e_signature.dart | 11 +- 12 files changed, 95 insertions(+), 218 deletions(-) diff --git a/lib/controllers/notification/firebase_notification_manger.dart b/lib/controllers/notification/firebase_notification_manger.dart index c80a0d8f..20a49c7a 100644 --- a/lib/controllers/notification/firebase_notification_manger.dart +++ b/lib/controllers/notification/firebase_notification_manger.dart @@ -12,6 +12,9 @@ import 'package:test_sa/controllers/providers/api/notifications_provider.dart'; import 'package:test_sa/models/all_requests_and_count_model.dart'; import 'package:test_sa/models/device/device_transfer.dart'; import 'package:test_sa/models/new_models/gas_refill_model.dart'; +import 'package:test_sa/modules/asset_delivery_module/pages/asset_delivery_page.dart'; +import 'package:test_sa/modules/asset_inventory_module/pages/asset_inventory_detail_view.dart'; +import 'package:test_sa/modules/asset_inventory_module/pages/asset_inventory_page.dart'; import 'package:test_sa/modules/cm_module/cm_detail_page.dart'; import 'package:test_sa/modules/cx_module/survey/survey_page.dart'; import 'package:test_sa/modules/demo_module/demo_detail_view_page.dart'; @@ -172,9 +175,9 @@ class FirebaseNotificationManger { requestDetails: RequestsDetails(nameOfType: messageData["sourceName"], status: messageData["statusName"], priority: messageData["priorityName"], date: messageData["createdDate"]), moduleId: 7); break; - // case "8": - // serviceClass = AssetInventoryDetailView(requestId: int.parse(messageData["requestNumber"].toString()), moduleId: 1); - // break; + case "8": + serviceClass = AssetInventoryPage(sessionId: int.parse(messageData["requestNumber"].toString()), moduleId: int.parse(transactionType)); + break; case "9": serviceClass = TrafRequestDetailPage(trafId: int.parse(messageData["requestNumber"].toString())); break; @@ -187,9 +190,9 @@ class FirebaseNotificationManger { case "12": serviceClass = LoanEquipmentDetailPage(loanId: int.parse(messageData["requestNumber"].toString())); break; - // case "13": - // serviceClass = AssetDeliveryPage(requestId: int.parse(messageData["requestNumber"].toString())); - // break; + case "13": + serviceClass = AssetDeliveryPage(requestId: int.parse(messageData["requestNumber"].toString())); + break; case "14": serviceClass = MedicalGasInspectionDetailPage(inspectionId: int.parse(messageData["requestNumber"].toString()), prority: messageData["priorityName"]); break; @@ -271,12 +274,7 @@ class FirebaseNotificationManger { final String body = message.notification?.body ?? message.data['body'] ?? 'New notification'; // Always show with our grouping logic - NotificationManger.showNotification( - title: title, - subtext: body, - hashcode: DateTime.now().millisecondsSinceEpoch.hashCode, - payload: json.encode(message.data), - context: context); + NotificationManger.showNotification(title: title, subtext: body, hashcode: DateTime.now().millisecondsSinceEpoch.hashCode, payload: json.encode(message.data), context: context); // Update unread notification count badge when new notification arrives try { diff --git a/lib/modules/asset_delivery_module/pages/asset_delivery_item_view.dart b/lib/modules/asset_delivery_module/pages/asset_delivery_item_view.dart index 1fe8dc2b..df3c0dbc 100644 --- a/lib/modules/asset_delivery_module/pages/asset_delivery_item_view.dart +++ b/lib/modules/asset_delivery_module/pages/asset_delivery_item_view.dart @@ -35,8 +35,8 @@ class AssetDeliveryItemView extends StatelessWidget { Navigator.of(context).push(MaterialPageRoute( builder: (_) => AssetDeliveryPage( requestId: requestData!.id!, - poInternal: requestData?.poInternal, - poExternal: requestData?.poExternal, + // poInternal: requestData?.poInternal, + // poExternal: requestData?.poExternal, ))); }); } @@ -52,8 +52,8 @@ class AssetDeliveryItemView extends StatelessWidget { Navigator.of(context).push(MaterialPageRoute( builder: (_) => AssetDeliveryPage( requestId: requestDetails!.id!, - poInternal: requestDetails?.poInternal, - poExternal: requestDetails?.poExternal, + // poInternal: requestDetails?.poInternal, + // poExternal: requestDetails?.poExternal, ))); }); } diff --git a/lib/modules/asset_delivery_module/pages/asset_delivery_line_card_view.dart b/lib/modules/asset_delivery_module/pages/asset_delivery_line_card_view.dart index 5337f457..e953eb3d 100644 --- a/lib/modules/asset_delivery_module/pages/asset_delivery_line_card_view.dart +++ b/lib/modules/asset_delivery_module/pages/asset_delivery_line_card_view.dart @@ -4,6 +4,7 @@ import 'package:test_sa/extensions/text_extensions.dart'; import 'package:test_sa/extensions/widget_extensions.dart'; import 'package:test_sa/modules/asset_delivery_module/models/delivery_line_model.dart'; import 'package:test_sa/new_views/app_style/app_color.dart'; +import 'package:test_sa/views/widgets/item_views/info_text_widget.dart'; class AssetDeliveryLineCard extends StatelessWidget { DeliveryLineModel deliveryLineModel; @@ -28,59 +29,27 @@ class AssetDeliveryLineCard extends StatelessWidget { Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Text( - 'Item Category: ${deliveryLineModel.itemCategory ?? '-'}', - style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral120), - ), + InfoTextWidget(label: "Item Category", value: deliveryLineModel.itemCategory ?? '-'), if (!isViewOnly) - 'edit_icon'.toSvgAsset().onPress(() { + 'edit_icon'.toSvgAsset(width: 24, height: 24, color: AppColor.icon2Color(context)).onPress(() { if (editPress != null) { editPress!(); } }), ], ), - Text( - 'Item No: ${deliveryLineModel.itemNumber ?? '-'}', - style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral120), - ), - Text( - 'Item Description: ${deliveryLineModel.itemDescription ?? '-'}', - style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral120), - ), - Text( - 'Quantity: ${deliveryLineModel.qty ?? '-'}', - style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral120), - ), - - if(!isTechnical)...[ - Text( - 'Remaining Quantity: ${deliveryLineModel.remainingQty ?? '-'}', - style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral120), - ), - Text( - 'Quantity of this Delivery: ${deliveryLineModel.usingQtyInThisDelivery ?? '-'}', - style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral120), - ), + InfoTextWidget(label: "Item No", value: deliveryLineModel.itemNumber ?? '-'), + InfoTextWidget(label: "Item Description", value: deliveryLineModel.itemDescription ?? '-'), + InfoTextWidget(label: "Quantity", value: deliveryLineModel.qty?.toString() ?? '-'), + if (!isTechnical) ...[ + InfoTextWidget(label: "Remaining Quantity", value: deliveryLineModel.remainingQty?.toString() ?? '-'), + InfoTextWidget(label: "Quantity of this Delivery", value: deliveryLineModel.usingQtyInThisDelivery?.toString() ?? '-'), ], - - Text( - 'Measure Unit: ${deliveryLineModel.unitOfMeasure ?? '-'}', - style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral120), - ), - Text( - 'Unit price: ${deliveryLineModel.unitPrice ?? '-'}', - style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral120), - ), - Text( - 'Line Type: ${deliveryLineModel.lineType ?? '-'}', - style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral120), - ), - Text( - 'Total: ${deliveryLineModel.total ?? '-'}', - style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral120), - ), + InfoTextWidget(label: "Measure Unit", value: deliveryLineModel.unitOfMeasure?.toString() ?? '-'), + InfoTextWidget(label: "Unit price", value: deliveryLineModel.unitPrice?.toString() ?? '-'), + InfoTextWidget(label: "Line Type", value: deliveryLineModel.lineType?.toString() ?? '-'), + InfoTextWidget(label: "Total", value: deliveryLineModel.total?.toString() ?? '-'), ], - ).toShadowContainer(context, borderRadius: 20, padding: 12); + ).toShadowContainer(context); } } diff --git a/lib/modules/asset_delivery_module/pages/asset_delivery_page.dart b/lib/modules/asset_delivery_module/pages/asset_delivery_page.dart index 52626bd9..664b4617 100644 --- a/lib/modules/asset_delivery_module/pages/asset_delivery_page.dart +++ b/lib/modules/asset_delivery_module/pages/asset_delivery_page.dart @@ -25,14 +25,14 @@ import 'package:test_sa/views/widgets/item_views/info_text_widget.dart'; class AssetDeliveryPage extends StatefulWidget { final int? requestId; - final String? poInternal; - final String? poExternal; + // final String? poInternal; + // final String? poExternal; const AssetDeliveryPage({ Key? key, this.requestId, - this.poInternal, - this.poExternal, + // this.poInternal, + // this.poExternal, }) : super(key: key); @override @@ -101,7 +101,7 @@ class _AssetDeliveryPageState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - requestDetailCard(context).toShadowContainer(context, borderRadius: 20, padding: 0), + requestDetailCard(context).toShadowContainer(context), 16.height, Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, @@ -160,7 +160,7 @@ class _AssetDeliveryPageState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ InfoHeader16Widget('PO Details'.addTranslation), - InfoTextWidget(label: 'PO No. Internal'.addTranslation, value: widget.poInternal ?? '-'), + InfoTextWidget(label: 'PO No. Internal'.addTranslation, value: dataModel?.poNumber?.toString() ?? '-'), InfoTextWidget(label: 'Client Name'.addTranslation, value: dataModel?.clientName ?? '-'), // Row( // mainAxisSize: MainAxisSize.min, @@ -193,7 +193,7 @@ class _AssetDeliveryPageState extends State { InfoTextWidget(label: 'Total'.addTranslation, value: dataModel?.total != null ? dataModel!.total.toString() : '-'), InfoTextWidget(label: 'Total Invoice'.addTranslation, value: dataModel?.totalInvoice != null ? dataModel!.totalInvoice.toString() : '-'), ], - ).paddingAll(16); + ); } String getPOExternal() { @@ -218,7 +218,7 @@ class _AssetDeliveryPageState extends State { ? const NoDataFound().center : ListView.separated( itemCount: assetDeliveryTableList.length, - separatorBuilder: (_, __) => 8.height, + separatorBuilder: (_, __) => 12.height, padding: EdgeInsets.zero, shrinkWrap: true, physics: const NeverScrollableScrollPhysics(), diff --git a/lib/modules/asset_delivery_module/pages/asset_delivery_table_card_view.dart b/lib/modules/asset_delivery_module/pages/asset_delivery_table_card_view.dart index e7a41d96..59ed682a 100644 --- a/lib/modules/asset_delivery_module/pages/asset_delivery_table_card_view.dart +++ b/lib/modules/asset_delivery_module/pages/asset_delivery_table_card_view.dart @@ -7,6 +7,7 @@ import 'package:test_sa/extensions/text_extensions.dart'; import 'package:test_sa/extensions/widget_extensions.dart'; import 'package:test_sa/modules/asset_delivery_module/models/asset_delivery_data_model.dart'; import 'package:test_sa/new_views/app_style/app_color.dart'; +import 'package:test_sa/views/widgets/item_views/info_text_widget.dart'; import 'package:test_sa/views/widgets/requests/request_status.dart'; class AssetDeliveryTableCard extends StatelessWidget { @@ -54,24 +55,11 @@ class AssetDeliveryTableCard extends StatelessWidget { // ], // ), 8.height, - Text( - 'Delivery Number: ${deliveryTableModel.number ?? '-'}', - style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral120), - ), - Text( - 'Delivery Amount: ${deliveryTableModel.deliveryAmount ?? '-'}', - style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral120), - ), - Text( - 'Invoice Amount: ${deliveryTableModel.invoiceAmount ?? '-'}', - style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral120), - ), - Align( - alignment: Alignment.centerRight, - child: Icon(Icons.arrow_forward, color: AppColor.blueStatus(context), size: 14), - ), + InfoTextWidget(label: "Delivery Number", value: deliveryTableModel.number ?? '-'), + InfoTextWidget(label: "Delivery Amount", value: deliveryTableModel.deliveryAmount?.toString() ?? '-'), + InfoTextWidget(label: "Invoice Amount", value: deliveryTableModel.invoiceAmount?.toString() ?? '-', showArrow: true), ], - ).toShadowContainer(context, borderRadius: 20).onPress(() { + ).toShadowContainer(context).onPress(() { onCardTap(); }); } diff --git a/lib/modules/asset_delivery_module/pages/delivery_inspection/delivery_inspection_form_view.dart b/lib/modules/asset_delivery_module/pages/delivery_inspection/delivery_inspection_form_view.dart index 39e097b4..f62cd62c 100644 --- a/lib/modules/asset_delivery_module/pages/delivery_inspection/delivery_inspection_form_view.dart +++ b/lib/modules/asset_delivery_module/pages/delivery_inspection/delivery_inspection_form_view.dart @@ -1,5 +1,6 @@ import 'dart:convert'; import 'dart:developer'; +import 'package:date_picker_timeline/extra/color.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; @@ -32,6 +33,8 @@ import 'package:test_sa/views/widgets/date_and_time/time_picker.dart'; import 'package:test_sa/new_views/common_widgets/single_item_drop_down_menu.dart'; import 'package:test_sa/new_views/swipe_module/dialoge/acknowledge_work_dialog.dart'; import 'package:test_sa/views/widgets/date_and_time/date_picker.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'; import 'package:test_sa/views/widgets/loaders/no_data_found.dart'; import '../../../../new_views/common_widgets/app_filled_button.dart'; @@ -97,23 +100,19 @@ class _DeliveryInspectionFormViewState extends State return Scaffold( backgroundColor: Theme.of(context).scaffoldBackgroundColor, body: isLoading - ? CircularProgressIndicator(color: AppColor.loadingColor(context)).center + ? CircularProgressIndicator(color: AppColor.loadingColor(context)).center : Form( key: _formKey, child: Column( children: [ SingleChildScrollView( - padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12), + padding: const EdgeInsets.all(16), child: Column( crossAxisAlignment: CrossAxisAlignment.start, + spacing: 12, children: [ if (!viewOnly) ...[inspectionDetailsForm()] else ...[inspectionDetails()], - 20.height, - Text( - "Lines", - style: AppTextStyles.heading6.copyWith(color: context.isDark ? AppColor.neutral30 : AppColor.black10), - ), - 8.height, + InfoHeader16Widget("Lines"), linesList(context), ], )).expanded, @@ -178,12 +177,12 @@ class _DeliveryInspectionFormViewState extends State return Consumer(builder: (context, provider, child) { List linesList = provider.deliveryLinesList; return provider.isDeliveryLineListLoading - ? SizedBox.expand(child: CircularProgressIndicator(color: AppColor.loadingColor(context)).center) + ? SizedBox.expand(child: CircularProgressIndicator(color: AppColor.loadingColor(context)).center) : linesList.isEmpty ? const NoDataFound().center : ListView.separated( itemCount: linesList.length, - separatorBuilder: (_, __) => 8.height, + separatorBuilder: (_, __) => 12.height, padding: EdgeInsets.zero, shrinkWrap: true, physics: const NeverScrollableScrollPhysics(), @@ -234,6 +233,7 @@ class _DeliveryInspectionFormViewState extends State Widget inspectionDetailsForm() { return Column( crossAxisAlignment: CrossAxisAlignment.start, + spacing: 12, children: [ _inspectionTile( title: 'Inspected by'.addTranslation, @@ -251,7 +251,6 @@ class _DeliveryInspectionFormViewState extends State } }, ), - 8.height, _inspectionTile( title: 'Approved by'.addTranslation, model: model.approvedByModel, @@ -269,7 +268,6 @@ class _DeliveryInspectionFormViewState extends State }, ), if (widget.requestModel?.paymentTerm?.value == 2) ...[ - 8.height, _inspectionTile( title: 'ThirdApprover'.addTranslation, model: model.thirdApprovalModel, @@ -287,7 +285,6 @@ class _DeliveryInspectionFormViewState extends State }, ), ], - 8.height, ADatePicker( label: 'Inspected Date/Time From'.addTranslation, hideShadow: true, @@ -314,12 +311,10 @@ class _DeliveryInspectionFormViewState extends State if (!_validateInspectionDates(from: fromDateTime, to: model.deliveryInspectionInspectedDateTo)) { return; // invalid, do not assign } - model.deliveryInspectionInspectedDateFrom = fromDateTime; setState(() {}); }, ), - 8.height, ADatePicker( label: 'Inspected Date/Time To'.addTranslation, hideShadow: true, @@ -356,18 +351,7 @@ class _DeliveryInspectionFormViewState extends State setState(() {}); }, ), - 8.height, - Text( - 'Total Time'.addTranslation, - style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral30 : AppColor.black10), - ), - 8.height, - Text( - formatInspectionDuration(model.totalTime), - style: AppTextStyles.bodyText2.copyWith( - color: context.isDark ? AppColor.neutral30 : AppColor.neutral120, - ), - ), + InfoTextWidget(label: 'Total Time'.addTranslation, value: formatInspectionDuration(model.totalTime)), ], ).toShadowContainer(context, borderRadius: 20, padding: 12); } @@ -421,64 +405,18 @@ class _DeliveryInspectionFormViewState extends State return '${hours.toStringAsFixed(2)} hours'; } - Widget inspectionDetails() { return Column( crossAxisAlignment: CrossAxisAlignment.start, + spacing: 4, children: [ - Text( - 'Inspected by'.addTranslation, - style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral30 : AppColor.black10), - ), - 8.height, - Text( - model.deliveryInspectionInspectedBy ?? '-', - style: AppTextStyles.bodyText2.copyWith(color: context.isDark ? AppColor.neutral30 : AppColor.neutral120), - ), - 8.height, - Text( - 'Approved by'.addTranslation, - style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral30 : AppColor.black10), - ), - 8.height, - Text( - model.deliveryInspectionApprovedBy ?? '-', - style: AppTextStyles.bodyText2.copyWith(color: context.isDark ? AppColor.neutral30 : AppColor.neutral120), - ), - 8.height, - Text( - 'Inspected Date/Time From'.addTranslation, - style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral30 : AppColor.black10), - ), - 8.height, - Text( - model.deliveryInspectionInspectedDateFrom != null ? model.deliveryInspectionInspectedDateFrom!.toString().toServiceRequestDetailsFormat : '-', - style: AppTextStyles.bodyText2.copyWith(color: context.isDark ? AppColor.neutral30 : AppColor.neutral120), - ), - 8.height, - Text( - 'Inspected Date/Time To'.addTranslation, - style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral30 : AppColor.black10), - ), - 8.height, - Text( - model.deliveryInspectionInspectedDateTo != null ? model.deliveryInspectionInspectedDateTo!.toString().toServiceRequestDetailsFormat : '-', - style: AppTextStyles.bodyText2.copyWith(color: context.isDark ? AppColor.neutral30 : AppColor.neutral120), - ), - 8.height, - Text( - 'Total Time'.addTranslation, - style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral30 : AppColor.black10), - ), - 8.height, - Text( - formatInspectionDuration(model.totalTime), - style: AppTextStyles.bodyText2.copyWith( - color: context.isDark ? AppColor.neutral30 : AppColor.neutral120, - ), - ), + InfoTextWidget(label: "Inspected by", value: "\n${model.deliveryInspectionInspectedBy ?? '-'}"), + InfoTextWidget(label: "Approved by", value: "\n${model.deliveryInspectionApprovedBy ?? '-'}"), + InfoTextWidget(label: 'Inspected Date/Time From'.addTranslation, value: "\n${model.deliveryInspectionInspectedDateFrom?.toString().toServiceRequestDetailsFormat ?? '-'}"), + InfoTextWidget(label: 'Inspected Date/Time To'.addTranslation, value: "\n${model.deliveryInspectionInspectedDateTo?.toString().toServiceRequestDetailsFormat ?? '-'}"), + InfoTextWidget(label: 'Total Time'.addTranslation, value: "\n${formatInspectionDuration(model.totalTime) ?? '-'}"), ], - ).toShadowContainer(context, borderRadius: 20, padding: 12); + ).toShadowContainer(context); } Widget _inspectionTile({ @@ -493,8 +431,9 @@ class _DeliveryInspectionFormViewState extends State child: Container( padding: const EdgeInsets.all(12), decoration: BoxDecoration( - color: AppColor.fieldBgColor(context), - borderRadius: BorderRadius.circular(12), + color: AppColor.background(context), + border: Border.all(color: AppColor.border2Color(context), width: 1), + borderRadius: BorderRadius.circular(16), ), child: Row( children: [ @@ -502,25 +441,9 @@ class _DeliveryInspectionFormViewState extends State crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: [ - Text(title, style: AppTextStyles.textFieldLabelStyle), - 6.height, - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text( - model?.name?.isNotEmpty == true ? model!.name! : 'Tap to add'.addTranslation, - style: AppTextStyles.bodyText, - ), - - ///Need to display other info as well - // Text( - // model?.email?.isNotEmpty == true - // ? model!.email! - // : '', - // style: AppTextStyles.bodyText, - // ), - ], - ), + InfoTextLabelWidget(label: title, textStyle: AppTextStyles.textFieldLabelStyle), + 4.height, + InfoTextLabelWidget(label: model?.name?.isNotEmpty == true ? model!.name! : 'Tap to add'.addTranslation, textStyle: AppTextStyles.bodyText), ], ), ], @@ -630,6 +553,7 @@ class _DeliveryInspectionFormViewState extends State return showModalBottomSheet( context: context, isScrollControlled: true, + backgroundColor: AppColor.bottomSheetColor(context), shape: const RoundedRectangleBorder( borderRadius: BorderRadius.vertical(top: Radius.circular(20)), ), diff --git a/lib/modules/asset_delivery_module/pages/delivery_inspection/inpection_bottomsheet.dart b/lib/modules/asset_delivery_module/pages/delivery_inspection/inpection_bottomsheet.dart index 34aad6d3..130a2d6b 100644 --- a/lib/modules/asset_delivery_module/pages/delivery_inspection/inpection_bottomsheet.dart +++ b/lib/modules/asset_delivery_module/pages/delivery_inspection/inpection_bottomsheet.dart @@ -67,14 +67,14 @@ class _InspectionPersonBottomSheetState extends State { @override Widget build(BuildContext context) { assetDeliveryProvider ??= Provider.of(context); - final border = UnderlineInputBorder(borderSide: BorderSide.none, borderRadius: BorderRadius.circular(10)); + final border = UnderlineInputBorder(borderSide: BorderSide.none, borderRadius: BorderRadius.circular(16)); return Container( decoration: BoxDecoration( color: AppColor.background(context), - borderRadius: BorderRadius.circular(AppStyle.borderRadius * AppStyle.getScaleFactor(context)), + border: Border.all(color: AppColor.border2Color(context), width: 1), + borderRadius: BorderRadius.circular(16), // boxShadow: [BoxShadow(color: Colors.black.withOpacity(0.05), blurRadius: 10)], ), child: Autocomplete( @@ -73,7 +74,7 @@ class _AutoCompletePartsFieldState extends State { return TextField( controller: fieldTextEditingController, focusNode: fieldFocusNode, - style: AppTextStyles.bodyText.copyWith(color: AppColor.black10), + style: TextStyle(fontWeight: FontWeight.w500, fontSize: context.isTablet() ? 16 : 14, color: AppColor.textStyleColor(context)), textAlign: TextAlign.start, decoration: InputDecoration( border: border, @@ -81,15 +82,16 @@ class _AutoCompletePartsFieldState extends State { focusedBorder: border, enabledBorder: border, errorBorder: border, - contentPadding: EdgeInsets.symmetric(vertical: 8.toScreenHeight, horizontal: 16.toScreenWidth), + contentPadding: EdgeInsets.symmetric(vertical: 12.toScreenHeight, horizontal: 16.toScreenWidth), constraints: const BoxConstraints(), suffixIconConstraints: const BoxConstraints(minWidth: 0), filled: true, - fillColor: AppColor.fieldBgColor(context), + fillColor: AppColor.dropDownBackground(context), errorStyle: AppTextStyle.tiny.copyWith(color: context.isDark ? AppColor.red50 : AppColor.red60), - floatingLabelStyle: AppTextStyle.body1.copyWith(fontWeight: FontWeight.w500, color: context.isDark ? null : AppColor.neutral20), labelText: widget.label, - labelStyle: AppTextStyles.tinyFont.copyWith(color: AppColor.textColor(context)), + floatingLabelStyle: TextStyle(fontWeight: FontWeight.w500, fontSize: context.isTablet() ? 16 : 12, color: AppColor.floatingTextStyleColor(context)), + labelStyle: TextStyle(fontWeight: FontWeight.w500, fontSize: context.isTablet() ? 16 : 12, color: AppColor.labelTextStyleColor(context)), + ), textInputAction: TextInputAction.search, onChanged: (text) { diff --git a/lib/modules/asset_delivery_module/pages/history_log_view.dart b/lib/modules/asset_delivery_module/pages/history_log_view.dart index 9ad8c1fc..01cc5f37 100644 --- a/lib/modules/asset_delivery_module/pages/history_log_view.dart +++ b/lib/modules/asset_delivery_module/pages/history_log_view.dart @@ -61,8 +61,8 @@ class _AssetDeliveryHistoryLogViewState extends State { @override Widget build(BuildContext context) { - final border = UnderlineInputBorder(borderSide: BorderSide.none, borderRadius: BorderRadius.circular(10)); + final border = UnderlineInputBorder(borderSide: BorderSide.none, borderRadius: BorderRadius.circular(16)); return Container( decoration: BoxDecoration( color: AppColor.background(context), - borderRadius: BorderRadius.circular(AppStyle.borderRadius * AppStyle.getScaleFactor(context)), - // boxShadow: [BoxShadow(color: Colors.black.withOpacity(0.05), blurRadius: 10)], + border: Border.all(color: AppColor.border2Color(context), width: 1), + borderRadius: BorderRadius.circular(16), ), child: Autocomplete( optionsBuilder: (TextEditingValue textEditingValue) async { @@ -90,7 +90,7 @@ class _AssetAutoCompleteFieldState extends State { return TextField( controller: _controller, focusNode: fieldFocusNode, - style: AppTextStyles.bodyText.copyWith(color: AppColor.black10), + style: TextStyle(fontWeight: FontWeight.w500, fontSize: context.isTablet() ? 16 : 14, color: AppColor.textStyleColor(context)), textAlign: TextAlign.start, decoration: InputDecoration( border: border, @@ -98,15 +98,15 @@ class _AssetAutoCompleteFieldState extends State { focusedBorder: border, enabledBorder: border, errorBorder: border, - contentPadding: EdgeInsets.symmetric(vertical: 8.toScreenHeight, horizontal: 16.toScreenWidth), + contentPadding: EdgeInsets.symmetric(vertical: 12.toScreenHeight, horizontal: 16.toScreenWidth), constraints: const BoxConstraints(), suffixIconConstraints: const BoxConstraints(maxHeight: 24, maxWidth: 24 + 8), filled: true, - fillColor: AppColor.fieldBgColor(context), + fillColor: AppColor.dropDownBackground(context), errorStyle: AppTextStyle.tiny.copyWith(color: context.isDark ? AppColor.red50 : AppColor.red60), - floatingLabelStyle: AppTextStyle.body1.copyWith(fontWeight: FontWeight.w500, color: context.isDark ? null : AppColor.neutral20), + floatingLabelStyle: TextStyle(fontWeight: FontWeight.w500, fontSize: context.isTablet() ? 16 : 12, color: AppColor.floatingTextStyleColor(context)), + labelStyle: TextStyle(fontWeight: FontWeight.w500, fontSize: context.isTablet() ? 16 : 12, color: AppColor.labelTextStyleColor(context)), labelText: "Name/Oracle Code", - labelStyle: AppTextStyles.tinyFont.copyWith(color: AppColor.textColor(context)), suffixIcon: loading ? CircularProgressIndicator(color: AppColor.loadingColor(context), strokeWidth: 3.0).paddingOnly(end: 8) : null, ), textInputAction: TextInputAction.search, diff --git a/lib/views/widgets/date_and_time/date_picker.dart b/lib/views/widgets/date_and_time/date_picker.dart index 8fbb1264..f2439844 100644 --- a/lib/views/widgets/date_and_time/date_picker.dart +++ b/lib/views/widgets/date_and_time/date_picker.dart @@ -57,7 +57,7 @@ class ADatePicker extends StatelessWidget { children: [ Text( label, - style: AppTextStyles.tinyFont.copyWith(color: AppColor.floatingTextStyleColor(context)), + style: AppTextStyles.tinyFont2.copyWith(color: AppColor.floatingTextStyleColor(context)), ), 4.height, (date == null diff --git a/lib/views/widgets/e_signature/e_signature.dart b/lib/views/widgets/e_signature/e_signature.dart index 64d297e3..63615089 100644 --- a/lib/views/widgets/e_signature/e_signature.dart +++ b/lib/views/widgets/e_signature/e_signature.dart @@ -8,6 +8,7 @@ import 'package:test_sa/extensions/string_extensions.dart'; import 'package:test_sa/extensions/text_extensions.dart'; import 'package:test_sa/extensions/widget_extensions.dart'; import 'package:test_sa/new_views/app_style/app_color.dart'; +import 'package:test_sa/views/widgets/item_views/info_text_widget.dart'; import '../loaders/image_loader.dart'; @@ -67,18 +68,16 @@ class _ESignatureState extends State { width: MediaQuery.of(context).size.width, padding: EdgeInsets.symmetric(horizontal: 16.toScreenWidth, vertical: 8.toScreenHeight), decoration: BoxDecoration( - color: widget.backgroundColor ?? (context.isDark ? AppColor.background(context) : Colors.white), - borderRadius: _editable ? const BorderRadius.only(topLeft: Radius.circular(10), topRight: Radius.circular(10)) : BorderRadius.circular(10), + color: AppColor.dropDownBackground(context), + border: Border.all(color: AppColor.border2Color(context), width: 1), + borderRadius: BorderRadius.circular(16), boxShadow: widget.showShadow ? [BoxShadow(color: Colors.black.withOpacity(0.05), blurRadius: 10)] : null, ), child: widget.editable == false ? Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text( - 'Signature'.addTranslation, - style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral30 : AppColor.black10), - ), + InfoTextLabelWidget(label: "Signature", textStyle: AppTextStyles.bodyText), Container( height: 135.toScreenHeight, width: MediaQuery.of(context).size.width,