|
|
|
|
@ -1,19 +1,27 @@
|
|
|
|
|
import 'package:easy_localization/easy_localization.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:hmg_patient_app_new/core/app_assets.dart';
|
|
|
|
|
import 'package:hmg_patient_app_new/core/dependencies.dart';
|
|
|
|
|
import 'package:hmg_patient_app_new/core/utils/date_util.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/string_extensions.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/features/book_appointments/models/resp_models/doctors_list_response_model.dart';
|
|
|
|
|
import 'package:hmg_patient_app_new/features/my_appointments/models/resp_models/patient_appointment_history_response_model.dart';
|
|
|
|
|
import 'package:hmg_patient_app_new/features/my_appointments/utils/appointment_type.dart';
|
|
|
|
|
import 'package:hmg_patient_app_new/generated/locale_keys.g.dart';
|
|
|
|
|
import 'package:hmg_patient_app_new/presentation/book_appointment/doctor_profile_page.dart';
|
|
|
|
|
import 'package:hmg_patient_app_new/theme/colors.dart';
|
|
|
|
|
import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart';
|
|
|
|
|
import 'package:hmg_patient_app_new/widgets/chip/app_custom_chip_widget.dart';
|
|
|
|
|
import 'package:hmg_patient_app_new/widgets/common_bottom_sheet.dart';
|
|
|
|
|
import 'dart:ui' as ui;
|
|
|
|
|
|
|
|
|
|
import 'package:hmg_patient_app_new/widgets/loader/bottomsheet_loader.dart';
|
|
|
|
|
import 'package:hmg_patient_app_new/widgets/routes/custom_page_route.dart';
|
|
|
|
|
|
|
|
|
|
class AppointmentDoctorCard extends StatelessWidget {
|
|
|
|
|
const AppointmentDoctorCard(
|
|
|
|
|
{super.key, required this.patientAppointmentHistoryResponseModel, required this.onRescheduleTap, required this.onCancelTap, required this.onAskDoctorTap, this.renderWidgetForERDisplay = false});
|
|
|
|
|
@ -66,7 +74,7 @@ class AppointmentDoctorCard extends StatelessWidget {
|
|
|
|
|
children: [
|
|
|
|
|
Utils.buildSvgWithAssets(icon: AppAssets.rating_icon, width: 15.w, height: 15.h, iconColor: AppColors.ratingColorYellow),
|
|
|
|
|
SizedBox(height: 2.h),
|
|
|
|
|
"${patientAppointmentHistoryResponseModel.decimalDoctorRate ?? 0.0}".toText11(isBold: true, color: AppColors.textColor),
|
|
|
|
|
"${patientAppointmentHistoryResponseModel.decimalDoctorRate ?? 0.0}".toText11(isBold: true, color: AppColors.textColor, isEnglishOnly: true),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
).circle(100),
|
|
|
|
|
@ -75,6 +83,7 @@ class AppointmentDoctorCard extends StatelessWidget {
|
|
|
|
|
),
|
|
|
|
|
SizedBox(width: 16.w),
|
|
|
|
|
Expanded(
|
|
|
|
|
flex: 9,
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
@ -120,6 +129,42 @@ class AppointmentDoctorCard extends StatelessWidget {
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Expanded(
|
|
|
|
|
flex: 1,
|
|
|
|
|
child: Utils.buildSvgWithAssets(icon: AppAssets.doctor_profile_icon, width: 20.h, height: 20.h, fit: BoxFit.scaleDown),
|
|
|
|
|
).onPress(() async {
|
|
|
|
|
DoctorsListResponseModel selectedDoctor = DoctorsListResponseModel();
|
|
|
|
|
selectedDoctor.doctorID = patientAppointmentHistoryResponseModel.doctorID;
|
|
|
|
|
selectedDoctor.doctorImageURL = patientAppointmentHistoryResponseModel.doctorImageURL;
|
|
|
|
|
selectedDoctor.name = patientAppointmentHistoryResponseModel.doctorNameObj;
|
|
|
|
|
selectedDoctor.doctorTitle = patientAppointmentHistoryResponseModel.doctorTitle;
|
|
|
|
|
selectedDoctor.nationalityFlagURL = "";
|
|
|
|
|
selectedDoctor.speciality = patientAppointmentHistoryResponseModel.doctorSpeciality;
|
|
|
|
|
selectedDoctor.clinicName = patientAppointmentHistoryResponseModel.clinicName;
|
|
|
|
|
selectedDoctor.projectName = patientAppointmentHistoryResponseModel.projectName;
|
|
|
|
|
selectedDoctor.clinicID = patientAppointmentHistoryResponseModel.clinicID;
|
|
|
|
|
selectedDoctor.projectID = patientAppointmentHistoryResponseModel.projectID;
|
|
|
|
|
|
|
|
|
|
getIt.get<BookAppointmentsViewModel>().setSelectedDoctor(selectedDoctor);
|
|
|
|
|
LoaderBottomSheet.showLoader();
|
|
|
|
|
await getIt.get<BookAppointmentsViewModel>().getDoctorProfile(onSuccess: (dynamic respData) {
|
|
|
|
|
LoaderBottomSheet.hideLoader();
|
|
|
|
|
Navigator.of(context).push(
|
|
|
|
|
CustomPageRoute(
|
|
|
|
|
page: DoctorProfilePage(),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}, onError: (err) {
|
|
|
|
|
LoaderBottomSheet.hideLoader();
|
|
|
|
|
showCommonBottomSheetWithoutHeight(
|
|
|
|
|
context,
|
|
|
|
|
child: Utils.getErrorWidget(loadingText: err),
|
|
|
|
|
callBackFunc: () {},
|
|
|
|
|
isFullScreen: false,
|
|
|
|
|
isCloseButtonVisible: true,
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: 8.h),
|
|
|
|
|
|