|
|
|
|
@ -1,6 +1,5 @@
|
|
|
|
|
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';
|
|
|
|
|
@ -13,8 +12,8 @@ import 'package:hmg_patient_app_new/features/my_appointments/my_appointments_vie
|
|
|
|
|
import 'package:hmg_patient_app_new/generated/locale_keys.g.dart';
|
|
|
|
|
import 'package:hmg_patient_app_new/presentation/book_appointment/widgets/appointment_calendar.dart';
|
|
|
|
|
import 'package:hmg_patient_app_new/presentation/book_appointment/widgets/doctor_rating_details.dart';
|
|
|
|
|
import 'package:hmg_patient_app_new/widgets/appbar/collapsing_list_view.dart';
|
|
|
|
|
import 'package:hmg_patient_app_new/theme/colors.dart';
|
|
|
|
|
import 'package:hmg_patient_app_new/widgets/appbar/collapsing_list_view.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';
|
|
|
|
|
@ -56,7 +55,9 @@ class DoctorProfilePage extends StatelessWidget {
|
|
|
|
|
doctorID: viewModel.doctorsProfileResponseModel.doctorID ?? 0,
|
|
|
|
|
isActive: viewModel.isFavouriteDoctor,
|
|
|
|
|
onSuccess: (response) {
|
|
|
|
|
Utils.showToast(viewModel.isFavouriteDoctor ? LocaleKeys.doctorAddedToFavourite.tr(context: context) : LocaleKeys.doctorRemovedFromFavourite.tr(context: context));
|
|
|
|
|
Utils.showToast(viewModel.isFavouriteDoctor
|
|
|
|
|
? LocaleKeys.doctorAddedToFavourite.tr(context: context)
|
|
|
|
|
: LocaleKeys.doctorRemovedFromFavourite.tr(context: context));
|
|
|
|
|
// Successfully added/removed favorite - refresh the favorites list
|
|
|
|
|
getIt.get<MyAppointmentsViewModel>().refreshFavouriteDoctors();
|
|
|
|
|
},
|
|
|
|
|
@ -75,7 +76,7 @@ class DoctorProfilePage extends StatelessWidget {
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
// SizedBox(height: 24.h),
|
|
|
|
|
isFoldable ? SizedBox(height: 24.h) : SizedBox.shrink(),
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
@ -87,18 +88,21 @@ class DoctorProfilePage extends StatelessWidget {
|
|
|
|
|
width: 63.h,
|
|
|
|
|
height: 63.h,
|
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
|
).circle(100),
|
|
|
|
|
).circle(100.r),
|
|
|
|
|
SizedBox(width: 8.h),
|
|
|
|
|
Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
SizedBox(
|
|
|
|
|
width: 220.h,
|
|
|
|
|
child: ("${bookAppointmentsViewModel.doctorsProfileResponseModel.doctorTitleForProfile} ${bookAppointmentsViewModel.doctorsProfileResponseModel.doctorName}")
|
|
|
|
|
.toString()
|
|
|
|
|
.toText24(isBold: true),
|
|
|
|
|
width: isFoldable ? 250.w : 220.w,
|
|
|
|
|
child:
|
|
|
|
|
("${bookAppointmentsViewModel.doctorsProfileResponseModel.doctorTitleForProfile} ${bookAppointmentsViewModel.doctorsProfileResponseModel.doctorName}")
|
|
|
|
|
.toString()
|
|
|
|
|
.toText24(isBold: true),
|
|
|
|
|
),
|
|
|
|
|
(bookAppointmentsViewModel.doctorsProfileResponseModel.specialty!.isNotEmpty ? bookAppointmentsViewModel.doctorsProfileResponseModel.specialty!.first : "")
|
|
|
|
|
(bookAppointmentsViewModel.doctorsProfileResponseModel.specialty!.isNotEmpty
|
|
|
|
|
? bookAppointmentsViewModel.doctorsProfileResponseModel.specialty!.first
|
|
|
|
|
: "")
|
|
|
|
|
.toString()
|
|
|
|
|
.toText18(isBold: true, color: AppColors.primaryRedColor),
|
|
|
|
|
],
|
|
|
|
|
@ -137,12 +141,16 @@ class DoctorProfilePage extends StatelessWidget {
|
|
|
|
|
children: [
|
|
|
|
|
Column(
|
|
|
|
|
children: [
|
|
|
|
|
Utils.buildSvgWithAssets(icon: AppAssets.doctor_profile_rating_icon, width: 48.w, height: 48.h, fit: BoxFit.contain, applyThemeColor: false),
|
|
|
|
|
Utils.buildSvgWithAssets(
|
|
|
|
|
icon: AppAssets.doctor_profile_rating_icon, width: 48.w, height: 48.h, fit: BoxFit.contain, applyThemeColor: false),
|
|
|
|
|
SizedBox(height: 16.h),
|
|
|
|
|
LocaleKeys.ratings.tr(context: context).toText12(isBold: true, color: AppColors.greyTextColor),
|
|
|
|
|
bookAppointmentsViewModel.doctorsProfileResponseModel.decimalDoctorRate
|
|
|
|
|
.toString()
|
|
|
|
|
.toText16(isBold: true, color: AppColors.textColor, isUnderLine: true, decorationColor: AppColors.textColor, fontFamily: "Poppins"),
|
|
|
|
|
bookAppointmentsViewModel.doctorsProfileResponseModel.decimalDoctorRate.toString().toText16(
|
|
|
|
|
isBold: true,
|
|
|
|
|
color: AppColors.textColor,
|
|
|
|
|
isUnderLine: true,
|
|
|
|
|
decorationColor: AppColors.textColor,
|
|
|
|
|
fontFamily: "Poppins"),
|
|
|
|
|
],
|
|
|
|
|
).onPress(() {
|
|
|
|
|
bookAppointmentsViewModel.getDoctorRatingDetails();
|
|
|
|
|
@ -158,11 +166,18 @@ class DoctorProfilePage extends StatelessWidget {
|
|
|
|
|
SizedBox(width: 36.w),
|
|
|
|
|
Column(
|
|
|
|
|
children: [
|
|
|
|
|
Utils.buildSvgWithAssets(icon: AppAssets.doctor_profile_reviews_icon, width: 48.w, height: 48.h, fit: BoxFit.contain, applyThemeColor: false),
|
|
|
|
|
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(isBold: true, color: AppColors.greyTextColor),
|
|
|
|
|
NumberFormat.decimalPattern().format(bookAppointmentsViewModel.doctorsProfileResponseModel.noOfPatientsRate ?? 0)
|
|
|
|
|
.toText16(isBold: true, color: AppColors.textColor, isUnderLine: true, decorationColor: AppColors.textColor, fontFamily: "Poppins"),
|
|
|
|
|
NumberFormat.decimalPattern()
|
|
|
|
|
.format(bookAppointmentsViewModel.doctorsProfileResponseModel.noOfPatientsRate ?? 0)
|
|
|
|
|
.toText16(
|
|
|
|
|
isBold: true,
|
|
|
|
|
color: AppColors.textColor,
|
|
|
|
|
isUnderLine: true,
|
|
|
|
|
decorationColor: AppColors.textColor,
|
|
|
|
|
fontFamily: "Poppins"),
|
|
|
|
|
],
|
|
|
|
|
).onPress(() {
|
|
|
|
|
bookAppointmentsViewModel.getDoctorRatingDetails();
|
|
|
|
|
@ -182,92 +197,97 @@ class DoctorProfilePage extends StatelessWidget {
|
|
|
|
|
SizedBox(height: 16.h),
|
|
|
|
|
LocaleKeys.information.tr(context: context).toText14(isBold: true, color: AppColors.textColor),
|
|
|
|
|
SizedBox(height: 6.h),
|
|
|
|
|
(bookAppointmentsViewModel.doctorsProfileResponseModel.doctorProfileInfo ?? "").trim().toText12(isBold: true, color: AppColors.greyTextColor),
|
|
|
|
|
(bookAppointmentsViewModel.doctorsProfileResponseModel.doctorProfileInfo ?? "")
|
|
|
|
|
.trim()
|
|
|
|
|
.toText12(isBold: true, color: AppColors.greyTextColor),
|
|
|
|
|
SizedBox(height: 24.h),
|
|
|
|
|
],
|
|
|
|
|
).paddingSymmetrical(24.h, 0.h),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
isDoctorAllowedToBook ? Container(
|
|
|
|
|
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
|
|
|
|
|
color: AppColors.whiteColor,
|
|
|
|
|
borderRadius: 24.h,
|
|
|
|
|
hasShadow: true,
|
|
|
|
|
),
|
|
|
|
|
child: CustomButton(
|
|
|
|
|
text: LocaleKeys.viewAvailableAppointments.tr(),
|
|
|
|
|
onPressed: () async {
|
|
|
|
|
bookAppointmentsViewModel.selectedDoctor.speciality = bookAppointmentsViewModel.doctorsProfileResponseModel.specialty;
|
|
|
|
|
bookAppointmentsViewModel.selectedDoctor.specialityN = bookAppointmentsViewModel.doctorsProfileResponseModel.specialty;
|
|
|
|
|
bookAppointmentsViewModel.selectedDoctor.name = bookAppointmentsViewModel.doctorsProfileResponseModel.doctorName;
|
|
|
|
|
bookAppointmentsViewModel.selectedDoctor.doctorImageURL = bookAppointmentsViewModel.doctorsProfileResponseModel.doctorImageURL;
|
|
|
|
|
bookAppointmentsViewModel.selectedDoctor.nationalityFlagURL = bookAppointmentsViewModel.doctorsProfileResponseModel.nationalityFlagURL;
|
|
|
|
|
bookAppointmentsViewModel.selectedDoctor.clinicName = bookAppointmentsViewModel.doctorsProfileResponseModel.clinicDescription;
|
|
|
|
|
bookAppointmentsViewModel.selectedDoctor.projectName = bookAppointmentsViewModel.doctorsProfileResponseModel.projectName;
|
|
|
|
|
isDoctorAllowedToBook
|
|
|
|
|
? Container(
|
|
|
|
|
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
|
|
|
|
|
color: AppColors.whiteColor,
|
|
|
|
|
borderRadius: 24.h,
|
|
|
|
|
hasShadow: true,
|
|
|
|
|
),
|
|
|
|
|
child: CustomButton(
|
|
|
|
|
text: LocaleKeys.viewAvailableAppointments.tr(),
|
|
|
|
|
onPressed: () async {
|
|
|
|
|
bookAppointmentsViewModel.selectedDoctor.speciality = bookAppointmentsViewModel.doctorsProfileResponseModel.specialty;
|
|
|
|
|
bookAppointmentsViewModel.selectedDoctor.specialityN = bookAppointmentsViewModel.doctorsProfileResponseModel.specialty;
|
|
|
|
|
bookAppointmentsViewModel.selectedDoctor.name = bookAppointmentsViewModel.doctorsProfileResponseModel.doctorName;
|
|
|
|
|
bookAppointmentsViewModel.selectedDoctor.doctorImageURL = bookAppointmentsViewModel.doctorsProfileResponseModel.doctorImageURL;
|
|
|
|
|
bookAppointmentsViewModel.selectedDoctor.nationalityFlagURL =
|
|
|
|
|
bookAppointmentsViewModel.doctorsProfileResponseModel.nationalityFlagURL;
|
|
|
|
|
bookAppointmentsViewModel.selectedDoctor.clinicName = bookAppointmentsViewModel.doctorsProfileResponseModel.clinicDescription;
|
|
|
|
|
bookAppointmentsViewModel.selectedDoctor.projectName = bookAppointmentsViewModel.doctorsProfileResponseModel.projectName;
|
|
|
|
|
|
|
|
|
|
LoaderBottomSheet.showLoader();
|
|
|
|
|
bookAppointmentsViewModel.isLiveCareSchedule
|
|
|
|
|
? await bookAppointmentsViewModel.getLiveCareDoctorFreeSlots(
|
|
|
|
|
isBookingForLiveCare: true,
|
|
|
|
|
onSuccess: (dynamic respData) async {
|
|
|
|
|
LoaderBottomSheet.hideLoader();
|
|
|
|
|
showCommonBottomSheetWithoutHeight(
|
|
|
|
|
title: LocaleKeys.pickADate.tr(),
|
|
|
|
|
context,
|
|
|
|
|
child: AppointmentCalendar(),
|
|
|
|
|
isFullScreen: false,
|
|
|
|
|
isCloseButtonVisible: true,
|
|
|
|
|
callBackFunc: () {},
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
onError: (err) {
|
|
|
|
|
LoaderBottomSheet.hideLoader();
|
|
|
|
|
showCommonBottomSheetWithoutHeight(
|
|
|
|
|
context,
|
|
|
|
|
child: Utils.getErrorWidget(loadingText: err),
|
|
|
|
|
callBackFunc: () {},
|
|
|
|
|
isFullScreen: false,
|
|
|
|
|
isCloseButtonVisible: true,
|
|
|
|
|
);
|
|
|
|
|
})
|
|
|
|
|
: await bookAppointmentsViewModel.getDoctorFreeSlots(
|
|
|
|
|
isBookingForLiveCare: false,
|
|
|
|
|
onSuccess: (dynamic respData) async {
|
|
|
|
|
LoaderBottomSheet.hideLoader();
|
|
|
|
|
showCommonBottomSheetWithoutHeight(
|
|
|
|
|
title: LocaleKeys.pickADate.tr() ,
|
|
|
|
|
context,
|
|
|
|
|
child: AppointmentCalendar(),
|
|
|
|
|
isFullScreen: false,
|
|
|
|
|
isCloseButtonVisible: true,
|
|
|
|
|
callBackFunc: () {},
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
onError: (err) {
|
|
|
|
|
LoaderBottomSheet.hideLoader();
|
|
|
|
|
showCommonBottomSheetWithoutHeight(
|
|
|
|
|
context,
|
|
|
|
|
child: Utils.getErrorWidget(loadingText: err),
|
|
|
|
|
callBackFunc: () {},
|
|
|
|
|
isFullScreen: false,
|
|
|
|
|
isCloseButtonVisible: true,
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
backgroundColor: AppColors.primaryRedColor,
|
|
|
|
|
borderColor: AppColors.primaryRedColor,
|
|
|
|
|
textColor: Colors.white,
|
|
|
|
|
fontSize: 16,
|
|
|
|
|
isBold: true,
|
|
|
|
|
borderRadius: 12,
|
|
|
|
|
padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
|
|
|
|
|
height: 50.h,
|
|
|
|
|
icon: AppAssets.calendar,
|
|
|
|
|
iconColor: Colors.white,
|
|
|
|
|
iconSize: 20.h,
|
|
|
|
|
).paddingSymmetrical(24.h, 24.h),
|
|
|
|
|
) : SizedBox.shrink(),
|
|
|
|
|
LoaderBottomSheet.showLoader();
|
|
|
|
|
bookAppointmentsViewModel.isLiveCareSchedule
|
|
|
|
|
? await bookAppointmentsViewModel.getLiveCareDoctorFreeSlots(
|
|
|
|
|
isBookingForLiveCare: true,
|
|
|
|
|
onSuccess: (dynamic respData) async {
|
|
|
|
|
LoaderBottomSheet.hideLoader();
|
|
|
|
|
showCommonBottomSheetWithoutHeight(
|
|
|
|
|
title: LocaleKeys.pickADate.tr(),
|
|
|
|
|
context,
|
|
|
|
|
child: AppointmentCalendar(),
|
|
|
|
|
isFullScreen: false,
|
|
|
|
|
isCloseButtonVisible: true,
|
|
|
|
|
callBackFunc: () {},
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
onError: (err) {
|
|
|
|
|
LoaderBottomSheet.hideLoader();
|
|
|
|
|
showCommonBottomSheetWithoutHeight(
|
|
|
|
|
context,
|
|
|
|
|
child: Utils.getErrorWidget(loadingText: err),
|
|
|
|
|
callBackFunc: () {},
|
|
|
|
|
isFullScreen: false,
|
|
|
|
|
isCloseButtonVisible: true,
|
|
|
|
|
);
|
|
|
|
|
})
|
|
|
|
|
: await bookAppointmentsViewModel.getDoctorFreeSlots(
|
|
|
|
|
isBookingForLiveCare: false,
|
|
|
|
|
onSuccess: (dynamic respData) async {
|
|
|
|
|
LoaderBottomSheet.hideLoader();
|
|
|
|
|
showCommonBottomSheetWithoutHeight(
|
|
|
|
|
title: LocaleKeys.pickADate.tr(),
|
|
|
|
|
context,
|
|
|
|
|
child: AppointmentCalendar(),
|
|
|
|
|
isFullScreen: false,
|
|
|
|
|
isCloseButtonVisible: true,
|
|
|
|
|
callBackFunc: () {},
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
onError: (err) {
|
|
|
|
|
LoaderBottomSheet.hideLoader();
|
|
|
|
|
showCommonBottomSheetWithoutHeight(
|
|
|
|
|
context,
|
|
|
|
|
child: Utils.getErrorWidget(loadingText: err),
|
|
|
|
|
callBackFunc: () {},
|
|
|
|
|
isFullScreen: false,
|
|
|
|
|
isCloseButtonVisible: true,
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
backgroundColor: AppColors.primaryRedColor,
|
|
|
|
|
borderColor: AppColors.primaryRedColor,
|
|
|
|
|
textColor: Colors.white,
|
|
|
|
|
fontSize: 16,
|
|
|
|
|
isBold: true,
|
|
|
|
|
borderRadius: 12,
|
|
|
|
|
padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
|
|
|
|
|
height: 50.h,
|
|
|
|
|
icon: AppAssets.calendar,
|
|
|
|
|
iconColor: Colors.white,
|
|
|
|
|
iconSize: 20.h,
|
|
|
|
|
).paddingSymmetrical(24.h, 24.h),
|
|
|
|
|
)
|
|
|
|
|
: SizedBox.shrink(),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
|