@ -243,88 +243,88 @@ class AppointmentCard extends StatelessWidget {
( patientAppointmentHistoryResponseModel . isExecludeDoctor ? ? false ) | |
! Utils . isClinicAllowedForRebook ( patientAppointmentHistoryResponseModel . clinicID ? ? 0 ) ) ) & &
AppointmentType . isArrived ( patientAppointmentHistoryResponseModel ) ) {
if ( ( ( patientAppointmentHistoryResponseModel . isLiveCareAppointment ? ? false ) & &
DateTime . now ( ) . difference ( DateUtil . convertStringToDate ( patientAppointmentHistoryResponseModel . appointmentDate ) ) . inDays < = 15 ) ) {
return Row (
children: [
Expanded (
flex: 6 ,
child: CustomButton (
text: LocaleKeys . askDoctor . tr ( context: context ) ,
onPressed: ( ) async {
LoaderBottomSheet . showLoader ( loadingText: LocaleKeys . checkingDoctorAvailability . tr ( context: context ) ) ;
await myAppointmentsViewModel . isDoctorAvailable (
projectID: patientAppointmentHistoryResponseModel . projectID ,
doctorId: patientAppointmentHistoryResponseModel . doctorID ,
clinicId: patientAppointmentHistoryResponseModel . clinicID ,
onSuccess: ( value ) async {
if ( value ) {
await myAppointmentsViewModel . getAskDoctorRequestTypes ( onSuccess: ( val ) {
LoaderBottomSheet . hideLoader ( ) ;
showCommonBottomSheetWithoutHeight (
context ,
title: LocaleKeys . askDoctor . tr ( context: context ) ,
child: AskDoctorRequestTypeSelect (
askDoctorRequestTypeList: myAppointmentsViewModel . askDoctorRequestTypeList ,
myAppointmentsViewModel: myAppointmentsViewModel ,
patientAppointmentHistoryResponseModel: patientAppointmentHistoryResponseModel ,
) ,
callBackFunc: ( ) { } ,
isFullScreen: false ,
isCloseButtonVisible: true ,
) ;
} ) ;
} else {
print ( " Doctor is not available " ) ;
}
} ) ;
} ,
backgroundColor: AppColors . secondaryLightRedColor ,
borderColor: AppColors . secondaryLightRedColor ,
textColor: AppColors . primaryRedColor ,
fontSize: ( isFoldable | | isTablet ) ? 12. f : 14. f ,
fontWeight: FontWeight . w600 ,
borderRadius: 12. r ,
padding: EdgeInsets . symmetric ( horizontal: 10. w ) ,
/ / height: isTablet | | isFoldable ? 46. h : 40. h ,
height: 40. h ,
icon: AppAssets . ask_doctor_icon ,
iconColor: AppColors . primaryRedColor ,
iconSize: 16. h ,
) ,
) ,
SizedBox ( width: 8. h ) ,
Expanded (
flex: 1 ,
child: Container (
height: ( isFoldable | | isTablet ) ? 50. h : 40. h ,
decoration: RoundedRectangleBorder ( ) . toSmoothCornerDecoration (
color: AppColors . textColor ,
borderRadius: 10. h ,
side: BorderSide (
color: AppColors . textColor ,
width: 1.2 ,
) ,
) ,
child: Transform . flip (
flipX: appState . isArabic ( ) ,
child: Utils . buildSvgWithAssets (
icon: AppAssets . forward_arrow_icon ,
iconColor: AppColors . whiteColor ,
width: 24. w ,
height: 24. h ,
fit: BoxFit . contain ,
) ,
) ,
) . toShimmer2 ( isShow: isLoading ) . onPress ( ( ) {
_goToDetails ( context ) ;
} ) ,
) ,
] ,
) ;
} else {
return CustomButton (
text: isFromMedicalReport ? LocaleKeys . selectAppointment . tr ( context: context ) : LocaleKeys . viewDetails . tr ( context: context ) ,
/ / if ( ( ( patientAppointmentHistoryResponseModel . isLiveCareAppointment ? ? false ) & &
/ / DateTime . now ( ) . difference ( DateUtil . convertStringToDate ( patientAppointmentHistoryResponseModel . appointmentDate ) ) . inDays < = 15 ) ) {
/ / return Row (
/ / children: [
/ / Expanded (
/ / flex: 6 ,
/ / child: CustomButton (
/ / text: LocaleKeys . askDoctor . tr ( context: context ) ,
/ / onPressed: ( ) async {
/ / LoaderBottomSheet . showLoader ( loadingText: LocaleKeys . checkingDoctorAvailability . tr ( context: context ) ) ;
/ / await myAppointmentsViewModel . isDoctorAvailable (
/ / projectID: patientAppointmentHistoryResponseModel . projectID ,
/ / doctorId: patientAppointmentHistoryResponseModel . doctorID ,
/ / clinicId: patientAppointmentHistoryResponseModel . clinicID ,
/ / onSuccess: ( value ) async {
/ / if ( value ) {
/ / await myAppointmentsViewModel . getAskDoctorRequestTypes ( onSuccess: ( val ) {
/ / LoaderBottomSheet . hideLoader ( ) ;
/ / showCommonBottomSheetWithoutHeight (
/ / context ,
/ / title: LocaleKeys . askDoctor . tr ( context: context ) ,
/ / child: AskDoctorRequestTypeSelect (
/ / askDoctorRequestTypeList: myAppointmentsViewModel . askDoctorRequestTypeList ,
/ / myAppointmentsViewModel: myAppointmentsViewModel ,
/ / patientAppointmentHistoryResponseModel: patientAppointmentHistoryResponseModel ,
/ / ) ,
/ / callBackFunc: ( ) { } ,
/ / isFullScreen: false ,
/ / isCloseButtonVisible: true ,
/ / ) ;
/ / } ) ;
/ / } else {
/ / print ( " Doctor is not available " ) ;
/ / }
/ / } ) ;
/ / } ,
/ / backgroundColor: AppColors . secondaryLightRedColor ,
/ / borderColor: AppColors . secondaryLightRedColor ,
/ / textColor: AppColors . primaryRedColor ,
/ / fontSize: ( isFoldable | | isTablet ) ? 12. f : 14. f ,
/ / fontWeight: FontWeight . w600 ,
/ / borderRadius: 12. r ,
/ / padding: EdgeInsets . symmetric ( horizontal: 10. w ) ,
/ / / / height: isTablet | | isFoldable ? 46. h : 40. h ,
/ / height: 40. h ,
/ / icon: AppAssets . ask_doctor_icon ,
/ / iconColor: AppColors . primaryRedColor ,
/ / iconSize: 16. h ,
/ / ) ,
/ / ) ,
/ / SizedBox ( width: 8. h ) ,
/ / Expanded (
/ / flex: 1 ,
/ / child: Container (
/ / height: ( isFoldable | | isTablet ) ? 50. h : 40. h ,
/ / decoration: RoundedRectangleBorder ( ) . toSmoothCornerDecoration (
/ / color: AppColors . textColor ,
/ / borderRadius: 10. h ,
/ / side: BorderSide (
/ / color: AppColors . textColor ,
/ / width: 1.2 ,
/ / ) ,
/ / ) ,
/ / child: Transform . flip (
/ / flipX: appState . isArabic ( ) ,
/ / child: Utils . buildSvgWithAssets (
/ / icon: AppAssets . forward_arrow_icon ,
/ / iconColor: AppColors . whiteColor ,
/ / width: 24. w ,
/ / height: 24. h ,
/ / fit: BoxFit . contain ,
/ / ) ,
/ / ) ,
/ / ) . toShimmer2 ( isShow: isLoading ) . onPress ( ( ) {
/ / _goToDetails ( context ) ;
/ / } ) ,
/ / ) ,
/ / ] ,
/ / ) ;
/ / } else {
return CustomButton (
text: isFromMedicalReport ? LocaleKeys . selectAppointment . tr ( context: context ) : LocaleKeys . viewDetails . tr ( context: context ) ,
onPressed: ( ) {
if ( isFromMedicalReport ) {
if ( isForFeedback ) {
@ -359,7 +359,7 @@ class AppointmentCard extends StatelessWidget {
iconColor: AppColors . primaryRedColor ,
iconSize: 16. h ,
) ;
}
/ / }
} else {
if ( isFromMedicalReport ) {
if ( isForEyeMeasurements ) {
@ -390,8 +390,9 @@ class AppointmentCard extends StatelessWidget {
) ;
}
}
return Row (
children: [
return ( patientAppointmentHistoryResponseModel . isActiveDoctor ? ? true )
? Row (
children: [
Expanded (
flex: 6 ,
child: ( AppointmentType . isArrived ( patientAppointmentHistoryResponseModel )
@ -441,58 +442,85 @@ class AppointmentCard extends StatelessWidget {
} ) ,
) ,
] ,
) ;
)
: CustomButton (
text: LocaleKeys . viewDetails . tr ( context: context ) ,
onPressed: ( ) {
Navigator . of ( context )
. push (
CustomPageRoute (
page: AppointmentDetailsPage ( patientAppointmentHistoryResponseModel: patientAppointmentHistoryResponseModel ) ,
) ,
)
. then ( ( _ ) {
myAppointmentsViewModel . initAppointmentsViewModel ( ) ;
myAppointmentsViewModel . getPatientAppointments ( true , false ) ;
} ) ;
} ,
backgroundColor: AppColors . secondaryLightRedColor ,
borderColor: AppColors . secondaryLightRedColor ,
textColor: AppColors . primaryRedColor ,
fontSize: ( isFoldable | | isTablet ) ? 12. f : 14. f ,
fontWeight: FontWeight . w600 ,
borderRadius: 12. r ,
padding: EdgeInsets . symmetric ( horizontal: 10. w ) ,
/ / height: isTablet | | isFoldable ? 46. h : 40. h ,
height: 40. h ,
icon: isFromMedicalReport ? AppAssets . checkmark_icon : null ,
iconColor: AppColors . primaryRedColor ,
iconSize: 16. h ,
) ;
}
}
Widget _getArrivedButton ( BuildContext context ) {
final isRecent = DateTime . now ( ) . difference ( DateUtil . convertStringToDate ( patientAppointmentHistoryResponseModel . appointmentDate ) ) . inDays < = 15 ;
if ( isRecent ) {
return CustomButton (
text: LocaleKeys . askDoctor . tr ( context: context ) ,
onPressed: ( ) async {
LoaderBottomSheet . showLoader ( loadingText: LocaleKeys . checkingDoctorAvailability . tr ( context: context ) ) ;
await myAppointmentsViewModel . isDoctorAvailable (
projectID: patientAppointmentHistoryResponseModel . projectID ,
doctorId: patientAppointmentHistoryResponseModel . doctorID ,
clinicId: patientAppointmentHistoryResponseModel . clinicID ,
onSuccess: ( value ) async {
if ( value ) {
await myAppointmentsViewModel . getAskDoctorRequestTypes ( onSuccess: ( val ) {
LoaderBottomSheet . hideLoader ( ) ;
showCommonBottomSheetWithoutHeight (
context ,
title: LocaleKeys . askDoctor . tr ( context: context ) ,
child: AskDoctorRequestTypeSelect (
askDoctorRequestTypeList: myAppointmentsViewModel . askDoctorRequestTypeList ,
myAppointmentsViewModel: myAppointmentsViewModel ,
patientAppointmentHistoryResponseModel: patientAppointmentHistoryResponseModel ,
) ,
callBackFunc: ( ) { } ,
isFullScreen: false ,
isCloseButtonVisible: true ,
) ;
} ) ;
} else {
print ( " Doctor is not available " ) ;
}
} ) ;
} ,
backgroundColor: AppColors . secondaryLightRedColor ,
borderColor: AppColors . secondaryLightRedColor ,
textColor: AppColors . primaryRedColor ,
fontSize: ( isFoldable | | isTablet ) ? 12. f : 14. f ,
fontWeight: FontWeight . w600 ,
borderRadius: 12. r ,
padding: EdgeInsets . symmetric ( horizontal: 10. w ) ,
/ / height: isTablet | | isFoldable ? 46. h : 40. h ,
height: 40. h ,
icon: AppAssets . ask_doctor_icon ,
iconColor: AppColors . primaryRedColor ,
iconSize: 16. h ,
) ;
}
/ / final isRecent = DateTime . now ( ) . difference ( DateUtil . convertStringToDate ( patientAppointmentHistoryResponseModel . appointmentDate ) ) . inDays < = 15 ;
/ /
/ / if ( isRecent ) {
/ / return CustomButton (
/ / text: LocaleKeys . askDoctor . tr ( context: context ) ,
/ / onPressed: ( ) async {
/ / LoaderBottomSheet . showLoader ( loadingText: LocaleKeys . checkingDoctorAvailability . tr ( context: context ) ) ;
/ / await myAppointmentsViewModel . isDoctorAvailable (
/ / projectID: patientAppointmentHistoryResponseModel . projectID ,
/ / doctorId: patientAppointmentHistoryResponseModel . doctorID ,
/ / clinicId: patientAppointmentHistoryResponseModel . clinicID ,
/ / onSuccess: ( value ) async {
/ / if ( value ) {
/ / await myAppointmentsViewModel . getAskDoctorRequestTypes ( onSuccess: ( val ) {
/ / LoaderBottomSheet . hideLoader ( ) ;
/ / showCommonBottomSheetWithoutHeight (
/ / context ,
/ / title: LocaleKeys . askDoctor . tr ( context: context ) ,
/ / child: AskDoctorRequestTypeSelect (
/ / askDoctorRequestTypeList: myAppointmentsViewModel . askDoctorRequestTypeList ,
/ / myAppointmentsViewModel: myAppointmentsViewModel ,
/ / patientAppointmentHistoryResponseModel: patientAppointmentHistoryResponseModel ,
/ / ) ,
/ / callBackFunc: ( ) { } ,
/ / isFullScreen: false ,
/ / isCloseButtonVisible: true ,
/ / ) ;
/ / } ) ;
/ / } else {
/ / print ( " Doctor is not available " ) ;
/ / }
/ / } ) ;
/ / } ,
/ / backgroundColor: AppColors . secondaryLightRedColor ,
/ / borderColor: AppColors . secondaryLightRedColor ,
/ / textColor: AppColors . primaryRedColor ,
/ / fontSize: ( isFoldable | | isTablet ) ? 12. f : 14. f ,
/ / fontWeight: FontWeight . w600 ,
/ / borderRadius: 12. r ,
/ / padding: EdgeInsets . symmetric ( horizontal: 10. w ) ,
/ / / / height: isTablet | | isFoldable ? 46. h : 40. h ,
/ / height: 40. h ,
/ / icon: AppAssets . ask_doctor_icon ,
/ / iconColor: AppColors . primaryRedColor ,
/ / iconSize: 16. h ,
/ / ) ;
/ / }
return CustomButton (
borderSide: BorderSide (