From a8620c1f72b7cf8eed6326fa577e52ed0083e70b Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 5 Apr 2026 17:33:02 +0300 Subject: [PATCH] updates --- .../book_appointment/doctor_profile_page.dart | 4 ++-- .../widgets/doctor_rating_details.dart | 22 +++++++++-------- .../habib_wallet/habib_wallet_page.dart | 6 +++-- .../hmg_services/services_page.dart | 3 ++- .../home/widgets/habib_wallet_card.dart | 3 ++- .../my_invoices/my_invoices_details_page.dart | 24 ++++++++++++++----- lib/theme/colors.dart | 2 +- 7 files changed, 41 insertions(+), 23 deletions(-) diff --git a/lib/presentation/book_appointment/doctor_profile_page.dart b/lib/presentation/book_appointment/doctor_profile_page.dart index 968a4805..90d0fc99 100644 --- a/lib/presentation/book_appointment/doctor_profile_page.dart +++ b/lib/presentation/book_appointment/doctor_profile_page.dart @@ -1,5 +1,6 @@ import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; +import 'package:intl/intl.dart' show NumberFormat; import 'package:hmg_patient_app_new/core/app_assets.dart'; import 'package:hmg_patient_app_new/core/app_state.dart'; import 'package:hmg_patient_app_new/core/dependencies.dart'; @@ -160,8 +161,7 @@ class DoctorProfilePage extends StatelessWidget { Utils.buildSvgWithAssets(icon: AppAssets.doctor_profile_reviews_icon, width: 48.w, height: 48.h, fit: BoxFit.contain, applyThemeColor: false), SizedBox(height: 16.h), LocaleKeys.reviews.tr(context: context).toText12(fontWeight: FontWeight.w500, color: AppColors.greyTextColor), - bookAppointmentsViewModel.doctorsProfileResponseModel.noOfPatientsRate - .toString() + NumberFormat.decimalPattern().format(bookAppointmentsViewModel.doctorsProfileResponseModel.noOfPatientsRate ?? 0) .toText16(isBold: true, color: AppColors.textColor, isUnderLine: true, decorationColor: AppColors.textColor, fontFamily: "Poppins"), ], ).onPress(() { diff --git a/lib/presentation/book_appointment/widgets/doctor_rating_details.dart b/lib/presentation/book_appointment/widgets/doctor_rating_details.dart index a19fa2eb..17a3319b 100644 --- a/lib/presentation/book_appointment/widgets/doctor_rating_details.dart +++ b/lib/presentation/book_appointment/widgets/doctor_rating_details.dart @@ -1,6 +1,8 @@ import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; +import 'package:hmg_patient_app_new/core/utils/size_utils.dart'; import 'package:hmg_patient_app_new/core/utils/utils.dart'; +import 'package:hmg_patient_app_new/extensions/widget_extensions.dart'; import 'package:hmg_patient_app_new/features/book_appointments/book_appointments_view_model.dart'; import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; import 'package:hmg_patient_app_new/theme/colors.dart'; @@ -116,19 +118,19 @@ class DoctorRatingDialog extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - width: 130, - height: 160, - decoration: BoxDecoration( + width: 130.w, + height: 140.h, + decoration: RoundedRectangleBorder().toSmoothCornerDecoration( + borderRadius: 16.r, color: _getBadgeColor(averageRating), - borderRadius: BorderRadius.circular(18), ), child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ Text( - averageRating.toStringAsFixed(1), + averageRating.toString(), style: TextStyle( - fontSize: 60, + fontSize: 48.f, fontWeight: FontWeight.w700, color: averageRating == 0 || averageRating == 0.0 ? AppColors.textColor : AppColors.whiteColor, height: 1.1, @@ -137,15 +139,15 @@ class DoctorRatingDialog extends StatelessWidget { const SizedBox(height: 8), Container( padding: const EdgeInsets.symmetric( - horizontal: 16, + horizontal: 8, vertical: 6, ), decoration: BoxDecoration( - color: averageRating == 0 || averageRating == 0.0 ? AppColors.greyF7Color : const Color.fromRGBO(0, 0, 0, 0.15), + color: averageRating == 0 || averageRating == 0.0 ? AppColors.greyF7Color : AppColors.textColor.withAlpha(20), borderRadius: BorderRadius.circular(8), ), child: Text( - '$totalReviews Review', + '${NumberFormat.decimalPattern().format(totalReviews)} ${LocaleKeys.reviews.tr(context: context)}', style: TextStyle( fontSize: 14, fontWeight: FontWeight.w500, @@ -199,7 +201,7 @@ class DoctorRatingDialog extends StatelessWidget { child: ClipRRect( borderRadius: BorderRadius.circular(6), child: SizedBox( - height: 10, + height: 5.h, child: LinearProgressIndicator( value: percent / 100, backgroundColor: AppColors.shimmerBaseColor, diff --git a/lib/presentation/habib_wallet/habib_wallet_page.dart b/lib/presentation/habib_wallet/habib_wallet_page.dart index 2a3da660..700f421f 100644 --- a/lib/presentation/habib_wallet/habib_wallet_page.dart +++ b/lib/presentation/habib_wallet/habib_wallet_page.dart @@ -84,7 +84,8 @@ class _HabibWalletState extends State { LocaleKeys.balanceAmount.tr(context: context).toText14(weight: FontWeight.w500, color: Colors.white), SizedBox(height: 4.h), Consumer(builder: (context, habibWalletVM, child) { - return Utils.getPaymentAmountWithSymbol2(habibWalletVM.habibWalletAmount, textColor: Colors.white, iconColor: Colors.white, iconSize: 16, isExpanded: false) + return Utils.getPaymentAmountWithSymbol2(num.parse(NumberFormat.decimalPattern().format(habibWalletVM.habibWalletAmount)), + textColor: Colors.white, iconColor: Colors.white, iconSize: 16, isExpanded: false) .toShimmer2(isShow: habibWalletVM.isWalletAmountLoading, radius: 12.h, width: 80.h, height: 24.h); }), ], @@ -138,7 +139,8 @@ class _HabibWalletState extends State { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Expanded(child: habibWalletVM.habibWalletBalanceList[index].projectDescription!.toText16(weight: FontWeight.w500, color: AppColors.textColor)), - Utils.getPaymentAmountWithSymbol2(habibWalletVM.habibWalletBalanceList[index].patientAdvanceBalanceAmount!, textColor: AppColors.textColor, iconColor: AppColors.textColor, iconSize: 18.h, isExpanded: false, fontSize: 28.f, fontWeight: FontWeight.w500), + Utils.getPaymentAmountWithSymbol2(num.parse(NumberFormat.decimalPattern().format(habibWalletVM.habibWalletBalanceList[index].patientAdvanceBalanceAmount!)), + textColor: AppColors.textColor, iconColor: AppColors.textColor, iconSize: 18.h, isExpanded: false, fontSize: 28.f, fontWeight: FontWeight.w500), ], ).paddingSymmetrical(0, 12.h); }, diff --git a/lib/presentation/hmg_services/services_page.dart b/lib/presentation/hmg_services/services_page.dart index 22ea1121..d2f42f52 100644 --- a/lib/presentation/hmg_services/services_page.dart +++ b/lib/presentation/hmg_services/services_page.dart @@ -440,6 +440,7 @@ class ServicesPage extends StatelessWidget { ), SizedBox(height: 24.h), getIt.get().isAuthenticated ? Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ LocaleKeys.personalServices.tr().toText18(weight: FontWeight.w600).paddingSymmetrical(24.w, 0), SizedBox(height: 16.h), @@ -470,7 +471,7 @@ class ServicesPage extends StatelessWidget { Spacer(), getIt.get().isAuthenticated ? Consumer(builder: (context, habibWalletVM, child) { - return Utils.getPaymentAmountWithSymbol2(habibWalletVM.habibWalletAmount, isExpanded: false) + return Utils.getPaymentAmountWithSymbol2(num.parse(NumberFormat.decimalPattern().format(habibWalletVM.habibWalletAmount)), isExpanded: false) .toShimmer2(isShow: habibWalletVM.isWalletAmountLoading, radius: 12.r, width: 80.w, height: 24.h); }) : LocaleKeys.loginToViewWalletBalance.tr().toText12(fontWeight: FontWeight.w500, maxLine: 2), diff --git a/lib/presentation/home/widgets/habib_wallet_card.dart b/lib/presentation/home/widgets/habib_wallet_card.dart index 19c03284..a8ba04dd 100644 --- a/lib/presentation/home/widgets/habib_wallet_card.dart +++ b/lib/presentation/home/widgets/habib_wallet_card.dart @@ -87,7 +87,8 @@ class HabibWalletCard extends StatelessWidget { fit: BoxFit.contain, ), SizedBox(width: 8.h), - habibWalletVM.habibWalletAmount + NumberFormat.decimalPattern() + .format(habibWalletVM.habibWalletAmount) .toString() .toText32(isBold: true, isEnglishOnly: true) .toShimmer2(isShow: habibWalletVM.isWalletAmountLoading, radius: 12.h, width: 80.h, height: 40.h), diff --git a/lib/presentation/my_invoices/my_invoices_details_page.dart b/lib/presentation/my_invoices/my_invoices_details_page.dart index 83cb885f..4e7f0d48 100644 --- a/lib/presentation/my_invoices/my_invoices_details_page.dart +++ b/lib/presentation/my_invoices/my_invoices_details_page.dart @@ -255,8 +255,8 @@ class _MyInvoicesDetailsPageState extends State { children: [ Expanded(flex: 3, child: (consultation.procedureName ?? '-').toText12(fontWeight: FontWeight.w500)), Expanded(flex: 1, child: '${consultation.quantity ?? '-'}'.toText12(fontWeight: FontWeight.w500, isCenter: true)), - Expanded(flex: 2, child: '${consultation.price ?? '-'}'.toText12(fontWeight: FontWeight.w500, isCenter: true)), - Expanded(flex: 2, child: '${consultation.total ?? '-'}'.toText12(fontWeight: FontWeight.w500, isCenter: true)), + Expanded(flex: 2, child: '${NumberFormat.decimalPattern().format(consultation.price) ?? '-'}'.toText12(fontWeight: FontWeight.w500, isCenter: true)), + Expanded(flex: 2, child: '${NumberFormat.decimalPattern().format(consultation.total) ?? '-'}'.toText12(fontWeight: FontWeight.w500, isCenter: true)), ], ), ), @@ -290,7 +290,8 @@ class _MyInvoicesDetailsPageState extends State { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ LocaleKeys.amountBeforeTax.tr(context: context).toText14(isBold: true), - Utils.getPaymentAmountWithSymbol(widget.getInvoiceDetailsResponseModel.listConsultation!.first.totalShare.toString().toText16(isBold: true), AppColors.blackColor, 13, + Utils.getPaymentAmountWithSymbol( + NumberFormat.decimalPattern().format(widget.getInvoiceDetailsResponseModel.listConsultation!.first.totalShare).toString().toText16(isBold: true), AppColors.blackColor, 13, isSaudiCurrency: true), ], ).paddingSymmetrical(24.h, 0.h), @@ -299,7 +300,12 @@ class _MyInvoicesDetailsPageState extends State { children: [ LocaleKeys.vat15.tr(context: context).toText14(isBold: true, color: AppColors.greyTextColor), Utils.getPaymentAmountWithSymbol( - widget.getInvoiceDetailsResponseModel.listConsultation!.first.totalVATAmount!.toString().toText14(isBold: true, color: AppColors.greyTextColor), AppColors.greyTextColor, 13, + NumberFormat.decimalPattern() + .format(widget.getInvoiceDetailsResponseModel.listConsultation!.first.totalVATAmount!) + .toString() + .toText14(isBold: true, color: AppColors.greyTextColor), + AppColors.greyTextColor, + 13, isSaudiCurrency: true), ], ).paddingSymmetrical(24.h, 0.h), @@ -308,7 +314,11 @@ class _MyInvoicesDetailsPageState extends State { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ LocaleKeys.discount.tr(context: context).toText14(isBold: true), - Utils.getPaymentAmountWithSymbol(widget.getInvoiceDetailsResponseModel.listConsultation!.first.discountAmount!.toString().toText14(isBold: true, color: AppColors.primaryRedColor), + Utils.getPaymentAmountWithSymbol( + NumberFormat.decimalPattern() + .format(widget.getInvoiceDetailsResponseModel.listConsultation!.first.discountAmount!) + .toString() + .toText14(isBold: true, color: AppColors.primaryRedColor), AppColors.primaryRedColor, 13, isSaudiCurrency: true), ], @@ -318,7 +328,9 @@ class _MyInvoicesDetailsPageState extends State { children: [ LocaleKeys.paid.tr(context: context).toText14(isBold: true), Utils.getPaymentAmountWithSymbol( - widget.getInvoiceDetailsResponseModel.listConsultation!.first.grandTotal!.toString().toText14(isBold: true, color: AppColors.textColor), AppColors.textColor, 13, + NumberFormat.decimalPattern().format(widget.getInvoiceDetailsResponseModel.listConsultation!.first.grandTotal!).toString().toText14(isBold: true, color: AppColors.textColor), + AppColors.textColor, + 13, isSaudiCurrency: true), ], ).paddingSymmetrical(24.h, 0.h), diff --git a/lib/theme/colors.dart b/lib/theme/colors.dart index 240f35e8..0750ebb0 100644 --- a/lib/theme/colors.dart +++ b/lib/theme/colors.dart @@ -43,7 +43,7 @@ class AppColors { // ── Doctor Rating Colors ────────────────────────────────────────────────── static const Color ratingStarIconColor = Color(0xFFFFA726); // Orange-amber for star icons - static const Color ratingFiveStarColor = Color(0xFF4CAF50); // Green for 5 stars + static const Color ratingFiveStarColor = Color(0xFF18C273); // Green for 5 stars static const Color ratingFourStarColor = Color(0xFF8BC34A); // Light green for 4 stars static const Color ratingThreeStarColor = Color(0xFFC0A000); // Dark yellow/olive for 3 stars static const Color ratingTwoStarColor = Color(0xFFD84315); // Dark orange-red for 2 stars