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..2e6bd66f 100644 --- a/lib/modules/asset_delivery_module/pages/asset_delivery_page.dart +++ b/lib/modules/asset_delivery_module/pages/asset_delivery_page.dart @@ -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/cost_center_form_view.dart b/lib/modules/asset_delivery_module/pages/delivery_inspection/cost_center_form_view.dart index b272c886..1b3a4337 100644 --- a/lib/modules/asset_delivery_module/pages/delivery_inspection/cost_center_form_view.dart +++ b/lib/modules/asset_delivery_module/pages/delivery_inspection/cost_center_form_view.dart @@ -18,6 +18,7 @@ import 'package:test_sa/new_views/common_widgets/app_lazy_loading.dart'; import 'package:test_sa/new_views/common_widgets/app_text_form_field.dart'; import 'package:test_sa/new_views/common_widgets/default_app_bar.dart'; import 'package:test_sa/new_views/common_widgets/single_item_drop_down_menu.dart'; +import 'package:test_sa/views/widgets/item_views/info_text_widget.dart'; class CostCenterFormView extends StatefulWidget { final List? costCenterList; @@ -113,44 +114,53 @@ class _CostCenterFormViewState extends State { ), body: Consumer(builder: (context, provider, child) { return provider.isLoading - ? CircularProgressIndicator(color: AppColor.loadingColor(context)).center + ? CircularProgressIndicator(color: AppColor.loadingColor(context)).center : Column( - children: [ - itemDetails(), - selectionButton(), - _selectedType == CostCenterType.costCenter ? _buildCostCenterList() : _buildSerialNumberList(), - FooterActionButton.footerContainer( - context: context, - child: AppFilledButton( - buttonColor: AppColor.primary10, - label: 'Save'.addTranslation, - maxWidth: true, - onPressed: () async { - showDialog(context: context, barrierDismissible: false, builder: (context) => const AppLazyLoading()); - await assetDeliveryProvider - .saveCostCenterToLineDeliveryInspection(tableItemId: widget.tableItemId, lineId: widget.lineId, list: formModel.costCenters, serialNoList: formModel.serialNos) - .then((status) async { - Navigator.pop(context); - if (status) { - Navigator.pop(context); - assetDeliveryProvider.getDeliveryLinesListById( - itemId: widget.tableItemId, - ); - } - }); - }), - ), - ], - ); + children: [ + ListView( + padding: const EdgeInsets.all(16), + children: [ + itemDetails(), + 12.height, + selectionButton(), + 12.height, + _selectedType == CostCenterType.costCenter ? _buildCostCenterList() : _buildSerialNumberList(), + ], + ).expanded, + FooterActionButton.footerContainer( + context: context, + child: AppFilledButton( + buttonColor: AppColor.primary10, + label: 'Save'.addTranslation, + maxWidth: true, + onPressed: () async { + showDialog(context: context, barrierDismissible: false, builder: (context) => const AppLazyLoading()); + await assetDeliveryProvider + .saveCostCenterToLineDeliveryInspection(tableItemId: widget.tableItemId, lineId: widget.lineId, list: formModel.costCenters, serialNoList: formModel.serialNos) + .then((status) async { + Navigator.pop(context); + if (status) { + Navigator.pop(context); + assetDeliveryProvider.getDeliveryLinesListById( + itemId: widget.tableItemId, + ); + } + }); + }), + ), + ], + ); }), ); } Widget _buildCostCenterList() { - return ListView.builder( + return ListView.separated( itemCount: formModel.costCenters!.length + 1, shrinkWrap: true, - padding: const EdgeInsets.only(left: 16, right: 16, bottom: 16, top: 8), + padding: EdgeInsets.zero, + physics: const NeverScrollableScrollPhysics(), + separatorBuilder: (context, index) => 12.height, itemBuilder: (context, index) { if (index == formModel.costCenters!.length) { return AppFilledButton( @@ -184,10 +194,12 @@ class _CostCenterFormViewState extends State { } Widget _buildSerialNumberList() { - return ListView.builder( + return ListView.separated( itemCount: formModel.serialNos!.length + 1, shrinkWrap: true, - padding: const EdgeInsets.only(left: 16, right: 16, bottom: 16, top: 8), + padding: EdgeInsets.zero, + physics: const NeverScrollableScrollPhysics(), + separatorBuilder: (context, index) => 12.height, itemBuilder: (context, index) { if (index == formModel.serialNos!.length) { return AppFilledButton( @@ -217,36 +229,33 @@ class _CostCenterFormViewState extends State { } Widget selectionButton() { - return Padding( - padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12), - child: Row( - children: [ - Expanded( - child: _radioItem( - value: CostCenterType.costCenter, - groupValue: _selectedType, - title: 'Cost Center', - onTap: () { - setState(() { - _selectedType = CostCenterType.costCenter; - }); - }, - ), + return Row( + children: [ + Expanded( + child: _radioItem( + value: CostCenterType.costCenter, + groupValue: _selectedType, + title: 'Cost Center', + onTap: () { + setState(() { + _selectedType = CostCenterType.costCenter; + }); + }, ), - Expanded( - child: _radioItem( - value: CostCenterType.serialNumber, - groupValue: _selectedType, - title: 'Serial Number', - onTap: () { - setState(() { - _selectedType = CostCenterType.serialNumber; - }); - }, - ), + ), + Expanded( + child: _radioItem( + value: CostCenterType.serialNumber, + groupValue: _selectedType, + title: 'Serial Number', + onTap: () { + setState(() { + _selectedType = CostCenterType.serialNumber; + }); + }, ), - ], - ), + ), + ], ); } @@ -263,6 +272,13 @@ class _CostCenterFormViewState extends State { children: [ Radio( value: value, + activeColor: AppColor.primary10, + fillColor: WidgetStateColor.resolveWith((states) { + if (states.contains(WidgetState.selected)) { + return AppColor.primary10; // Thumb color when selected + } + return AppColor.icon2Color(context); // Thumb color when unselected (grey) + }), groupValue: groupValue, onChanged: (_) => onTap(), materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, @@ -279,34 +295,12 @@ class _CostCenterFormViewState extends State { return Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, + spacing: 4, children: [ - Text( - 'Item No'.addTranslation, - style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral30 : AppColor.black10), - ), - 8.height, - Text( - widget.itemNo ?? '-', - style: AppTextStyles.bodyText2.copyWith(color: context.isDark ? AppColor.neutral30 : AppColor.neutral120), - ), - 8.height, - Text( - 'Item Description'.addTranslation, - style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral30 : AppColor.black10), - ), - 8.height, - Text( - widget.itemDescription ?? '-', - style: AppTextStyles.bodyText2.copyWith(color: context.isDark ? AppColor.neutral30 : AppColor.neutral120), - ), + InfoTextWidget(label: "Item No", value: "\n${widget.itemNo ?? '-'}"), + InfoTextWidget(label: "Item Description", value: "\n${widget.itemDescription ?? '-'}"), ], - ).toShadowContainer( - context, - borderRadius: 20, - padding: 12, - showShadow: false, - margin: const EdgeInsets.only(left: 16, right: 16, top: 16, bottom: 8), - ); + ).toShadowContainer(context); } } @@ -354,34 +348,34 @@ class CostCenterItemCard extends StatelessWidget { children: [ isHmg == true ? SingleItemDropDownMenu( - context: context, - height: 56.toScreenHeight, - title: 'Cost Center'.addTranslation, - showShadow: false, - backgroundColor: AppColor.fieldBgColor(context), - requestById: requestId, - showAsBottomSheet: true, - matchBy: DropDownMatchType.name, - initialValue: model.costCenter, - onSelect: (status) { - if (status != null) { - model.costCenter = status; - model.costCenterName = status.name; - } - }, - ) + context: context, + height: 56.toScreenHeight, + title: 'Cost Center'.addTranslation, + showShadow: false, + backgroundColor: AppColor.fieldBgColor(context), + requestById: requestId, + showAsBottomSheet: true, + matchBy: DropDownMatchType.name, + initialValue: model.costCenter, + onSelect: (status) { + if (status != null) { + model.costCenter = status; + model.costCenterName = status.name; + } + }, + ) : AppTextFormField( - labelText: 'Cost Center'.addTranslation, - backgroundColor: AppColor.fieldBgColor(context), - initialValue: model.costCenterName ?? '', - textAlign: TextAlign.center, - labelStyle: AppTextStyles.textFieldLabelStyle, - showShadow: false, - onChange: (value) { - model.costCenterName = value; - }, - style: Theme.of(context).textTheme.titleMedium, - ), + labelText: 'Cost Center'.addTranslation, + backgroundColor: AppColor.fieldBgColor(context), + initialValue: model.costCenterName ?? '', + textAlign: TextAlign.center, + labelStyle: AppTextStyles.textFieldLabelStyle, + showShadow: false, + onChange: (value) { + model.costCenterName = value; + }, + style: Theme.of(context).textTheme.titleMedium, + ), 8.height, AppTextFormField( labelText: 'Quantity'.addTranslation, @@ -402,7 +396,7 @@ class CostCenterItemCard extends StatelessWidget { ], ) ], - ).toShadowContainer(context, paddingObject: const EdgeInsets.symmetric(horizontal: 12, vertical: 12)).paddingOnly(bottom: 12); + ).toShadowContainer(context); } } @@ -447,11 +441,6 @@ class SerialNumberItemCard extends StatelessWidget { style: Theme.of(context).textTheme.titleMedium, ), ], - ) - .toShadowContainer( - context, - paddingObject: const EdgeInsets.symmetric(horizontal: 12, vertical: 12), - ) - .paddingOnly(bottom: 12); + ).toShadowContainer(context); } } 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,