From 5852a676548f99b36a44a12ad9664c577cc16c92 Mon Sep 17 00:00:00 2001 From: Username1548 Date: Tue, 6 May 2025 17:20:36 +0700 Subject: [PATCH 1/2] fix(consultations): fixed consultations screen --- .../chat/presentation/pages/chat_screen.dart | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/lib/features/chat/presentation/pages/chat_screen.dart b/lib/features/chat/presentation/pages/chat_screen.dart index d90aaa93..b20646b9 100644 --- a/lib/features/chat/presentation/pages/chat_screen.dart +++ b/lib/features/chat/presentation/pages/chat_screen.dart @@ -86,12 +86,11 @@ class _ChatScreenState extends State { _buildChat(BuildContext context, ChatRoomStateLoaded state) { final chosenPlan = state.chatRoom.chosenPlan; final amIConsultant = chosenPlan?.consultantId == state.chatRoom.users.sender.id; - final showUserDetailsButton = amIConsultant && - [ - ChosenPlanStateEnum.stateStartDateHasBeenSet, - ChosenPlanStateEnum.statePendingPayment, - ChosenPlanStateEnum.stateInCoordination, - ].contains(chosenPlan?.chosenPlanState); + final showUserDetailsButton = [ + ChosenPlanStateEnum.stateStartDateHasBeenSet, + ChosenPlanStateEnum.statePendingPayment, + ChosenPlanStateEnum.stateInCoordination, + ].contains(chosenPlan?.chosenPlanState); final showAboutOrderButton = state.chatRoom.chosenPlan != null && state.chatRoom.chosenPlan!.chosenPlanState != ChosenPlanStateEnum.stateCanceledByTheInitiator; @@ -107,7 +106,7 @@ class _ChatScreenState extends State { bannerType = BannerType.payment; } else if (chosenPlan.chosenPlanState == ChosenPlanStateEnum.stateDone) { bannerType = BannerType.collectCharge; - } else if (!(chosenPlan.chosenPlanState == ChosenPlanStateEnum.stateLastDayFinished) && !amIConsultant) { + } else if (chosenPlan.chosenPlanState == ChosenPlanStateEnum.stateLastDayFinished && !amIConsultant) { bannerType = BannerType.finishPlan; } @@ -278,7 +277,7 @@ class _ChatScreenState extends State { itemCount: state.chatMessages.length + (state.isLoading ? 1 : 0), ), const SizedBox(height: 16), - if (!showUserDetailsButton) ...[ + if (showUserDetailsButton) ...[ // OrderCard( // plan: chosenPlan.plan, // isCustomerView: !amIConsultant, From c790214a26d0d7173f595797d52e702e62eee7d6 Mon Sep 17 00:00:00 2001 From: Username1548 Date: Tue, 6 May 2025 17:22:45 +0700 Subject: [PATCH 2/2] fix(chat): fixed chat screen --- lib/features/consultations/services/consultation_service.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/features/consultations/services/consultation_service.dart b/lib/features/consultations/services/consultation_service.dart index 24881685..e5236e0f 100644 --- a/lib/features/consultations/services/consultation_service.dart +++ b/lib/features/consultations/services/consultation_service.dart @@ -8,6 +8,6 @@ part 'consultation_service.g.dart'; abstract class ConsultationService { factory ConsultationService(Dio dio, {String baseUrl}) = _ConsultationService; - @GET('/api/consultations/in_progress') + @GET('/api/consultations') Future getConsultations(); }