From 618a27ab4da49797df747f553e867d1dad87cf2e Mon Sep 17 00:00:00 2001 From: Faiz Hashmi Date: Thu, 5 Dec 2024 18:00:48 +0300 Subject: [PATCH] addnew service fix --- assets/langs/ar-SA.json | 5 +- assets/langs/en-US.json | 5 +- lib/generated/codegen_loader.g.dart | 10 +++- lib/generated/locale_keys.g.dart | 3 ++ lib/repositories/branch_repo.dart | 29 ++++++------ lib/view_models/ad_view_model.dart | 3 +- lib/view_models/appointments_view_model.dart | 4 ++ lib/view_models/chat_view_model.dart | 2 +- lib/view_models/service_view_model.dart | 24 ++++++---- .../components/ads_list_widget.dart | 12 ++--- .../chat/widgets/chat_message_widget.dart | 19 ++++---- lib/views/common_fragments/ads_fragment.dart | 6 ++- lib/views/requests/review_request_offer.dart | 47 ++++++++++++------- lib/widgets/checkbox_with_title_desc.dart | 4 +- 14 files changed, 109 insertions(+), 64 deletions(-) diff --git a/assets/langs/ar-SA.json b/assets/langs/ar-SA.json index 5a4f114..9eba80f 100644 --- a/assets/langs/ar-SA.json +++ b/assets/langs/ar-SA.json @@ -757,5 +757,8 @@ "noAvailableOfficesInCity": "لا توجد مكاتب متاحة في مدينتك لخدمتك.", "searchByItem": "البحث حسب العنصر", "selectBranchToCopyServices": "حدد الفرع لنسخ العناصر الخاصة بهم إلى هذا الفرع. يمكنك تعديل الاختيار في أي وقت.", - "tapToSelect": "Tap to select" + "tapToSeeItems": "اضغط لرؤية العناصر", + "tapToSelect": "اضغط للاختيار", + "noteCopyItemsExplanation": "ملاحظة: ستتمكن من نسخ العناصر من خدمة إلى أخرى في الفئة المحددة. يجب عليك إنشاء الخدمات أولاً ويجب أن تكون معتمدة. ثم ستتمكن من الحصول على الخدمات المتاحة التي يمكنك نسخ جميع العناصر منها أو تحديد العناصر التي تريد نسخها.", + "requestCreatedOn": "تم إنشاء الطلب في" } \ No newline at end of file diff --git a/assets/langs/en-US.json b/assets/langs/en-US.json index 731a962..7027c81 100644 --- a/assets/langs/en-US.json +++ b/assets/langs/en-US.json @@ -755,5 +755,8 @@ "noAvailableOfficesInCity": "There are no available offices in your city for your service.", "searchByItem": "Search By Item", "selectBranchToCopyServices": "Select the branch to copy their items to this branch. You can modify the selection at any time.", - "tapToSelect": "Tap to select" + "tapToSelect": "Tap to select", + "tapToSeeItems": "Tap to see items", + "noteCopyItemsExplanation": "Note: You will be able to copy items from one service to another in a selected category. You must create the services first and they should be approved. Then you will be able to get the available services from which you can copy all or selected items.", + "requestCreatedOn": "Request created on" } \ No newline at end of file diff --git a/lib/generated/codegen_loader.g.dart b/lib/generated/codegen_loader.g.dart index 73ef7d0..905622f 100644 --- a/lib/generated/codegen_loader.g.dart +++ b/lib/generated/codegen_loader.g.dart @@ -773,7 +773,10 @@ class CodegenLoader extends AssetLoader{ "noAvailableOfficesInCity": "لا توجد مكاتب متاحة في مدينتك لخدمتك.", "searchByItem": "البحث حسب العنصر", "selectBranchToCopyServices": "حدد الفرع لنسخ العناصر الخاصة بهم إلى هذا الفرع. يمكنك تعديل الاختيار في أي وقت.", - "tapToSelect": "Tap to select" + "tapToSeeItems": "اضغط لرؤية العناصر", + "tapToSelect": "اضغط للاختيار", + "noteCopyItemsExplanation": "ملاحظة: ستتمكن من نسخ العناصر من خدمة إلى أخرى في الفئة المحددة. يجب عليك إنشاء الخدمات أولاً ويجب أن تكون معتمدة. ثم ستتمكن من الحصول على الخدمات المتاحة التي يمكنك نسخ جميع العناصر منها أو تحديد العناصر التي تريد نسخها.", + "requestCreatedOn": "تم إنشاء الطلب في" }; static const Map en_US = { "firstTimeLogIn": "First Time Log In", @@ -1532,7 +1535,10 @@ static const Map en_US = { "noAvailableOfficesInCity": "There are no available offices in your city for your service.", "searchByItem": "Search By Item", "selectBranchToCopyServices": "Select the branch to copy their items to this branch. You can modify the selection at any time.", - "tapToSelect": "Tap to select" + "tapToSelect": "Tap to select", + "tapToSeeItems": "Tap to see items", + "noteCopyItemsExplanation": "Note: You will be able to copy items from one service to another in a selected category. You must create the services first and they should be approved. Then you will be able to get the available services from which you can copy all or selected items.", + "requestCreatedOn": "Request created on" }; static const Map> mapLocales = {"ar_SA": ar_SA, "en_US": en_US}; } diff --git a/lib/generated/locale_keys.g.dart b/lib/generated/locale_keys.g.dart index 1d161b3..396b4fa 100644 --- a/lib/generated/locale_keys.g.dart +++ b/lib/generated/locale_keys.g.dart @@ -736,6 +736,9 @@ abstract class LocaleKeys { static const noAvailableOfficesInCity = 'noAvailableOfficesInCity'; static const searchByItem = 'searchByItem'; static const selectBranchToCopyServices = 'selectBranchToCopyServices'; + static const tapToSeeItems = 'tapToSeeItems'; static const tapToSelect = 'tapToSelect'; + static const noteCopyItemsExplanation = 'noteCopyItemsExplanation'; + static const requestCreatedOn = 'requestCreatedOn'; } diff --git a/lib/repositories/branch_repo.dart b/lib/repositories/branch_repo.dart index 89f85ff..068c285 100644 --- a/lib/repositories/branch_repo.dart +++ b/lib/repositories/branch_repo.dart @@ -236,7 +236,7 @@ class BranchRepoImp implements BranchRepo { GenericRespModel adsGenericModel = await apiClient.getJsonForObject( token: t, - (json) => GenericRespModel.fromJson(json), + (json) => GenericRespModel.fromJson(json), ApiConsts.serviceProviderDDLGet, ); List providersList = List.generate(adsGenericModel.data.length, (index) => ProviderBasicDataModel.fromJson(adsGenericModel.data[index])); @@ -268,7 +268,8 @@ class BranchRepoImp implements BranchRepo { serviceProviderBranchImages.add(imageMap); } - String lat = "0", long = "0"; + String lat = "0", + long = "0"; try { lat = latitude.toString().substring(0, 9); long = longitude.toString().substring(0, 9); @@ -340,7 +341,7 @@ class BranchRepoImp implements BranchRepo { String t = AppState().getUser.data!.accessToken ?? ""; GenericRespModel genericRespModel = await apiClient.getJsonForObject( - (json) => GenericRespModel.fromJson(json), + (json) => GenericRespModel.fromJson(json), ApiConsts.serviceProviderAppointmentGetByCategoryOrService, queryParameters: map, token: t, @@ -415,7 +416,7 @@ class BranchRepoImp implements BranchRepo { String t = AppState().getUser.data!.accessToken ?? ""; GenericRespModel adsGenericModel = await apiClient.getJsonForObject( - (json) => GenericRespModel.fromJson(json), + (json) => GenericRespModel.fromJson(json), ApiConsts.getAllNearBranches, token: appState.getUser.data!.accessToken, queryParameters: queryParameters, @@ -443,7 +444,7 @@ class BranchRepoImp implements BranchRepo { "longitude": longitude.toString(), }; GenericRespModel adsGenericModel = await apiClient.getJsonForObject( - (json) => GenericRespModel.fromJson(json), + (json) => GenericRespModel.fromJson(json), ApiConsts.getAllNearBranches, token: appState.getUser.data!.accessToken, queryParameters: queryParameters, @@ -455,7 +456,7 @@ class BranchRepoImp implements BranchRepo { @override Future> getMyRecentBranchesWithServices() async { GenericRespModel adsGenericModel = await apiClient.getJsonForObject( - (json) => GenericRespModel.fromJson(json), + (json) => GenericRespModel.fromJson(json), ApiConsts.getMyRecentBranches, token: appState.getUser.data!.accessToken, ); @@ -470,7 +471,7 @@ class BranchRepoImp implements BranchRepo { }; GenericRespModel adsGenericModel = await apiClient.getJsonForObject( - (json) => GenericRespModel.fromJson(json), + (json) => GenericRespModel.fromJson(json), ApiConsts.getServiceItems, token: appState.getUser.data!.accessToken, queryParameters: serviceId.toString() != "-1" ? queryParameters : null, @@ -490,7 +491,7 @@ class BranchRepoImp implements BranchRepo { postParams.addAll({"Latitude": "$latitude"}); } GenericRespModel adsGenericModel = - await apiClient.getJsonForObject((json) => GenericRespModel.fromJson(json), ApiConsts.branchesAndServices, token: appState.getUser.data!.accessToken, queryParameters: postParams); + await apiClient.getJsonForObject((json) => GenericRespModel.fromJson(json), ApiConsts.branchesAndServices, token: appState.getUser.data!.accessToken, queryParameters: postParams); return ProviderProfileModel.fromJson(adsGenericModel.data); } @@ -535,7 +536,7 @@ class BranchRepoImp implements BranchRepo { }; GenericRespModel adsGenericModel = await apiClient.getJsonForObject( - (json) => GenericRespModel.fromJson(json), + (json) => GenericRespModel.fromJson(json), ApiConsts.getAllNearBranches, token: appState.getUser.data!.accessToken, queryParameters: postParams, @@ -549,7 +550,7 @@ class BranchRepoImp implements BranchRepo { var postParams = {"ServiceProviderBranchID": serviceProviderBranchID.toString()}; GenericRespModel adsGenericModel = await apiClient.getJsonForObject( - (json) => GenericRespModel.fromJson(json), + (json) => GenericRespModel.fromJson(json), ApiConsts.getBranchRatings, token: appState.getUser.data!.accessToken, queryParameters: postParams, @@ -563,7 +564,7 @@ class BranchRepoImp implements BranchRepo { final customerID = appState.getUser.data!.userInfo!.customerId; final parameters = {"title": title, "review": review, "ratNo": ratingNo, "serviceProviderBranchID": serviceProviderBranchID, "customerID": "$customerID"}; GenericRespModel adsGenericModel = await apiClient.postJsonForObject( - (json) => GenericRespModel.fromJson(json), + (json) => GenericRespModel.fromJson(json), ApiConsts.createBranchRatings, parameters, token: appState.getUser.data!.accessToken, @@ -579,7 +580,7 @@ class BranchRepoImp implements BranchRepo { "customerID": customerID.toString(), }; GenericRespModel adsGenericModel = await apiClient.postJsonForObject( - (json) => GenericRespModel.fromJson(json), + (json) => GenericRespModel.fromJson(json), ApiConsts.favouriteServiceProviderCreate, parameters, token: appState.getUser.data!.accessToken, @@ -591,7 +592,7 @@ class BranchRepoImp implements BranchRepo { Future removeProviderFromFavourite({required int providerID}) async { final parameters = {"id": providerID.toString()}; GenericRespModel adsGenericModel = await apiClient.postJsonForObject( - (json) => GenericRespModel.fromJson(json), + (json) => GenericRespModel.fromJson(json), ApiConsts.unFavouriteServiceProvider, parameters, token: appState.getUser.data!.accessToken, @@ -606,7 +607,7 @@ class BranchRepoImp implements BranchRepo { var postParams = {"customerID": customerID.toString()}; GenericRespModel adsGenericModel = await apiClient.getJsonForObject( - (json) => GenericRespModel.fromJson(json), + (json) => GenericRespModel.fromJson(json), ApiConsts.favouriteServiceProviderGet, token: appState.getUser.data!.accessToken, queryParameters: postParams, diff --git a/lib/view_models/ad_view_model.dart b/lib/view_models/ad_view_model.dart index 3d5dfa7..c7b4568 100644 --- a/lib/view_models/ad_view_model.dart +++ b/lib/view_models/ad_view_model.dart @@ -219,7 +219,8 @@ class AdVM extends BaseVM { notifyListeners(); } - int currentPage = 1; + int currentPageForExploreAds = 1; + int currentPageForMyAds = 1; bool isLoadingMore = false; bool hasMoreData = true; diff --git a/lib/view_models/appointments_view_model.dart b/lib/view_models/appointments_view_model.dart index 891e253..e5f6606 100644 --- a/lib/view_models/appointments_view_model.dart +++ b/lib/view_models/appointments_view_model.dart @@ -398,10 +398,14 @@ class AppointmentsVM extends BaseVM { // Create a list of CustomerData instances myFilteredAppointments2 = uniqueCustomerIDs.map((id) { List list = myFilteredAppointments.where((item) => item.customerID == id).toList(); + list.sort((a, b) => DateHelper.parseStringToDate(DateHelper.formatDateT(b.appointmentDate!)) + .millisecondsSinceEpoch + .compareTo(DateHelper.parseStringToDate(DateHelper.formatDateT(a.appointmentDate!)).millisecondsSinceEpoch)); AppointmentListModel model = list.first; model.customerAppointmentList = list; return model; }).toList(); + // customersAppointments = uniqueCustomerIDs.map((id) { // List list = myFilteredAppointments // .where((item) => item.customerID == id) diff --git a/lib/view_models/chat_view_model.dart b/lib/view_models/chat_view_model.dart index f2c8bf2..17d4654 100644 --- a/lib/view_models/chat_view_model.dart +++ b/lib/view_models/chat_view_model.dart @@ -98,7 +98,7 @@ class ChatVM extends BaseVM { } List indexesForCancelSpecialCarOffer = [0, 1, 5, 6, 10]; - List indexesForCancelSparePartOffer = [2, 5, 10]; + List indexesForCancelSparePartOffer = [2, 5, 6, 10]; List indexesForRejectOffer = [3, 4, 10]; List indexesForDealNotCompleted = [7, 4, 8, 9, 10]; diff --git a/lib/view_models/service_view_model.dart b/lib/view_models/service_view_model.dart index a6d1172..11a5015 100644 --- a/lib/view_models/service_view_model.dart +++ b/lib/view_models/service_view_model.dart @@ -272,7 +272,11 @@ class ServiceVM extends BaseVM { context, allowMultiple: false, ); - if (files != null && files.any((element) => element.path.split('.').last.toLowerCase() != 'pdf')) { + if (files != null && files.any((element) => + element.path + .split('.') + .last + .toLowerCase() != 'pdf')) { Utils.showToast("Only PDF Files are allowed"); return; } @@ -286,8 +290,8 @@ class ServiceVM extends BaseVM { documentID == 1 ? commerceCertificates.addAll(imageModels) : documentID == 2 - ? commercialCertificates.addAll(imageModels) - : vatCertificates.addAll(imageModels); + ? commercialCertificates.addAll(imageModels) + : vatCertificates.addAll(imageModels); document!.data![index].document = Utils.convertFileToBase64(files.first); document!.data![index].fileExt = Utils.checkFileExt(files.first.path); document!.data![index].documentUrl = files.first.path; @@ -463,10 +467,10 @@ class ServiceVM extends BaseVM { DropValue( element.id ?? 0, ((element.categoryName!.isEmpty - ? "N/A" - : countryCode == "SA" - ? element.categoryNameN - : element.categoryName) ?? + ? "N/A" + : countryCode == "SA" + ? element.categoryNameN + : element.categoryName) ?? "N/A"), "", ), @@ -626,7 +630,7 @@ class ServiceVM extends BaseVM { List? matchedServices; bool isAllSelected = false; - Future getAllMatchedServices(int oldBranchId, int newBranchId, int categoryId) async { + Future getAllMatchedServices({required int oldBranchId, required int newBranchId, required int categoryId}) async { matchedServices = null; final GenericRespModel response = await branchRepo.getMatchedServices(oldBranchId, newBranchId, categoryId); matchedServices = []; @@ -747,7 +751,9 @@ class ServiceVM extends BaseVM { File file = File(imageModel.filePath!); List imageBytes = await file.readAsBytes(); String image = base64Encode(imageBytes); - String fileName = file.path.split('/').last; + String fileName = file.path + .split('/') + .last; branchPostingImages = BranchPostingImages( imageName: fileName, imageStr: image, diff --git a/lib/views/advertisement/components/ads_list_widget.dart b/lib/views/advertisement/components/ads_list_widget.dart index 344738e..fff78fb 100644 --- a/lib/views/advertisement/components/ads_list_widget.dart +++ b/lib/views/advertisement/components/ads_list_widget.dart @@ -44,10 +44,10 @@ class AdsListWidget extends StatelessWidget { } return NotificationListener( onNotification: (ScrollNotification scrollInfo) { - if (scrollInfo.metrics.pixels == scrollInfo.metrics.maxScrollExtent && context - .read() - .hasMoreData) { - log("should call more ads api:"); + if (scrollInfo.metrics.pixels == scrollInfo.metrics.maxScrollExtent && context.read().hasMoreData) { + if (onFetchMoreAds != null) { + onFetchMoreAds!(); + } } return false; }, @@ -104,9 +104,7 @@ class AdCard extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start, children: [ - if (isAdsFragment && !context - .read() - .isExploreAdsTapped) ...[ + if (isAdsFragment && !context.read().isExploreAdsTapped) ...[ Utils.statusContainerChip(text: adDetails.statuslabel!, chipColor: Utils.getChipColorByAdStatus(adDetails.adPostStatus!)), ], (adDetails.vehicle!.vehicleTitle ?? "").toText( diff --git a/lib/views/chat/widgets/chat_message_widget.dart b/lib/views/chat/widgets/chat_message_widget.dart index 5ede78f..05ef366 100644 --- a/lib/views/chat/widgets/chat_message_widget.dart +++ b/lib/views/chat/widgets/chat_message_widget.dart @@ -776,7 +776,7 @@ class _ChatMessageCustomWidgetState extends State { ], Expanded( child: Directionality( - textDirection: (widget.chatMessageModel.isMyMessage ?? false) ? TextDirection.ltr : TextDirection.rtl, + textDirection: TextDirection.ltr, child: (widget.chatMessageModel.chatText ?? "").toText( color: (widget.chatMessageModel.isMyMessage ?? false) ? MyColors.white : MyColors.lightTextColor, fontSize: 12, @@ -901,19 +901,18 @@ class _ChatMessageCustomWidgetState extends State { case ChatMessageTypeEnum.file: case ChatMessageTypeEnum.offer: messageTypeWidget = Column( + crossAxisAlignment: (widget.chatMessageModel.isMyMessage ?? false) ? CrossAxisAlignment.end : CrossAxisAlignment.start, children: [ buildFreeTextDetailsInMessage(chatMessageTypeEnum: chatMessageTypeEnum), if (widget.requestsTypeEnum == RequestsTypeEnum.serviceRequest) ...[ 2.height, - Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - "${LocaleKeys.deliveryAvailable.tr()} : ${(widget.chatMessageModel.reqOffer!.isDeliveryAvailable ?? false) ? LocaleKeys.yes.tr() : LocaleKeys.no.tr()}".toText( - fontSize: 10, - color: (widget.chatMessageModel.isMyMessage ?? false) ? MyColors.white : MyColors.lightTextColor, - fontWeight: MyFonts.Medium, - ), - ], + Directionality( + textDirection: TextDirection.ltr, + child: "${LocaleKeys.deliveryAvailable.tr()} : ${(widget.chatMessageModel.reqOffer!.isDeliveryAvailable ?? false) ? LocaleKeys.yes.tr() : LocaleKeys.no.tr()}".toText( + fontSize: 10, + color: (widget.chatMessageModel.isMyMessage ?? false) ? MyColors.white : MyColors.lightTextColor, + fontWeight: MyFonts.Medium, + ), ), ], if (widget.chatMessageModel.reqOffer!.reqOfferImages != null && widget.chatMessageModel.reqOffer!.reqOfferImages!.isNotEmpty) ...[ diff --git a/lib/views/common_fragments/ads_fragment.dart b/lib/views/common_fragments/ads_fragment.dart index 024b677..b0e29d4 100644 --- a/lib/views/common_fragments/ads_fragment.dart +++ b/lib/views/common_fragments/ads_fragment.dart @@ -1,3 +1,5 @@ +import 'dart:developer'; + import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:mc_common_app/classes/app_state.dart'; @@ -139,7 +141,9 @@ class AdsFragment extends StatelessWidget { isAdsFragment: true, shouldShowAdStatus: !adVM.isExploreAdsTapped, adsList: getAdsList(adVM), - onFetchMoreAds: () {}, + onFetchMoreAds: () { + log("fetch more ads"); + }, ), ), ) diff --git a/lib/views/requests/review_request_offer.dart b/lib/views/requests/review_request_offer.dart index 9af95fe..4fef205 100644 --- a/lib/views/requests/review_request_offer.dart +++ b/lib/views/requests/review_request_offer.dart @@ -94,20 +94,25 @@ class _ReviewRequestOfferState extends State { return Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - LocaleKeys.locationInformation.tr().toText(fontSize: 18), - MyAssets.icEdit.buildSvg().onPress(() => buildLocationInformationEditBottomSheet(context, requestVM)), - ], - ), + LocaleKeys.locationInformation.tr().toText(fontSize: 18), + + // Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + // children: [ + // LocaleKeys.locationInformation.tr().toText(fontSize: 18), + // MyAssets.icEdit.buildSvg().onPress(() => buildLocationInformationEditBottomSheet(context, requestVM)), + // ], + // ), 8.height, Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ SingleDetailWidget(text: requestVM.currentSelectedRequest!.address ?? "", type: LocaleKeys.location.tr()), - 16.height, - SingleDetailWidget(text: requestVM.additionalAddressSparePartRequestDelivery.isNotEmpty ? requestVM.additionalAddressSparePartRequestDelivery : "N/A", type: LocaleKeys.additionalAddressDetails.tr()), + // 16.height, + // SingleDetailWidget( + // text: requestVM.additionalAddressSparePartRequestDelivery.isNotEmpty ? requestVM.additionalAddressSparePartRequestDelivery : "N/A", + // type: LocaleKeys.additionalAddressDetails.tr(), + // ), ], ), ], @@ -117,9 +122,13 @@ class _ReviewRequestOfferState extends State { Widget buildServiceInformation(BuildContext context) { final requestVM = context.read(); - String formattedDate = ""; + String manufacturedOnFormattedDate = ""; if (requestVM.acceptedRequestOffer!.manufacturedOn != null) { - formattedDate = DateHelper.formatAsDayMonthYear(DateHelper.parseStringToDate(DateHelper.formatDateT(requestVM.acceptedRequestOffer!.manufacturedOn.toString() ?? ""))); + manufacturedOnFormattedDate = DateHelper.formatAsDayMonthYear(DateHelper.parseStringToDate(DateHelper.formatDateT(requestVM.acceptedRequestOffer!.manufacturedOn.toString() ?? ""))); + } + String requestCreatedOn = ""; + if (requestVM.currentSelectedRequest!.createdOn != null) { + requestCreatedOn = DateHelper.formatAsDayMonthYear(DateHelper.parseStringToDate(DateHelper.formatDateT(requestVM.currentSelectedRequest!.createdOn.toString() ?? ""))); } return Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -148,8 +157,8 @@ class _ReviewRequestOfferState extends State { 16.height, SingleDetailWidget(text: (requestVM.acceptedRequestOffer!.manufacturedById ?? "").toString(), type: LocaleKeys.manufacturedBy.tr()), ], - 16.height, - SingleDetailWidget(text: "${requestVM.acceptedRequestOffer!.price.toString()} SAR", type: LocaleKeys.offerPrice.tr()), + // 16.height, + // SingleDetailWidget(text: "${requestVM.acceptedRequestOffer!.price.toString()} ${LocaleKeys.sar.tr()}", type: LocaleKeys.offerPrice.tr()), 16.height, SingleDetailWidget(text: requestVM.acceptedRequestOfferProviderName ?? "", type: LocaleKeys.providerName.tr()), 16.height, @@ -165,12 +174,18 @@ class _ReviewRequestOfferState extends State { SingleDetailWidget(text: requestVM.currentSelectedRequest!.brand, type: LocaleKeys.vehicleBrand.tr()), 16.height, SingleDetailWidget(text: requestVM.acceptedRequestOffer!.serviceItemName ?? "", type: LocaleKeys.serviceName.tr()), - if (formattedDate.isNotEmpty) ...[ + if (manufacturedOnFormattedDate.isNotEmpty) ...[ 16.height, - SingleDetailWidget(text: formattedDate, type: LocaleKeys.manufacturedOn.tr()), + SingleDetailWidget(text: manufacturedOnFormattedDate, type: LocaleKeys.manufacturedOn.tr()), ], 16.height, - SingleDetailWidget(text: "${requestVM.currentSelectedRequest!.price.toString()} SAR", type: LocaleKeys.totalPrice.tr()), + // SingleDetailWidget(text: "${requestVM.currentSelectedRequest!.price.toString()} ${LocaleKeys.sar.tr()}", type: LocaleKeys.totalPrice.tr()), + SingleDetailWidget(text: "${requestVM.acceptedRequestOffer!.price.toString()} ${LocaleKeys.sar.tr()}", type: LocaleKeys.offerPrice.tr()), + + if (requestCreatedOn.isNotEmpty) ...[ + 16.height, + SingleDetailWidget(text: requestCreatedOn, type: LocaleKeys.requestCreatedOn.tr()), + ], ], ), ), diff --git a/lib/widgets/checkbox_with_title_desc.dart b/lib/widgets/checkbox_with_title_desc.dart index 595c461..a3d67bb 100644 --- a/lib/widgets/checkbox_with_title_desc.dart +++ b/lib/widgets/checkbox_with_title_desc.dart @@ -9,12 +9,14 @@ class CheckBoxWithTitleDescription extends StatelessWidget { final String title, description; final Function(bool) onSelection; final bool isDisabled; + final CrossAxisAlignment? crossAxisAlignment; const CheckBoxWithTitleDescription({ required this.isSelected, required this.title, required this.description, required this.onSelection, + this.crossAxisAlignment, this.isDisabled = false, super.key, }); @@ -30,7 +32,7 @@ class CheckBoxWithTitleDescription extends StatelessWidget { child: SizedBox( width: double.infinity, child: Row( - crossAxisAlignment: description.isNotEmpty ? CrossAxisAlignment.start : CrossAxisAlignment.center, + crossAxisAlignment: crossAxisAlignment == null ? (description.isNotEmpty ? CrossAxisAlignment.start : CrossAxisAlignment.center) : crossAxisAlignment!, mainAxisAlignment: MainAxisAlignment.start, children: [ Checkbox(