Merge pull request 'feat(chat, consutations): fixed chat screen and consultations screen' (#415) from misha/eatvio_app:main into main

Reviewed-on: eatvio/eatvio_app#415
This commit is contained in:
mso7nueh
2025-05-06 10:38:13 +00:00
2 changed files with 8 additions and 9 deletions

View File

@@ -86,12 +86,11 @@ class _ChatScreenState extends State<ChatScreen> {
_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<ChatScreen> {
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<ChatScreen> {
itemCount: state.chatMessages.length + (state.isLoading ? 1 : 0),
),
const SizedBox(height: 16),
if (!showUserDetailsButton) ...[
if (showUserDetailsButton) ...[
// OrderCard(
// plan: chosenPlan.plan,
// isCustomerView: !amIConsultant,

View File

@@ -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<ConsultationPaginationModel> getConsultations();
}