From 5a61d52455d1000c6dae913001fce6eb7e880c81 Mon Sep 17 00:00:00 2001 From: Sikander Saleem Date: Mon, 11 May 2026 09:15:15 +0300 Subject: [PATCH] improvements --- .../pages/asset_inventory_form_view.dart | 2 +- .../pages/cleaner_request_item_view.dart | 2 +- .../forms/spare_part/spare_part_request.dart | 2 +- .../pm_module/ppm_wo/ppm_details_page.dart | 2 +- .../ppm_calibration_tools_form.dart | 2 +- .../update_ppm/ppm_external_details_form.dart | 2 +- .../update_ppm/ppm_pm_check_list_form.dart | 2 +- .../ppm_wo/update_ppm/ppm_pm_kits_form.dart | 2 +- .../device_transfer/device_filter_screen.dart | 204 +++++++++--------- .../device_transfer/device_search_screen.dart | 67 +++--- .../device_transfer_details.dart | 4 +- .../gas_refill/create_gas_refill_request.dart | 2 +- .../gas_refill/gas_refill_request_form.dart | 4 +- .../common_widgets/asset_info_card.dart | 2 +- lib/new_views/pages/help_center_page.dart | 2 +- .../calender_fragments/calendar_header.dart | 2 +- .../my_request/all_requests_filter_page.dart | 8 +- lib/new_views/pages/report_bug_page.dart | 2 +- lib/new_views/pages/settings_page.dart | 6 +- lib/new_views/pages/unsafe_device_view.dart | 2 +- .../swipe_module/mark_attendance_widget.dart | 2 +- lib/views/pages/user/profile_page.dart | 4 +- .../requests/create_service_request_page.dart | 2 +- .../asset_detail_bottom_sheet.dart | 2 +- .../widgets/equipment/asset_detail_page.dart | 2 +- ...buttons.dart => asset_status_buttons.dart} | 24 +-- .../multiple_selection_fullscreen_dialog.dart | 2 +- .../selection_fullscreen_dialog.dart | 2 +- 28 files changed, 179 insertions(+), 182 deletions(-) rename lib/views/widgets/equipment/{commissioning_status_buttons.dart => asset_status_buttons.dart} (86%) diff --git a/lib/modules/asset_inventory_module/pages/asset_inventory_form_view.dart b/lib/modules/asset_inventory_module/pages/asset_inventory_form_view.dart index 5bf1ede2..52c7cfa2 100644 --- a/lib/modules/asset_inventory_module/pages/asset_inventory_form_view.dart +++ b/lib/modules/asset_inventory_module/pages/asset_inventory_form_view.dart @@ -92,7 +92,7 @@ class _AssetInventoryFormViewState extends State { Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - 'Not Registered'.addTranslation.heading5(context), + 'Not Registered'.addTranslation.heading5(context).custom(color: AppColor.textStyleColor(context)), AdvancedSwitch( controller: registeredController, activeColor: AppColor.green50.withOpacity(0.5), diff --git a/lib/modules/cleaner_module/pages/cleaner_request_item_view.dart b/lib/modules/cleaner_module/pages/cleaner_request_item_view.dart index 96d0eb05..56f5d1bd 100644 --- a/lib/modules/cleaner_module/pages/cleaner_request_item_view.dart +++ b/lib/modules/cleaner_module/pages/cleaner_request_item_view.dart @@ -23,7 +23,7 @@ class CleanerRequestItemView extends StatelessWidget { Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - if (result.taskNo != null && result.taskNo!.isNotEmpty) result.taskNo!.heading5(context), + if (result.taskNo != null && result.taskNo!.isNotEmpty) result.taskNo!.heading5(context).custom(color: AppColor.textStyleColor(context)), if (result.createdDate != null) Text( result.createdDate!.split('T').first, diff --git a/lib/modules/cm_module/views/forms/spare_part/spare_part_request.dart b/lib/modules/cm_module/views/forms/spare_part/spare_part_request.dart index 289d4778..1821a20b 100644 --- a/lib/modules/cm_module/views/forms/spare_part/spare_part_request.dart +++ b/lib/modules/cm_module/views/forms/spare_part/spare_part_request.dart @@ -137,7 +137,7 @@ class _SparePartRequestState extends State with TickerProvider child: Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ - context.translation.sparePartDetails.heading5(context), + context.translation.sparePartDetails.heading5(context).custom(color: AppColor.textStyleColor(context)), // 12.height, // SingleItemDropDownMenu( // context: context, diff --git a/lib/modules/pm_module/ppm_wo/ppm_details_page.dart b/lib/modules/pm_module/ppm_wo/ppm_details_page.dart index 85b1d569..1670fe26 100644 --- a/lib/modules/pm_module/ppm_wo/ppm_details_page.dart +++ b/lib/modules/pm_module/ppm_wo/ppm_details_page.dart @@ -90,7 +90,7 @@ class _PpmDetailsPageState extends State { ], ), 8.height, - planPreventiveVisit.assetName!.cleanupWhitespace.capitalizeFirstOfEach.heading5(context), + planPreventiveVisit.assetName!.cleanupWhitespace.capitalizeFirstOfEach.heading5(context).custom(color: AppColor.textStyleColor(context)), 8.height, '${context.translation.assetNumber}: ${planPreventiveVisit.asset!.assetNumber}'.bodyText(context), '${context.translation.assetSN}: ${planPreventiveVisit.asset!.assetSerialNo}'.bodyText(context), diff --git a/lib/modules/pm_module/ppm_wo/update_ppm/ppm_calibration_tools_form.dart b/lib/modules/pm_module/ppm_wo/update_ppm/ppm_calibration_tools_form.dart index ad460de5..34fedcad 100644 --- a/lib/modules/pm_module/ppm_wo/update_ppm/ppm_calibration_tools_form.dart +++ b/lib/modules/pm_module/ppm_wo/update_ppm/ppm_calibration_tools_form.dart @@ -80,7 +80,7 @@ class _PpmCalibrationToolsFormState extends State { Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - (index == 0 ? "$currentIndex /$totalTabs . Calibration Tools" : "").heading5(context), + (index == 0 ? "$currentIndex /$totalTabs . Calibration Tools" : "").heading5(context).custom(color: AppColor.textStyleColor(context)), "trash".toSvgAsset(height: 20, width: 15).onPress(() { widget.models!.remove(model); setState(() {}); diff --git a/lib/modules/pm_module/ppm_wo/update_ppm/ppm_external_details_form.dart b/lib/modules/pm_module/ppm_wo/update_ppm/ppm_external_details_form.dart index a3154b94..c6289512 100644 --- a/lib/modules/pm_module/ppm_wo/update_ppm/ppm_external_details_form.dart +++ b/lib/modules/pm_module/ppm_wo/update_ppm/ppm_external_details_form.dart @@ -134,7 +134,7 @@ class _ExternalDetailItemState extends State { Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - (widget.index == 0 ? "1 /4 . External Details" : "").heading5(context), + (widget.index == 0 ? "1 /4 . External Details" : "").heading5(context).custom(color: AppColor.textStyleColor(context)), Container( height: 32, width: 32, diff --git a/lib/modules/pm_module/ppm_wo/update_ppm/ppm_pm_check_list_form.dart b/lib/modules/pm_module/ppm_wo/update_ppm/ppm_pm_check_list_form.dart index 9f5b0e63..f27968c6 100644 --- a/lib/modules/pm_module/ppm_wo/update_ppm/ppm_pm_check_list_form.dart +++ b/lib/modules/pm_module/ppm_wo/update_ppm/ppm_pm_check_list_form.dart @@ -50,7 +50,7 @@ class _PpmPmChecklistFormState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ if (index == 0) ...[ - "$currentIndex /$totalTabs . PM Checklist".heading5(context), + "$currentIndex /$totalTabs . PM Checklist".heading5(context).custom(color: AppColor.textStyleColor(context)), 16.height, ], AppTextFormField( diff --git a/lib/modules/pm_module/ppm_wo/update_ppm/ppm_pm_kits_form.dart b/lib/modules/pm_module/ppm_wo/update_ppm/ppm_pm_kits_form.dart index a25e4d4a..022c4125 100644 --- a/lib/modules/pm_module/ppm_wo/update_ppm/ppm_pm_kits_form.dart +++ b/lib/modules/pm_module/ppm_wo/update_ppm/ppm_pm_kits_form.dart @@ -78,7 +78,7 @@ class _PpmPMKitsFormState extends State { Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - (index == 0 ? "$currentIndex /$totalTabs . PM Kits" : "").heading5(context), + (index == 0 ? "$currentIndex /$totalTabs . PM Kits" : "").heading5(context).custom(color: AppColor.textStyleColor(context)), Container( height: 32, width: 32, diff --git a/lib/modules/tm_module/device_transfer/device_filter_screen.dart b/lib/modules/tm_module/device_transfer/device_filter_screen.dart index f03cc64a..0616e728 100644 --- a/lib/modules/tm_module/device_transfer/device_filter_screen.dart +++ b/lib/modules/tm_module/device_transfer/device_filter_screen.dart @@ -7,13 +7,14 @@ import 'package:test_sa/extensions/text_extensions.dart'; import 'package:test_sa/extensions/widget_extensions.dart'; import 'package:test_sa/models/lookup.dart'; import 'package:test_sa/models/new_models/site.dart'; +import 'package:test_sa/modules/cm_module/views/components/action_button/footer_action_button.dart'; import 'package:test_sa/new_views/app_style/app_color.dart'; import 'package:test_sa/new_views/common_widgets/app_filled_button.dart'; import 'package:test_sa/new_views/common_widgets/multiple_item_drop_down_menu.dart'; import 'package:test_sa/providers/department_provider.dart'; import 'package:test_sa/providers/gas_request_providers/site_provider.dart'; import 'package:test_sa/views/widgets/date_and_time/date_picker.dart'; -import 'package:test_sa/views/widgets/equipment/commissioning_status_buttons.dart'; +import 'package:test_sa/views/widgets/equipment/asset_status_buttons.dart'; import '../../../models/device/asset_search.dart'; import '../../../new_views/common_widgets/app_lazy_loading.dart'; @@ -69,115 +70,110 @@ class _DeviceFilterScreenState extends State { @override Widget build(BuildContext context) { - return SafeArea( - top: false, - child: Scaffold( - appBar: DefaultAppBar( - title: context.translation.filter, - actions: [ - if (loading == false && _showResetButton()) - TextButton( - onPressed: () { - setState(() { - startDate = null; - endDate = null; - _selectedDepartments = []; - _selectedSites = []; - _commissioningStatus = null; - }); + return Scaffold( + appBar: DefaultAppBar( + title: context.translation.filter, + actions: [ + if (loading == false && _showResetButton()) + TextButton( + onPressed: () { + setState(() { + startDate = null; + endDate = null; + _selectedDepartments = []; + _selectedSites = []; + _commissioningStatus = null; + }); + }, + style: TextButton.styleFrom(padding: EdgeInsets.zero, tapTargetSize: MaterialTapTargetSize.shrinkWrap), + child: Text( + 'Clear Filters', + style: AppTextStyles.bodyText2.copyWith(color: AppColor.primary10), + ), + ).paddingOnly(start: 16, end: 16) + ], + ), + body: Column( + children: [ + ListView( + padding: const EdgeInsets.all(16), + children: [ + AssetStatusButtons( + initialValue: _commissioningStatus, + onSelect: (value) { + if (value != null) { + _commissioningStatus = value; + } + }, + ), + 16.height, + MultipleItemDropDownMenu( + context: context, + title: context.translation.byDepartment, + showAsBottomSheet: true, + backgroundColor: context.isDark ? AppColor.neutral60 : Colors.white, + // backgroundColor: AppColor.fieldBgColor(context), + showShadow: true, + height: 56.toScreenHeight, + showCancel: true, + onSelect: (value) { + if (value != null) { + setState(() { + _selectedDepartments = value; + }); + } }, - style: TextButton.styleFrom(padding: EdgeInsets.zero, tapTargetSize: MaterialTapTargetSize.shrinkWrap), - child: Text( - 'Clear Filters', - style: AppTextStyles.bodyText2.copyWith(color: AppColor.primary10), - ), - ).paddingOnly(start: 16, end: 16) - ], - ), - body: Column( - children: [ - SingleChildScrollView( - child: Column( - crossAxisAlignment: CrossAxisAlignment.stretch, + ), + 12.height, + MultipleItemDropDownMenu( + context: context, + title: context.translation.bySite, + showAsBottomSheet: true, + // backgroundColor: AppColor.fieldBgColor(context), + backgroundColor: context.isDark ? AppColor.neutral60 : Colors.white, + showShadow: true, + height: 56.toScreenHeight, + showCancel: true, + onSelect: (value) { + if (value != null) { + setState(() { + _selectedSites = value; + }); + } + }, + ), + 16.height, + context.translation.pmDateRange.heading5(context).custom(color: AppColor.textStyleColor(context)), + 8.height, + Row( children: [ - CommissioningStatusButtons( - initialValue: _commissioningStatus, - onSelect: (value) { - if (value != null) { - _commissioningStatus = value; - } - }, - ), - 16.height, - MultipleItemDropDownMenu( - context: context, - title: context.translation.byDepartment, - showAsBottomSheet: true, - backgroundColor: context.isDark ? AppColor.neutral60 : Colors.white, - // backgroundColor: AppColor.fieldBgColor(context), - showShadow: true, - height: 56.toScreenHeight, - showCancel: true, - onSelect: (value) { - if (value != null) { - setState(() { - _selectedDepartments = value; - }); - } + ADatePicker( + label: context.translation.to, + from: DateTime(2000), + date: DateTime.tryParse(startDate ?? ""), + onDatePicker: (date) { + setState(() { + startDate = date.toIso8601String(); + }); }, - ).paddingOnly(start: 16, end: 16), - 8.height, - MultipleItemDropDownMenu( - context: context, - title: context.translation.bySite, - showAsBottomSheet: true, - // backgroundColor: AppColor.fieldBgColor(context), - backgroundColor: context.isDark ? AppColor.neutral60 : Colors.white, - showShadow: true, - height: 56.toScreenHeight, - showCancel: true, - onSelect: (value) { - if (value != null) { - setState(() { - _selectedSites = value; - }); - } + ).expanded, + 8.width, + ADatePicker( + label: context.translation.to, + from: DateTime(2000), + date: DateTime.tryParse(endDate ?? ""), + onDatePicker: (date) { + setState(() { + endDate = date.toIso8601String(); + }); }, - ).paddingOnly(start: 16, end: 16), - 16.height, - context.translation.pmDateRange.heading5(context).paddingOnly(start: 16, end: 16), - 8.height, - Row( - children: [ - ADatePicker( - label: context.translation.to, - from: DateTime(2000), - date: DateTime.tryParse(startDate ?? ""), - onDatePicker: (date) { - setState(() { - startDate = date.toIso8601String(); - }); - }, - ).expanded, - 8.width, - ADatePicker( - label: context.translation.to, - from: DateTime(2000), - date: DateTime.tryParse(endDate ?? ""), - onDatePicker: (date) { - setState(() { - endDate = date.toIso8601String(); - }); - }, - ).expanded, - ], - ).paddingOnly(start: 16, end: 16), + ).expanded, ], ), - ).expanded, - AppFilledButton(onPressed: _search, label: context.translation.applyFilter).paddingOnly(start: 16, end: 16), - ], - ).paddingOnly(top: 16, bottom: 16), + ], + ).expanded, + FooterActionButton.footerContainer(context: context, child: AppFilledButton(onPressed: _search, label: context.translation.applyFilter)), + ], ), ); } diff --git a/lib/modules/tm_module/device_transfer/device_search_screen.dart b/lib/modules/tm_module/device_transfer/device_search_screen.dart index 56768834..d9f99f8d 100644 --- a/lib/modules/tm_module/device_transfer/device_search_screen.dart +++ b/lib/modules/tm_module/device_transfer/device_search_screen.dart @@ -5,6 +5,8 @@ import 'package:test_sa/extensions/context_extension.dart'; import 'package:test_sa/extensions/int_extensions.dart'; import 'package:test_sa/extensions/text_extensions.dart'; import 'package:test_sa/extensions/widget_extensions.dart'; +import 'package:test_sa/modules/cm_module/views/components/action_button/footer_action_button.dart'; +import 'package:test_sa/new_views/app_style/app_color.dart'; import 'package:test_sa/new_views/common_widgets/app_filled_button.dart'; import 'package:test_sa/new_views/common_widgets/app_text_form_field.dart'; @@ -62,39 +64,38 @@ class _DeviceSearchScreenState extends State { title: context.translation.search, actions: [ if (_showResetButton()) - Row( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Text( - context.translation.reset, - style: AppTextStyles.bodyText2.copyWith(color: const Color(0xFF4A8DB7)), - ).paddingAll(8).onPress(() { - setState(() { - _assetNameController.text = ""; - _assetNumberController.text = ""; - _snController.text = ""; - _modelController.text = ""; - _supplierController.text = ""; - _siteController.text = ""; - _manufactureController.text = ""; - _mdController.text = ""; - }); - }), - ], - ) + TextButton( + onPressed: () { + setState(() { + _assetNameController.text = ""; + _assetNumberController.text = ""; + _snController.text = ""; + _modelController.text = ""; + _supplierController.text = ""; + _siteController.text = ""; + _manufactureController.text = ""; + _mdController.text = ""; + }); + }, + style: TextButton.styleFrom(padding: EdgeInsets.zero, tapTargetSize: MaterialTapTargetSize.shrinkWrap), + child: Text( + 'Clear Filters', + style: AppTextStyles.bodyText2.copyWith(color: AppColor.primary10), + ), + ).paddingOnly(start: 16, end: 16), ], ), body: Form( key: _formKey, - child: Column( - children: [ - SingleChildScrollView( - child: Column( - crossAxisAlignment: CrossAxisAlignment.stretch, + child: SafeArea( + child: Column( + children: [ + ListView( + padding: const EdgeInsets.all(16), children: [ - context.translation.searchBy.heading5(context), - 8.height, - context.translation.searchByDesc.bodyText(context), + context.translation.searchBy.heading5(context).custom(color: AppColor.textStyleColor(context)), + 4.height, + context.translation.searchByDesc.bodyText2(context).custom(color: AppColor.lightTextColor(context)), 16.height, AppTextFormField( controller: _assetNameController, @@ -215,11 +216,11 @@ class _DeviceSearchScreenState extends State { ), 8.height, ], - ), - ).expanded, - AppFilledButton(onPressed: _search, label: context.translation.search), - ], - ).paddingAll(16), + ).expanded, + FooterActionButton.footerContainer(context: context, child: AppFilledButton(onPressed: _search, label: context.translation.search)), + ], + ), + ), ), ); } diff --git a/lib/modules/tm_module/device_transfer/device_transfer_details.dart b/lib/modules/tm_module/device_transfer/device_transfer_details.dart index 00d6738e..acb1e613 100644 --- a/lib/modules/tm_module/device_transfer/device_transfer_details.dart +++ b/lib/modules/tm_module/device_transfer/device_transfer_details.dart @@ -252,7 +252,7 @@ class _DeviceTransferDetailsState extends State { ], ), 8.height, - context.translation.workOrderDetails.heading5(context), + context.translation.workOrderDetails.heading5(context).custom(color: AppColor.textStyleColor(context)), infoText(label: context.translation.destinationSite, value: _model?.senderSiteName), // infoText(label: "Sender Building".addTranslation, value: _model?.senderBuildingName), // infoText(label: "Sender Floor".addTranslation, value: _model?.senderFloorName), @@ -332,7 +332,7 @@ class _DeviceTransferDetailsState extends State { children: [ statusLabel ?? Container(), if (statusLabel != null) 8.height, - isSender ? context.translation.senderDetails.heading5(context) : context.translation.receiverDetails.heading5(context), + isSender ? context.translation.senderDetails.heading5(context) : context.translation.receiverDetails.heading5(context).custom(color: AppColor.textStyleColor(context)), ], ).expanded, if (context.userProvider.isEngineer || context.userProvider.isNurse) diff --git a/lib/modules/tm_module/gas_refill/create_gas_refill_request.dart b/lib/modules/tm_module/gas_refill/create_gas_refill_request.dart index fb1daeb8..6d2e7c90 100644 --- a/lib/modules/tm_module/gas_refill/create_gas_refill_request.dart +++ b/lib/modules/tm_module/gas_refill/create_gas_refill_request.dart @@ -242,7 +242,7 @@ class _RequestGasRefillState extends State { Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - context.translation.gasRefill.heading5(context), + context.translation.gasRefill.heading5(context).custom(color: AppColor.textStyleColor(context)), 8.height, '${context.translation.gasRequest}: ${widget.gasRefillModel!.gasRefillDetails![0].gasType!.name}'.bodyText(context), '${context.translation.cylinderType}: ${widget.gasRefillModel!.gasRefillDetails![0].cylinderType!.name}'.bodyText(context), diff --git a/lib/modules/tm_module/gas_refill/gas_refill_request_form.dart b/lib/modules/tm_module/gas_refill/gas_refill_request_form.dart index 1d61deca..8b6814c8 100644 --- a/lib/modules/tm_module/gas_refill/gas_refill_request_form.dart +++ b/lib/modules/tm_module/gas_refill/gas_refill_request_form.dart @@ -300,7 +300,7 @@ class _GasRefillRequestFormState extends State { // Column( // crossAxisAlignment: CrossAxisAlignment.start, // children: [ -// (_gasModel.gasRefillDetails![index].gasType?.name ?? "").heading5(context), +// (_gasModel.gasRefillDetails![index].gasType?.name ?? "").heading5(context).custom(color: AppColor.textStyleColor(context)), // 8.height, // ("${context.translation.quantity}: ${_gasModel.gasRefillDetails![index].requestedQty}").bodyText(context), // ("${context.translation.cylinderSize}: ${_gasModel.gasRefillDetails![index].cylinderSize?.name}").bodyText(context), @@ -655,7 +655,7 @@ class _GasRefillRequestFormState extends State { // // Column( // // crossAxisAlignment: CrossAxisAlignment.start, // // children: [ -// // (_gasModel.gasRefillDetails![index].gasType?.name ?? "").heading5(context), +// // (_gasModel.gasRefillDetails![index].gasType?.name ?? "").heading5(context).custom(color: AppColor.textStyleColor(context)), // // 8.height, // // ("${context.translation.quantity}: ${_gasModel.gasRefillDetails![index].requestedQty}").bodyText(context), // // ("${context.translation.cylinderSize}: ${_gasModel.gasRefillDetails![index].cylinderSize?.name}").bodyText(context), diff --git a/lib/new_views/common_widgets/asset_info_card.dart b/lib/new_views/common_widgets/asset_info_card.dart index c3400768..c76c7a5b 100644 --- a/lib/new_views/common_widgets/asset_info_card.dart +++ b/lib/new_views/common_widgets/asset_info_card.dart @@ -16,7 +16,7 @@ class AssetInfoCard extends StatelessWidget { return Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ - (asset.modelDefinition?.assetName?.cleanupWhitespace.capitalizeFirstOfEach ?? "").heading5(context), + (asset.modelDefinition?.assetName?.cleanupWhitespace.capitalizeFirstOfEach ?? "").heading5(context).custom(color: AppColor.textStyleColor(context)), 8.height, "${context.translation.assetNo}: ${asset.assetNumber}".bodyText(context), "${context.translation.manufacture}: ${asset.modelDefinition?.manufacturerName}".bodyText(context), diff --git a/lib/new_views/pages/help_center_page.dart b/lib/new_views/pages/help_center_page.dart index d8c78acf..6b0d00ef 100644 --- a/lib/new_views/pages/help_center_page.dart +++ b/lib/new_views/pages/help_center_page.dart @@ -41,7 +41,7 @@ class HelpCenterPage extends StatelessWidget { return Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - title.heading5(context), + title.heading5(context).custom(color: AppColor.textStyleColor(context)), "arrow_right".toSvgAsset(width: 17), ], ); diff --git a/lib/new_views/pages/land_page/calender_fragments/calendar_header.dart b/lib/new_views/pages/land_page/calender_fragments/calendar_header.dart index fd0934e2..c65109c1 100644 --- a/lib/new_views/pages/land_page/calender_fragments/calendar_header.dart +++ b/lib/new_views/pages/land_page/calender_fragments/calendar_header.dart @@ -19,7 +19,7 @@ class CalendarHeader extends StatelessWidget { children: [ Row( children: [ - dateFormat.format(dateTime).heading5(context), + dateFormat.format(dateTime).heading5(context).custom(color: AppColor.textStyleColor(context)), 6.width, Align(alignment: AlignmentDirectional.centerEnd, child: Icon(Icons.keyboard_arrow_down_sharp, color: context.isDark ? AppColor.neutral10 : AppColor.neutral60, size: 24)), const Spacer(), diff --git a/lib/new_views/pages/land_page/my_request/all_requests_filter_page.dart b/lib/new_views/pages/land_page/my_request/all_requests_filter_page.dart index b4e06e08..61e4e63a 100644 --- a/lib/new_views/pages/land_page/my_request/all_requests_filter_page.dart +++ b/lib/new_views/pages/land_page/my_request/all_requests_filter_page.dart @@ -166,7 +166,7 @@ class _AllRequestsFilterPageState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ - "WO Status".heading5(context), + "WO Status".heading5(context).custom(color: AppColor.textStyleColor(context)), 8.height, RequestsTypeFilter( initialValues: search?.statuses ?? [], @@ -183,7 +183,7 @@ class _AllRequestsFilterPageState extends State { }, ), 16.height, - "Type of WO".heading5(context), + "Type of WO".heading5(context).custom(color: AppColor.textStyleColor(context)), 8.height, RequestsTypeFilter( initialValues: search?.typeTransaction ?? [], @@ -194,7 +194,7 @@ class _AllRequestsFilterPageState extends State { }, ), 16.height, - context.translation.pickDate.heading5(context), + context.translation.pickDate.heading5(context).custom(color: AppColor.textStyleColor(context)), 8.height, Row( children: [ @@ -226,7 +226,7 @@ class _AllRequestsFilterPageState extends State { ], ), 16.height, - // "Archived WO".heading5(context), + // "Archived WO".heading5(context).custom(color: AppColor.textStyleColor(context)), // // 8.height, // Row( // children: [ diff --git a/lib/new_views/pages/report_bug_page.dart b/lib/new_views/pages/report_bug_page.dart index f7df033b..55c1a380 100644 --- a/lib/new_views/pages/report_bug_page.dart +++ b/lib/new_views/pages/report_bug_page.dart @@ -31,7 +31,7 @@ class ReportBugPage extends StatelessWidget { mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.stretch, children: [ - user.clientName!.heading5(context), + user.clientName!.heading5(context).custom(color: AppColor.textStyleColor(context)), 8.height, "Call ID: ${0}".bodyText(context), "Date of Survey: ${DateFormat("dd MMM, yyyy").format(DateTime.now())}".bodyText(context), diff --git a/lib/new_views/pages/settings_page.dart b/lib/new_views/pages/settings_page.dart index 15bf5f98..790785b3 100644 --- a/lib/new_views/pages/settings_page.dart +++ b/lib/new_views/pages/settings_page.dart @@ -105,7 +105,7 @@ class _SettingsPageState extends State { Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - context.translation.arabic.heading5(context), + context.translation.arabic.heading5(context).custom(color: AppColor.textStyleColor(context)), AdvancedSwitch( controller: langController, activeColor: AppColor.green50.withOpacity(0.5), @@ -127,7 +127,7 @@ class _SettingsPageState extends State { Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - context.translation.lightTheme.heading5(context), + context.translation.lightTheme.heading5(context).custom(color: AppColor.textStyleColor(context)), AdvancedSwitch( controller: themeController, activeColor: AppColor.green50.withOpacity(0.5), @@ -158,7 +158,7 @@ class _SettingsPageState extends State { return Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - "Fingerprint/Face ID".heading5(context), + "Fingerprint/Face ID".heading5(context).custom(color: AppColor.textStyleColor(context)), customSwitch(localAuth).onPress(() { checkForLocalAuth(localAuth); }), diff --git a/lib/new_views/pages/unsafe_device_view.dart b/lib/new_views/pages/unsafe_device_view.dart index 6b482553..2f6d2f10 100644 --- a/lib/new_views/pages/unsafe_device_view.dart +++ b/lib/new_views/pages/unsafe_device_view.dart @@ -32,7 +32,7 @@ class _UnsafeDeviceScreenState extends State { // Center(child: Image.asset("assets/images/logos/main_mohemm_logo.png", width: 200, height: 50)), "logo".toSvgAsset(height: 64), 50.height, - "Sorry".heading5(context), + "Sorry".heading5(context).custom(color: AppColor.textStyleColor(context)), 21.height, "You are using Atoms app on an unsafe device. To be able to use the app with all it's features, Please make sure that the below points are considered: " .heading5(context).paddingOnly(start: 20, end: 20), diff --git a/lib/new_views/swipe_module/mark_attendance_widget.dart b/lib/new_views/swipe_module/mark_attendance_widget.dart index 6a6740e8..7ebe6b6a 100644 --- a/lib/new_views/swipe_module/mark_attendance_widget.dart +++ b/lib/new_views/swipe_module/mark_attendance_widget.dart @@ -144,7 +144,7 @@ // mainAxisSize: MainAxisSize.min, // children: [ // 20.height, -// 'click me '.heading5(context), +// 'click me '.heading5(context).custom(color: AppColor.textStyleColor(context)), // // LocaleKeys.markAttendance.tr().toSectionHeading(), // // LocaleKeys.selectMethodOfAttendance.tr().toText11(color: const Color(0xff535353)), // GridView( diff --git a/lib/views/pages/user/profile_page.dart b/lib/views/pages/user/profile_page.dart index 8c86ed1c..62911777 100644 --- a/lib/views/pages/user/profile_page.dart +++ b/lib/views/pages/user/profile_page.dart @@ -163,13 +163,13 @@ class _ProfilePageState extends State { // if ((_user.phoneNumber ?? "").isNotEmpty) ...[ // const Divider().defaultStyle(context), // 8.height, - // (_user.phoneNumber??"").heading5(context), + // (_user.phoneNumber??"").heading5(context).custom(color: AppColor.textStyleColor(context)), // 8.height, // ], // if ((_user.extensionNo ?? "").isNotEmpty) ...[ // const Divider().defaultStyle(context), // 8.height, - // _user.extensionNo!.heading5(context), + // _user.extensionNo!.heading5(context).custom(color: AppColor.textStyleColor(context)), // 8.height, // ], if ((_user.departmentName?.length ?? 0) > 0) const Divider().defaultStyle(context), diff --git a/lib/views/pages/user/requests/create_service_request_page.dart b/lib/views/pages/user/requests/create_service_request_page.dart index dee41f1f..3c94b7de 100644 --- a/lib/views/pages/user/requests/create_service_request_page.dart +++ b/lib/views/pages/user/requests/create_service_request_page.dart @@ -291,7 +291,7 @@ // // // Align( // // alignment: AlignmentDirectional.centerStart, -// // child: context.translation.callComments.heading5(context), +// // child: context.translation.callComments.heading5(context).custom(color: AppColor.textStyleColor(context)), // // ), // 8.height, // // SpeechToTextButton( 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 c0192cd1..fd203840 100644 --- a/lib/views/widgets/bottom_sheets/asset_detail_bottom_sheet.dart +++ b/lib/views/widgets/bottom_sheets/asset_detail_bottom_sheet.dart @@ -23,7 +23,7 @@ class AssetDetailBottomSheet extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: [ - (asset?.modelDefinition?.assetName?.cleanupWhitespace.capitalizeFirstOfEach ?? "-").heading5(context), + (asset?.modelDefinition?.assetName?.cleanupWhitespace.capitalizeFirstOfEach ?? "-").heading5(context).custom(color: AppColor.textStyleColor(context)), 16.height, AspectRatio( aspectRatio: 358 / 136, diff --git a/lib/views/widgets/equipment/asset_detail_page.dart b/lib/views/widgets/equipment/asset_detail_page.dart index f0b095fb..6db652dd 100644 --- a/lib/views/widgets/equipment/asset_detail_page.dart +++ b/lib/views/widgets/equipment/asset_detail_page.dart @@ -96,7 +96,7 @@ class _AssetDetailPageState extends State { backgroundColor: AppColor.getRequestStatusColorByName(context, assetModel.commissioningStatus!.name!), ), if (assetModel.commissioningStatus != null) 8.height, - (assetModel.modelDefinition?.assetName?.cleanupWhitespace.capitalizeFirstOfEach ?? "-").heading5(context), + (assetModel.modelDefinition?.assetName?.cleanupWhitespace.capitalizeFirstOfEach ?? "-").heading5(context).custom(color: AppColor.textStyleColor(context)), 8.height, Row( crossAxisAlignment: CrossAxisAlignment.start, diff --git a/lib/views/widgets/equipment/commissioning_status_buttons.dart b/lib/views/widgets/equipment/asset_status_buttons.dart similarity index 86% rename from lib/views/widgets/equipment/commissioning_status_buttons.dart rename to lib/views/widgets/equipment/asset_status_buttons.dart index e0ba6565..ca16d654 100644 --- a/lib/views/widgets/equipment/commissioning_status_buttons.dart +++ b/lib/views/widgets/equipment/asset_status_buttons.dart @@ -10,17 +10,17 @@ import '../../../models/lookup.dart'; import '../../../new_views/app_style/app_color.dart'; import '../../../providers/service_request_providers/commissioning_status_provider.dart'; -class CommissioningStatusButtons extends StatefulWidget { +class AssetStatusButtons extends StatefulWidget { final Function(Lookup?)? onSelect; final Lookup? initialValue; - const CommissioningStatusButtons({Key? key, this.onSelect, this.initialValue}) : super(key: key); + const AssetStatusButtons({Key? key, this.onSelect, this.initialValue}) : super(key: key); @override - State createState() => _CommissioningStatusButtonsState(); + State createState() => _AssetStatusButtonsState(); } -class _CommissioningStatusButtonsState extends State { +class _AssetStatusButtonsState extends State { int _selectedIndex = 0; @override @@ -36,7 +36,7 @@ class _CommissioningStatusButtonsState extends State } @override - void didUpdateWidget(covariant CommissioningStatusButtons oldWidget) { + void didUpdateWidget(covariant AssetStatusButtons oldWidget) { if (widget.initialValue != oldWidget.initialValue) { final provider = Provider.of(context, listen: false); if (widget.initialValue != null) { @@ -54,7 +54,7 @@ class _CommissioningStatusButtonsState extends State return Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ - context.translation.assetStatus.heading5(context).paddingOnly(start: 16, end: 16), + context.translation.assetStatus.heading5(context).custom(color: AppColor.textStyleColor(context)), 8.height, Consumer( builder: (context, snapshot, _) { @@ -69,17 +69,18 @@ class _CommissioningStatusButtonsState extends State 8.width, const _Skelton().expanded, ], - ).paddingOnly(start: 16, end: 16), + ), ) : SizedBox( height: 36.toScreenHeight, - child: ListView.builder( + child: ListView.separated( itemCount: snapshot.items.length + 1, scrollDirection: Axis.horizontal, shrinkWrap: true, - padding: EdgeInsetsDirectional.only(start: 16.toScreenWidth), + padding: EdgeInsetsDirectional.only(start: 0.toScreenWidth), + separatorBuilder: (cxt, index) => 8.width, itemBuilder: (context, index) => Container( - margin: EdgeInsets.symmetric(horizontal: 4.toScreenWidth), + margin: EdgeInsets.symmetric(horizontal: 0.toScreenWidth), padding: EdgeInsets.symmetric(vertical: 8.toScreenHeight, horizontal: 12.toScreenWidth), alignment: Alignment.center, // foregroundDecoration: _selectedIndex != index @@ -104,8 +105,7 @@ class _CommissioningStatusButtonsState extends State // color: AppColor.filterButtonTextColor(context) - color: _selectedIndex == index ? AppColor.primary10 : AppColor.filterButtonTextColor(context) - ), + color: _selectedIndex == index ? AppColor.primary10 : AppColor.filterButtonTextColor(context)), ).onPress(() { setState(() { _selectedIndex = index; diff --git a/lib/views/widgets/fullscreen_dialogs/multiple_selection_fullscreen_dialog.dart b/lib/views/widgets/fullscreen_dialogs/multiple_selection_fullscreen_dialog.dart index bc6da6f9..2bb2cd87 100644 --- a/lib/views/widgets/fullscreen_dialogs/multiple_selection_fullscreen_dialog.dart +++ b/lib/views/widgets/fullscreen_dialogs/multiple_selection_fullscreen_dialog.dart @@ -54,7 +54,7 @@ class _SelectionBottomSheetState extends State extends State