From 3addd9d238c8643e46de5c307ab98d6b596c7a75 Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Thu, 29 May 2025 17:14:02 +0300 Subject: [PATCH 1/3] fix(consultation): some fixes --- .../bloc/chat_room_cubit/chat_room_cubit.dart | 5 +---- .../chat/presentation/pages/chat_screen.dart | 22 +++++++++---------- .../services/consultation_service.dart | 6 ++++- .../presentation/widgets/calendar_widget.dart | 4 +++- .../widgets/notification_widget.dart | 2 +- 5 files changed, 21 insertions(+), 18 deletions(-) diff --git a/lib/features/chat/presentation/bloc/chat_room_cubit/chat_room_cubit.dart b/lib/features/chat/presentation/bloc/chat_room_cubit/chat_room_cubit.dart index 3c522edb..d35fec90 100644 --- a/lib/features/chat/presentation/bloc/chat_room_cubit/chat_room_cubit.dart +++ b/lib/features/chat/presentation/bloc/chat_room_cubit/chat_room_cubit.dart @@ -94,13 +94,10 @@ class ChatRoomCubit extends Cubit { ), ); - if (chatRoom.chosenPlan?.consultantId == chatRoom.users.receiver.id) { + if (chosenPlan?.consultantId == chatRoom.users.sender.id) { await checkCards(); } - if (sendInitialMessage) { - await chatRepository.sendMessage(chatId: chatId, data: 'Здравствуйте, хочу заказать у вас: ${chosenPlan?.plan.name ?? 'план'}'); - } } catch (e) { log(e.toString()); typingSubscription?.cancel(); diff --git a/lib/features/chat/presentation/pages/chat_screen.dart b/lib/features/chat/presentation/pages/chat_screen.dart index 537aa9e9..72c97a6d 100644 --- a/lib/features/chat/presentation/pages/chat_screen.dart +++ b/lib/features/chat/presentation/pages/chat_screen.dart @@ -105,7 +105,7 @@ class _ChatScreenState extends State { } else if (!amIConsultant && (chosenPlan.chosenPlanState == ChosenPlanStateEnum.stateStartDateHasBeenSet || chosenPlan.chosenPlanState == ChosenPlanStateEnum.statePendingPayment)) { bannerType = BannerType.payment; - } else if (chosenPlan.chosenPlanState == ChosenPlanStateEnum.stateDone) { + } else if (chosenPlan.chosenPlanState == ChosenPlanStateEnum.stateDone && amIConsultant) { bannerType = BannerType.collectCharge; } else if (chosenPlan.chosenPlanState == ChosenPlanStateEnum.stateLastDayFinished && !amIConsultant) { bannerType = BannerType.finishPlan; @@ -303,17 +303,17 @@ class _ChatScreenState extends State { }, ), ), - if (bannerType != null) - Padding( - padding: const EdgeInsets.symmetric(vertical: 12, horizontal: 16), - child: NotificationBanner( - bannerType: bannerType, - chosenPlanId: chosenPlan?.id, - planName: chosenPlan?.plan.name, - planPrice: chosenOption?.price.toDouble(), - ), - ), ], + if (bannerType != null) + Padding( + padding: const EdgeInsets.symmetric(vertical: 12, horizontal: 16), + child: NotificationBanner( + bannerType: bannerType, + chosenPlanId: chosenPlan?.id, + planName: chosenPlan?.plan.name, + planPrice: chosenOption?.price.toDouble(), + ), + ), ], ), ), diff --git a/lib/features/consultations/services/consultation_service.dart b/lib/features/consultations/services/consultation_service.dart index e5236e0f..49ebe41c 100644 --- a/lib/features/consultations/services/consultation_service.dart +++ b/lib/features/consultations/services/consultation_service.dart @@ -9,5 +9,9 @@ abstract class ConsultationService { factory ConsultationService(Dio dio, {String baseUrl}) = _ConsultationService; @GET('/api/consultations') - Future getConsultations(); + Future getConsultations({ + @Query('filters[last_state][\$notIn][]') String query = 'canceled_by_the_initiator', + @Query('filters[last_state][\$notIn][]') String query2 = 'charge_was_collected', + @Query('sort[]') String sort = 'created_at:desc', + }); } diff --git a/lib/features/diary/presentation/widgets/calendar_widget.dart b/lib/features/diary/presentation/widgets/calendar_widget.dart index bc55d33a..2d584eb2 100644 --- a/lib/features/diary/presentation/widgets/calendar_widget.dart +++ b/lib/features/diary/presentation/widgets/calendar_widget.dart @@ -89,7 +89,9 @@ class _CalendarWidgetState extends State { return isSameDay(_selectedDay, day); }, onPageChanged: (focusedDay) { - _focusedDay = focusedDay; + setState(() { + _focusedDay = focusedDay; + }); }, onFormatChanged: (format) { if (_calendarFormat != format) { diff --git a/lib/features/notifications/presentation/widgets/notification_widget.dart b/lib/features/notifications/presentation/widgets/notification_widget.dart index ed63520c..848fecc2 100644 --- a/lib/features/notifications/presentation/widgets/notification_widget.dart +++ b/lib/features/notifications/presentation/widgets/notification_widget.dart @@ -46,7 +46,7 @@ class NotificationWidget extends StatelessWidget { ChosenPlanTomorrowReminderToConsultantNotification() => _ChosenPlanTomorrowReminderToConsultantWidget( notification: notification as ChosenPlanTomorrowReminderToConsultantNotification, ), - PlanSubscriptionPaidToAuthorNotification() => throw _PlanSubscriptionPaidToAuthorWidget( + PlanSubscriptionPaidToAuthorNotification() => _PlanSubscriptionPaidToAuthorWidget( notification: notification as PlanSubscriptionPaidToAuthorNotification, ), ChosenPlanFinishedToConsultantNotification() => _ChosenPlanFinishedToConsultantWidget( From a90efa8caaa64959caba6886f02e22ed294da2f8 Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Fri, 30 May 2025 12:58:37 +0300 Subject: [PATCH 2/3] fix: upd ver --- ios/Runner.xcodeproj/project.pbxproj | 6 +++--- ios/Runner/Info.plist | 2 +- .../bloc/registration_cubit/registration_cubit.dart | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index f9869e3a..2100a65d 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -388,7 +388,7 @@ CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_IDENTITY = "Apple Distribution: ITVIO, OOO (VL68C36HYS)"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 19; + CURRENT_PROJECT_VERSION = 20; DEVELOPMENT_TEAM = VL68C36HYS; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -538,7 +538,7 @@ CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_IDENTITY = "Apple Distribution: ITVIO, OOO (VL68C36HYS)"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 19; + CURRENT_PROJECT_VERSION = 20; DEVELOPMENT_TEAM = VL68C36HYS; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -576,7 +576,7 @@ CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_IDENTITY = "Apple Distribution: ITVIO, OOO (VL68C36HYS)"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 19; + CURRENT_PROJECT_VERSION = 20; DEVELOPMENT_TEAM = VL68C36HYS; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index 8abff7a5..c23a16a5 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -21,7 +21,7 @@ CFBundleSignature ???? CFBundleVersion - 19 + 20 ITSAppUsesNonExemptEncryption LSRequiresIPhoneOS diff --git a/lib/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart b/lib/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart index 5956f579..e3113e78 100644 --- a/lib/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart +++ b/lib/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart @@ -59,7 +59,7 @@ class RegistrationCubit extends Cubit { ); await TokenStorage.saveTokenInStorage(token); AppRouter.navigatorKey.currentContext?.go('/feed-screen'); - AppRouter.navigatorKey.currentContext?.goNamed('verifyEmailScreen'); + AppRouter.navigatorKey.currentContext?.pushNamed('verifyEmailScreen'); } catch (e) { log(e.toString()); } From 9f0ce55d4749322b2f66d6a966b82c34c9e3f47d Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Fri, 30 May 2025 15:33:32 +0300 Subject: [PATCH 3/3] fix(consultation): state filter, avatar --- .../widgets/consultation_card_widget.dart | 3 ++- .../consultations/services/consultation_service.dart | 11 +++++++++-- .../profile/presentation/pages/profile_screen.dart | 2 +- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/lib/features/consultations/presentation/widgets/consultation_card_widget.dart b/lib/features/consultations/presentation/widgets/consultation_card_widget.dart index 834f0e58..0752847b 100644 --- a/lib/features/consultations/presentation/widgets/consultation_card_widget.dart +++ b/lib/features/consultations/presentation/widgets/consultation_card_widget.dart @@ -1,4 +1,5 @@ import 'package:collection/collection.dart'; +import 'package:eatvio_app/core/const.dart'; import 'package:eatvio_app/core/theme/custom_text_style.dart'; import 'package:eatvio_app/core/theme/theme_helper.dart'; import 'package:eatvio_app/core/widgets/custom_divider.dart'; @@ -73,7 +74,7 @@ class _ConsultationCardWidgetState extends State { children: [ CircleAvatar( radius: 30, - backgroundImage: NetworkImage(widget.consultationsModel.userProfilePhotoUrl), + backgroundImage: NetworkImage(baseUrl + widget.consultationsModel.userProfilePhotoUrl), ), const SizedBox(width: 12), Column( diff --git a/lib/features/consultations/services/consultation_service.dart b/lib/features/consultations/services/consultation_service.dart index 49ebe41c..e099075e 100644 --- a/lib/features/consultations/services/consultation_service.dart +++ b/lib/features/consultations/services/consultation_service.dart @@ -10,8 +10,15 @@ abstract class ConsultationService { @GET('/api/consultations') Future getConsultations({ - @Query('filters[last_state][\$notIn][]') String query = 'canceled_by_the_initiator', - @Query('filters[last_state][\$notIn][]') String query2 = 'charge_was_collected', + @Query('filters[last_state][\$notIn][]') List excludedStates = const [ + 'initied', + 'in_coordination', + 'start_date_has_been_set', + 'pending_payment', + 'canceled_by_the_initiator', + 'charge_was_collected', + ], @Query('sort[]') String sort = 'created_at:desc', }); } + diff --git a/lib/features/profile/presentation/pages/profile_screen.dart b/lib/features/profile/presentation/pages/profile_screen.dart index 64c7dda7..9f9ba779 100644 --- a/lib/features/profile/presentation/pages/profile_screen.dart +++ b/lib/features/profile/presentation/pages/profile_screen.dart @@ -964,7 +964,7 @@ class _ProfileScreenState extends State { context.pushTransparentRoute( rootNavigator: true, PhotoViewScreen( - imageUrls: [state.profile.profilePhotoUrl], + imageUrls: [baseUrl + state.profile.profilePhotoUrl], index: 0, ), );