@ -262,7 +262,10 @@ class _AppointmentDetailsPageState extends State<AppointmentDetailsPage> {
Expanded (
child: CollapsingListView (
title: LocaleKeys . appointmentDetails . tr ( context: context ) ,
report: AppointmentType . isArrived ( widget . patientAppointmentHistoryResponseModel ) & & widget . patientAppointmentHistoryResponseModel . isLiveCareAppointment = = false & & widget . patientAppointmentHistoryResponseModel . isClinicReBookingAllowed ! = = true & & widget . patientAppointmentHistoryResponseModel . isActiveDoctor ! = = true
report: AppointmentType . isArrived ( widget . patientAppointmentHistoryResponseModel ) & &
widget . patientAppointmentHistoryResponseModel . isLiveCareAppointment = = false & &
widget . patientAppointmentHistoryResponseModel . isClinicReBookingAllowed ! = = true & &
widget . patientAppointmentHistoryResponseModel . isActiveDoctor ! = = true
? ( ) {
contactUsViewModel . setSelectedFeedbackType ( FeedbackType ( id: 1 , nameEN: " Complaint for appointment " , nameAR: ' شكوى على موعد ' ) ) ;
contactUsViewModel . setPatientFeedbackSelectedAppointment ( widget . patientAppointmentHistoryResponseModel ) ;
@ -280,8 +283,8 @@ class _AppointmentDetailsPageState extends State<AppointmentDetailsPage> {
children: [
AppointmentDoctorCard (
/ / renderWidgetForERDisplay: ( ( widget . patientAppointmentHistoryResponseModel . isLiveCareAppointment ? ? false ) | |
renderWidgetForERDisplay:
( ( widget . patientAppointmentHistoryResponseModel . isExecludeDoctor ? ? false ) | | ! Utils . isClinicAllowedForRebook ( widget . patientAppointmentHistoryResponseModel . clinicID ) ) ,
renderWidgetForERDisplay: ( ( widget . patientAppointmentHistoryResponseModel . isExecludeDoctor ? ? false ) | |
! Utils . isClinicAllowedForRebook ( widget . patientAppointmentHistoryResponseModel . clinicID ) ) ,
patientAppointmentHistoryResponseModel: widget . patientAppointmentHistoryResponseModel ,
onAskDoctorTap: ( ) async {
LoaderBottomSheet . showLoader ( loadingText: LocaleKeys . checkingDoctorAvailability . tr ( context: context ) ) ;
@ -361,10 +364,6 @@ class _AppointmentDetailsPageState extends State<AppointmentDetailsPage> {
isFullScreen: false ,
isCloseButtonVisible: true ,
) ;
/ / var isEventAddedOrRemoved = await CalenderUtilsNew . instance . checkAndRemove ( id: " ${ widget . patientAppointmentHistoryResponseModel . appointmentNo } " , ) ;
/ / setState ( ( ) {
/ / myAppointmentsViewModel . setAppointmentReminder ( isEventAddedOrRemoved , widget . patientAppointmentHistoryResponseModel ) ;
/ / } ) ;
} ,
onRescheduleTap: ( ) async {
openDoctorScheduleCalendar ( ) ;
@ -416,14 +415,17 @@ class _AppointmentDetailsPageState extends State<AppointmentDetailsPage> {
Row (
mainAxisSize: MainAxisSize . max ,
children: [
Utils . buildSvgWithAssets ( icon: AppAssets . prescription_reminder_icon , width: 40. w , height: 40. h , applyThemeColor: false ) ,
Utils . buildSvgWithAssets (
icon: AppAssets . prescription_reminder_icon , width: 40. w , height: 40. h , applyThemeColor: false ) ,
SizedBox ( width: 8. w ) ,
Column (
crossAxisAlignment: CrossAxisAlignment . start ,
spacing: 4. h ,
children: [
LocaleKeys . setReminder . tr ( context: context ) . toText13 ( isBold: true ) ,
LocaleKeys . notifyMeBeforeAppointment . tr ( context: context ) . toText11 ( color: AppColors . textColorLight , isBold: true ) ,
LocaleKeys . notifyMeBeforeAppointment
. tr ( context: context )
. toText11 ( color: AppColors . textColorLight , isBold: true ) ,
] ,
) ,
const Spacer ( ) ,
@ -438,14 +440,17 @@ class _AppointmentDetailsPageState extends State<AppointmentDetailsPage> {
inactiveCircleColor: AppColors . greyTextColor ,
activeIconColor: AppColors . bgGreenColor ,
inactiveIconColor: AppColors . greyTextColor ,
activeIcon: Utils . buildSvgWithAssets ( icon: AppAssets . bell , iconColor: AppColors . whiteColor , width: 12. w , height: 12. h ) ,
inactiveIcon: Utils . buildSvgWithAssets ( icon: AppAssets . bell , iconColor: AppColors . whiteColor , width: 12. w , height: 12. h ) ,
activeIcon:
Utils . buildSvgWithAssets ( icon: AppAssets . bell , iconColor: AppColors . whiteColor , width: 12. w , height: 12. h ) ,
inactiveIcon:
Utils . buildSvgWithAssets ( icon: AppAssets . bell , iconColor: AppColors . whiteColor , width: 12. w , height: 12. h ) ,
onChanged: ( newValue ) async {
CalenderUtilsNew calender = CalenderUtilsNew . instance ;
bool isEventAddedOrRemoved = false ;
if ( newValue = = true ) {
DateTime startDate = DateTime . now ( ) ;
DateTime endDate = DateUtil . convertStringToDate ( widget . patientAppointmentHistoryResponseModel . appointmentDate ) ;
DateTime endDate =
DateUtil . convertStringToDate ( widget . patientAppointmentHistoryResponseModel . appointmentDate ) ;
/ / Show reminder bottom sheet and check if permission was granted
bool permissionGranted = await BottomSheetUtils ( ) . showReminderBottomSheet (
@ -460,7 +465,8 @@ class _AppointmentDetailsPageState extends State<AppointmentDetailsPage> {
" ${ widget . patientAppointmentHistoryResponseModel . doctorNameObj } will be having an appointment on ${ widget . patientAppointmentHistoryResponseModel . appointmentDate } " ,
onSuccess: ( ) {
setState ( ( ) {
myAppointmentsViewModel . setAppointmentReminder ( newValue , widget . patientAppointmentHistoryResponseModel ) ;
myAppointmentsViewModel . setAppointmentReminder (
newValue , widget . patientAppointmentHistoryResponseModel ) ;
} ) ;
} ,
isMultiAllowed: true ,
@ -470,16 +476,17 @@ class _AppointmentDetailsPageState extends State<AppointmentDetailsPage> {
" Appointment Reminder with ${ widget . patientAppointmentHistoryResponseModel . doctorNameObj } on ${ DateUtil . convertStringToDate ( widget . patientAppointmentHistoryResponseModel . appointmentDate ) } , Appointment # ${ widget . patientAppointmentHistoryResponseModel . appointmentNo } " ,
description:
" Appointment Reminder with ${ widget . patientAppointmentHistoryResponseModel . doctorNameObj } in ${ widget . patientAppointmentHistoryResponseModel . projectName } " ,
scheduleDateTime: DateUtil . convertStringToDate ( widget . patientAppointmentHistoryResponseModel . appointmentDate ) ,
scheduleDateTime:
DateUtil . convertStringToDate ( widget . patientAppointmentHistoryResponseModel . appointmentDate ) ,
eventId: " ${ widget . patientAppointmentHistoryResponseModel . appointmentNo } " ,
location: ' ' ,
reminderMinutes: selectedIndex ) ;
setState ( ( ) {
myAppointmentsViewModel . setAppointmentReminder ( isEventAddedOrRemoved , widget . patientAppointmentHistoryResponseModel ) ;
myAppointmentsViewModel . setAppointmentReminder (
isEventAddedOrRemoved , widget . patientAppointmentHistoryResponseModel ) ;
} ) ;
} ,
isForAppointment: true
) ;
isForAppointment: true ) ;
/ / If permission was not granted , revert the switch back to OFF
if ( ! permissionGranted ) {
@ -490,72 +497,17 @@ class _AppointmentDetailsPageState extends State<AppointmentDetailsPage> {
id: " ${ widget . patientAppointmentHistoryResponseModel . appointmentNo } " ,
) ;
setState ( ( ) {
myAppointmentsViewModel . setAppointmentReminder ( ! isEventAddedOrRemoved , widget . patientAppointmentHistoryResponseModel ) ;
myAppointmentsViewModel . setAppointmentReminder (
! isEventAddedOrRemoved , widget . patientAppointmentHistoryResponseModel ) ;
} ) ;
}
} ,
)
/ / Switch (
/ / activeThumbColor: AppColors . successColor ,
/ / / / activeTrackColor: AppColors . successColor . withValues ( alpha: . 15 ) ,
/ / value: widget . patientAppointmentHistoryResponseModel . hasReminder ! ,
/ / onChanged: ( newValue ) async {
/ / CalenderUtilsNew calender = CalenderUtilsNew . instance ;
/ / bool isEventAddedOrRemoved = false ;
/ / if ( newValue = = true ) {
/ / DateTime startDate = DateTime . now ( ) ;
/ / DateTime endDate = DateUtil . convertStringToDate ( widget
/ / . patientAppointmentHistoryResponseModel . appointmentDate ) ;
/ / BottomSheetUtils ( ) . showReminderBottomSheet (
/ / context ,
/ / endDate ,
/ / widget . patientAppointmentHistoryResponseModel . doctorNameObj ? ? " " ,
/ / " ${ widget . patientAppointmentHistoryResponseModel . appointmentNo } " ? ? " " ,
/ / " " ,
/ / " " ,
/ / title: " Appointment with ${ widget . patientAppointmentHistoryResponseModel . doctorNameObj } " ,
/ / description:
/ / " ${ widget . patientAppointmentHistoryResponseModel . doctorNameObj } will be having an appointment on ${ widget . patientAppointmentHistoryResponseModel . appointmentDate } " ,
/ / onSuccess: ( ) {
/ / setState ( ( ) {
/ / myAppointmentsViewModel . setAppointmentReminder ( newValue , widget . patientAppointmentHistoryResponseModel ) ;
/ / } ) ;
/ / } ,
/ / isMultiAllowed: true ,
/ / onMultiDateSuccess: ( int selectedIndex ) async {
/ / isEventAddedOrRemoved = await calender . createOrUpdateEvent (
/ / title:
/ / " Appointment Reminder with ${ widget . patientAppointmentHistoryResponseModel . doctorNameObj } on ${ DateUtil . convertStringToDate ( widget . patientAppointmentHistoryResponseModel . appointmentDate ) } , Appointment # ${ widget . patientAppointmentHistoryResponseModel . appointmentNo } " ,
/ / description:
/ / " Appointment Reminder with ${ widget . patientAppointmentHistoryResponseModel . doctorNameObj } in ${ widget . patientAppointmentHistoryResponseModel . projectName } " ,
/ / scheduleDateTime: DateUtil . convertStringToDate ( widget
/ / . patientAppointmentHistoryResponseModel . appointmentDate ) ,
/ / eventId: " ${ widget . patientAppointmentHistoryResponseModel . appointmentNo } " ,
/ / location: ' ' ,
/ / reminderMinutes: selectedIndex
/ / ) ;
/ / setState ( ( ) {
/ / myAppointmentsViewModel . setAppointmentReminder ( isEventAddedOrRemoved , widget . patientAppointmentHistoryResponseModel ) ;
/ / } ) ;
/ / } ,
/ / ) ;
/ / } else {
/ / isEventAddedOrRemoved = await calender . checkAndRemove ( id: " ${ widget . patientAppointmentHistoryResponseModel . appointmentNo } " , ) ;
/ / setState ( ( ) {
/ / myAppointmentsViewModel . setAppointmentReminder ( ! isEventAddedOrRemoved , widget . patientAppointmentHistoryResponseModel ) ;
/ / } ) ;
/ / }
/ /
/ /
/ / } ,
/ / ) ,
] ,
) . paddingSymmetrical ( 16. w , 0 )
] ,
) ,
) ,
SizedBox ( height: 16. h ) ,
! AppointmentType . isArrived ( widget . patientAppointmentHistoryResponseModel )
? Column (
@ -581,53 +533,15 @@ class _AppointmentDetailsPageState extends State<AppointmentDetailsPage> {
LocaleKeys . appointmentStatus . tr ( context: context ) . toText16 ( isBold: true ) ,
SizedBox ( height: 4. h ) ,
( ! AppointmentType . isConfirmed ( widget . patientAppointmentHistoryResponseModel )
? LocaleKeys . notConfirmed . tr ( context: context ) . toText12 ( color: AppColors . primaryRedColor , isBold: true )
: LocaleKeys . confirmed . tr ( context: context ) . toText12 ( color: AppColors . successColor , isBold: true ) ) ,
? LocaleKeys . notConfirmed
. tr ( context: context )
. toText12 ( color: AppColors . primaryRedColor , isBold: true )
: LocaleKeys . confirmed
. tr ( context: context )
. toText12 ( color: AppColors . successColor , isBold: true ) ) ,
SizedBox ( height: 16. h ) ,
] ,
) ,
/ / ( ( ! AppointmentType . isConfirmed ( widget . patientAppointmentHistoryResponseModel ) & & widget . patientAppointmentHistoryResponseModel . nextAction ! = 10 )
/ / ? CustomButton (
/ / text: LocaleKeys . confirm . tr ( ) ,
/ / onPressed: ( ) async {
/ / LoaderBottomSheet . showLoader ( loadingText: LocaleKeys . confirmingAppointmentPleaseWait . tr ( context: context ) ) ;
/ / await myAppointmentsViewModel . confirmAppointment (
/ / patientAppointmentHistoryResponseModel: widget . patientAppointmentHistoryResponseModel ,
/ / onSuccess: ( apiResponse ) {
/ / LoaderBottomSheet . hideLoader ( ) ;
/ / myAppointmentsViewModel . setIsAppointmentDataToBeLoaded ( true ) ;
/ / myAppointmentsViewModel . initAppointmentsViewModel ( ) ;
/ / / / myAppointmentsViewModel . getPatientAppointments ( true , false ) ;
/ / showCommonBottomSheetWithoutHeight (
/ / title: " " ,
/ / context ,
/ / child: Utils . getSuccessWidget ( loadingText: LocaleKeys . appointmentConfirmedSuccessfully . tr ( context: context ) ) ,
/ / callBackFunc: ( ) {
/ / Navigator . pushAndRemoveUntil (
/ / context ,
/ / CustomPageRoute (
/ / page: LandingNavigation ( ) ,
/ / ) ,
/ / ( r ) = > false ) ;
/ / } ,
/ / isFullScreen: false ,
/ / isCloseButtonVisible: false ,
/ / isAutoDismiss: true
/ / ) ;
/ / } ) ;
/ / } ,
/ / backgroundColor: AppColors . successColor ,
/ / borderColor: AppColors . successColor ,
/ / textColor: Colors . white ,
/ / fontSize: 14. f ,
/ / isBold: true ,
/ / borderRadius: 12. r ,
/ / height: 40. h ,
/ / icon: AppAssets . confirm_appointment_icon ,
/ / iconColor: Colors . white ,
/ / iconSize: 16. h ,
/ / )
/ / : SizedBox . shrink ( ) )
] ,
) ,
/ / TODO Add countdown timer in case of LiveCare Appointment
@ -640,7 +554,9 @@ class _AppointmentDetailsPageState extends State<AppointmentDetailsPage> {
child: Column (
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
LocaleKeys . doctorWillCallYou . tr ( context: context ) . toText14 ( color: AppColors . greyTextColor , isBold: true ) ,
LocaleKeys . doctorWillCallYou
. tr ( context: context )
. toText14 ( color: AppColors . greyTextColor , isBold: true ) ,
] ,
) ,
) ,
@ -648,13 +564,17 @@ class _AppointmentDetailsPageState extends State<AppointmentDetailsPage> {
)
: Stack (
children: [
ClipRRect (
SizedBox (
width: double . infinity ,
child: ClipRRect (
clipBehavior: Clip . hardEdge ,
borderRadius: BorderRadius . circular ( 24. r ) ,
/ / Todo: what is this ? ? ? ? Api Key ? ? ? 😲
child: Image . network (
" https://maps.googleapis.com/maps/api/staticmap?center= ${ widget . patientAppointmentHistoryResponseModel . latitude } , ${ widget . patientAppointmentHistoryResponseModel . longitude } &zoom=14&size= ${ ( MediaQuery . of ( context ) . size . width * 1.5 ) . toInt ( ) } x ${ ( MediaQuery . of ( context ) . size . height * 0.35 ) . toInt ( ) } &maptype=roadmap&markers=color:red%7C ${ widget . patientAppointmentHistoryResponseModel . latitude } , ${ widget . patientAppointmentHistoryResponseModel . longitude } &key= ${ ApiKeyConstants . googleMapsApiKey } " ,
fit: BoxFit . contain ,
fit: BoxFit . cover ,
width: double . infinity ,
) ,
) ,
) ,
Positioned (
@ -663,7 +583,8 @@ class _AppointmentDetailsPageState extends State<AppointmentDetailsPage> {
width: MediaQuery . of ( context ) . size . width - 85. w ,
child: CustomButton (
onPressed: ( ) async {
if ( widget . patientAppointmentHistoryResponseModel . projectID = = 130 | | widget . patientAppointmentHistoryResponseModel . projectID = = 120 ) {
if ( widget . patientAppointmentHistoryResponseModel . projectID = = 130 | |
widget . patientAppointmentHistoryResponseModel . projectID = = 120 ) {
showDirectionsBottomSheet ( ) ;
} else {
await MapLauncher . showMarker (
@ -683,7 +604,9 @@ class _AppointmentDetailsPageState extends State<AppointmentDetailsPage> {
} ,
text: LocaleKeys . getDirections . tr ( context: context ) ,
backgroundColor: AppColors . bookAppointment . withValues ( alpha: 0.8 ) ,
borderColor: AppointmentType . getNextActionButtonColor ( widget . patientAppointmentHistoryResponseModel . nextAction ) . withValues ( alpha: 0.01 ) ,
borderColor: AppointmentType . getNextActionButtonColor (
widget . patientAppointmentHistoryResponseModel . nextAction )
. withValues ( alpha: 0.01 ) ,
textColor: Colors . white ,
fontSize: 14. f ,
fontWeight: FontWeight . w600 ,
@ -723,148 +646,6 @@ class _AppointmentDetailsPageState extends State<AppointmentDetailsPage> {
) ;
} ) ,
SizedBox ( height: 16. h ) ,
/ / Container (
/ / decoration: RoundedRectangleBorder ( ) . toSmoothCornerDecoration (
/ / color: AppColors . whiteColor ,
/ / borderRadius: 20. r ,
/ / hasShadow: false ,
/ / ) ,
/ / child: Row (
/ / mainAxisSize: MainAxisSize . max ,
/ / children: [
/ / Utils . buildSvgWithAssets ( icon: AppAssets . prescription_reminder_icon , width: 35. h , height: 35. h , applyThemeColor: false ) ,
/ / SizedBox ( width: 8. h ) ,
/ / Column (
/ / crossAxisAlignment: CrossAxisAlignment . start ,
/ / children: [
/ / LocaleKeys . setReminder . tr ( context: context ) . toText13 ( isBold: true ) ,
/ / LocaleKeys . notifyMeBeforeAppointment . tr ( context: context ) . toText11 ( color: AppColors . textColorLight , isBold: true ) ,
/ / ] ,
/ / ) ,
/ / const Spacer ( ) ,
/ / BellAnimatedSwitch (
/ / key: _bellSwitchKey ,
/ / initialValue: widget . patientAppointmentHistoryResponseModel . hasReminder ? ? false ,
/ / activeColor: AppColors . successColor . withOpacity ( 0.2 ) ,
/ / inactiveColor: AppColors . lightGrayBGColor ,
/ / activeCircleColor: AppColors . successColor ,
/ / inactiveCircleColor: AppColors . greyTextColor ,
/ / activeIconColor: AppColors . bgGreenColor ,
/ / inactiveIconColor: AppColors . greyTextColor ,
/ / activeIcon: Utils . buildSvgWithAssets ( icon: AppAssets . bell , iconColor: AppColors . whiteColor , width: 15. w , height: 15. h ) ,
/ / inactiveIcon: Utils . buildSvgWithAssets ( icon: AppAssets . bell , iconColor: AppColors . whiteColor , width: 15. w , height: 15. h ) ,
/ / onChanged: ( newValue ) async {
/ / CalenderUtilsNew calender = CalenderUtilsNew . instance ;
/ / bool isEventAddedOrRemoved = false ;
/ / if ( newValue = = true ) {
/ / DateTime startDate = DateTime . now ( ) ;
/ / DateTime endDate = DateUtil . convertStringToDate ( widget . patientAppointmentHistoryResponseModel . appointmentDate ) ;
/ /
/ / / / Show reminder bottom sheet and check if permission was granted
/ / bool permissionGranted = await BottomSheetUtils ( ) . showReminderBottomSheet (
/ / context ,
/ / endDate ,
/ / widget . patientAppointmentHistoryResponseModel . doctorNameObj ? ? " " ,
/ / " ${ widget . patientAppointmentHistoryResponseModel . appointmentNo } " ? ? " " ,
/ / " " ,
/ / " " ,
/ / title: " Appointment with ${ widget . patientAppointmentHistoryResponseModel . doctorNameObj } " ,
/ / description:
/ / " ${ widget . patientAppointmentHistoryResponseModel . doctorNameObj } will be having an appointment on ${ widget . patientAppointmentHistoryResponseModel . appointmentDate } " ,
/ / onSuccess: ( ) {
/ / setState ( ( ) {
/ / myAppointmentsViewModel . setAppointmentReminder ( newValue , widget . patientAppointmentHistoryResponseModel ) ;
/ / } ) ;
/ / } ,
/ / isMultiAllowed: true ,
/ / onMultiDateSuccess: ( int selectedIndex ) async {
/ / isEventAddedOrRemoved = await calender . createOrUpdateEvent (
/ / title:
/ / " Appointment Reminder with ${ widget . patientAppointmentHistoryResponseModel . doctorNameObj } on ${ DateUtil . convertStringToDate ( widget . patientAppointmentHistoryResponseModel . appointmentDate ) } , Appointment # ${ widget . patientAppointmentHistoryResponseModel . appointmentNo } " ,
/ / description:
/ / " Appointment Reminder with ${ widget . patientAppointmentHistoryResponseModel . doctorNameObj } in ${ widget . patientAppointmentHistoryResponseModel . projectName } " ,
/ / scheduleDateTime: DateUtil . convertStringToDate ( widget . patientAppointmentHistoryResponseModel . appointmentDate ) ,
/ / eventId: " ${ widget . patientAppointmentHistoryResponseModel . appointmentNo } " ,
/ / location: ' ' ,
/ / reminderMinutes: selectedIndex ) ;
/ / setState ( ( ) {
/ / myAppointmentsViewModel . setAppointmentReminder ( isEventAddedOrRemoved , widget . patientAppointmentHistoryResponseModel ) ;
/ / } ) ;
/ / } ,
/ / ) ;
/ /
/ / / / If permission was not granted , revert the switch back to OFF
/ / if ( ! permissionGranted ) {
/ / _bellSwitchKey . currentState ? . setSwitchValue ( false ) ;
/ / }
/ / } else {
/ / isEventAddedOrRemoved = await calender . checkAndRemove (
/ / id: " ${ widget . patientAppointmentHistoryResponseModel . appointmentNo } " ,
/ / ) ;
/ / setState ( ( ) {
/ / myAppointmentsViewModel . setAppointmentReminder ( ! isEventAddedOrRemoved , widget . patientAppointmentHistoryResponseModel ) ;
/ / } ) ;
/ / }
/ / } ,
/ / )
/ /
/ / / / Switch (
/ / / / activeThumbColor: AppColors . successColor ,
/ / / / / / activeTrackColor: AppColors . successColor . withValues ( alpha: . 15 ) ,
/ / / / value: widget . patientAppointmentHistoryResponseModel . hasReminder ! ,
/ / / / onChanged: ( newValue ) async {
/ / / / CalenderUtilsNew calender = CalenderUtilsNew . instance ;
/ / / / bool isEventAddedOrRemoved = false ;
/ / / / if ( newValue = = true ) {
/ / / / DateTime startDate = DateTime . now ( ) ;
/ / / / DateTime endDate = DateUtil . convertStringToDate ( widget
/ / / / . patientAppointmentHistoryResponseModel . appointmentDate ) ;
/ / / / BottomSheetUtils ( ) . showReminderBottomSheet (
/ / / / context ,
/ / / / endDate ,
/ / / / widget . patientAppointmentHistoryResponseModel . doctorNameObj ? ? " " ,
/ / / / " ${ widget . patientAppointmentHistoryResponseModel . appointmentNo } " ? ? " " ,
/ / / / " " ,
/ / / / " " ,
/ / / / title: " Appointment with ${ widget . patientAppointmentHistoryResponseModel . doctorNameObj } " ,
/ / / / description:
/ / / / " ${ widget . patientAppointmentHistoryResponseModel . doctorNameObj } will be having an appointment on ${ widget . patientAppointmentHistoryResponseModel . appointmentDate } " ,
/ / / / onSuccess: ( ) {
/ / / / setState ( ( ) {
/ / / / myAppointmentsViewModel . setAppointmentReminder ( newValue , widget . patientAppointmentHistoryResponseModel ) ;
/ / / / } ) ;
/ / / / } ,
/ / / / isMultiAllowed: true ,
/ / / / onMultiDateSuccess: ( int selectedIndex ) async {
/ / / / isEventAddedOrRemoved = await calender . createOrUpdateEvent (
/ / / / title:
/ / / / " Appointment Reminder with ${ widget . patientAppointmentHistoryResponseModel . doctorNameObj } on ${ DateUtil . convertStringToDate ( widget . patientAppointmentHistoryResponseModel . appointmentDate ) } , Appointment # ${ widget . patientAppointmentHistoryResponseModel . appointmentNo } " ,
/ / / / description:
/ / / / " Appointment Reminder with ${ widget . patientAppointmentHistoryResponseModel . doctorNameObj } in ${ widget . patientAppointmentHistoryResponseModel . projectName } " ,
/ / / / scheduleDateTime: DateUtil . convertStringToDate ( widget
/ / / / . patientAppointmentHistoryResponseModel . appointmentDate ) ,
/ / / / eventId: " ${ widget . patientAppointmentHistoryResponseModel . appointmentNo } " ,
/ / / / location: ' ' ,
/ / / / reminderMinutes: selectedIndex
/ / / / ) ;
/ / / / setState ( ( ) {
/ / / / myAppointmentsViewModel . setAppointmentReminder ( isEventAddedOrRemoved , widget . patientAppointmentHistoryResponseModel ) ;
/ / / / } ) ;
/ / / / } ,
/ / / / ) ;
/ / / / } else {
/ / / / isEventAddedOrRemoved = await calender . checkAndRemove ( id: " ${ widget . patientAppointmentHistoryResponseModel . appointmentNo } " , ) ;
/ / / / setState ( ( ) {
/ / / / myAppointmentsViewModel . setAppointmentReminder ( ! isEventAddedOrRemoved , widget . patientAppointmentHistoryResponseModel ) ;
/ / / / } ) ;
/ / / / }
/ / / /
/ / / /
/ / / / } ,
/ / / / ) ,
/ / ] ,
/ / ) . paddingSymmetrical ( 16. h , 16. h ) ,
/ / ) ,
SizedBox ( height: 16. h ) ,
] ,
)
@ -875,7 +656,7 @@ class _AppointmentDetailsPageState extends State<AppointmentDetailsPage> {
crossAxisCount: 3 ,
crossAxisSpacing: 16. h ,
mainAxisSpacing: 16. w ,
mainAxisExtent: 115. h ,
childAspectRatio: isFoldable ? 1.2 : ( isTablet ? 1.1 : 0.78 ) ,
) ,
physics: NeverScrollableScrollPhysics ( ) ,
padding: EdgeInsets . zero ,
@ -974,7 +755,8 @@ class _AppointmentDetailsPageState extends State<AppointmentDetailsPage> {
) ;
Navigator . of ( context ) . push (
CustomPageRoute (
page: PrescriptionDetailPage ( isFromAppointments: true , prescriptionsResponseModel: patientPrescriptionsResponseModel ) ,
page: PrescriptionDetailPage (
isFromAppointments: true , prescriptionsResponseModel: patientPrescriptionsResponseModel ) ,
) ,
) ;
} else {
@ -1093,213 +875,6 @@ class _AppointmentDetailsPageState extends State<AppointmentDetailsPage> {
] ,
) ;
} ) ,
/ / Column (
/ / crossAxisAlignment: CrossAxisAlignment . start ,
/ / children: [
/ / " Lab & Radiology " . needTranslation . toText18 ( isBold: true ) ,
/ / SizedBox ( height: 16. h ) ,
/ / Row (
/ / children: [
/ / Expanded (
/ / child: LabRadCard (
/ / icon: AppAssets . lab_result_icon ,
/ / labelText: LocaleKeys . labResults . tr ( context: context ) ,
/ / / / labOrderTests: [ " Complete blood count " , " Creatinine " , " Blood Sugar " ] ,
/ / / / labOrderTests: labViewModel . isLabOrdersLoading ? [ ] : labViewModel . labOrderTests ,
/ / labOrderTests: [ ] ,
/ / / / isLoading: labViewModel . isLabOrdersLoading ,
/ / isLoading: false ,
/ / ) . onPress ( ( ) {
/ / Navigator . of ( context ) . push (
/ / CustomPageRoute (
/ / page: LabOrdersPage ( ) ,
/ / ) ,
/ / ) ;
/ / } ) ,
/ / ) ,
/ / SizedBox ( width: 16. h ) ,
/ / Expanded (
/ / child: LabRadCard (
/ / icon: AppAssets . radiology_icon ,
/ / labelText: LocaleKeys . radiology . tr ( context: context ) ,
/ / / / labOrderTests: [ " Chest X-ray " , " Abdominal Ultrasound " , " Dental X-ray " ] ,
/ / labOrderTests: [ ] ,
/ / isLoading: false ,
/ / ) . onPress ( ( ) {
/ / Navigator . of ( context ) . push (
/ / CustomPageRoute (
/ / page: RadiologyOrdersPage ( ) ,
/ / ) ,
/ / ) ;
/ / } ) ,
/ / ) ,
/ / ] ,
/ / ) ,
/ / SizedBox ( height: 16. h ) ,
/ / LocaleKeys . prescriptions . tr ( context: context ) . toText18 ( isBold: true ) ,
/ / SizedBox ( height: 16. h ) ,
/ / Consumer < PrescriptionsViewModel > ( builder: ( context , prescriptionVM , child ) {
/ / return prescriptionVM . isPrescriptionsDetailsLoading
/ / ? const MoviesShimmerWidget ( )
/ / : Container (
/ / decoration: RoundedRectangleBorder ( ) . toSmoothCornerDecoration (
/ / color: Colors . white ,
/ / borderRadius: 20. r ,
/ / ) ,
/ / padding: EdgeInsets . all ( 16. w ) ,
/ / child: Column (
/ / children: [
/ / / / ListView . separated (
/ / / / itemCount: prescriptionVM . prescriptionDetailsList . length ,
/ / / / shrinkWrap: true ,
/ / / / padding: EdgeInsets . only ( right: 8. w ) ,
/ / / / physics: NeverScrollableScrollPhysics ( ) ,
/ / / / itemBuilder: ( context , index ) {
/ / / / return AnimationConfiguration . staggeredList (
/ / / / position: index ,
/ / / / duration: const Duration ( milliseconds: 500 ) ,
/ / / / child: SlideAnimation (
/ / / / verticalOffset: 100.0 ,
/ / / / child: FadeInAnimation (
/ / / / child: Row (
/ / / / children: [
/ / / / Utils . buildSvgWithAssets (
/ / / / icon: AppAssets . prescription_item_icon ,
/ / / / width: 40. h ,
/ / / / height: 40. h ,
/ / / / ) ,
/ / / / SizedBox ( width: 8. h ) ,
/ / / / Row (
/ / / / mainAxisSize: MainAxisSize . max ,
/ / / / children: [
/ / / / Column (
/ / / / children: [
/ / / / prescriptionVM . prescriptionDetailsList [ index ] . itemDescription !
/ / / / . toText12 ( isBold: true , maxLine: 1 ) ,
/ / / / " Prescribed By: ${ widget . patientAppointmentHistoryResponseModel . doctorTitle } ${ widget . patientAppointmentHistoryResponseModel . doctorNameObj } "
/ / / / . needTranslation
/ / / / . toText10 (
/ / / / weight: FontWeight . w600 ,
/ / / / color: AppColors . greyTextColor ,
/ / / / letterSpacing: - 0.4 ) ,
/ / / / ] ,
/ / / / ) ,
/ / / / SizedBox ( width: 68. w ) ,
/ / / / Transform . flip (
/ / / / flipX: appState . isArabic ( ) ,
/ / / / child: Utils . buildSvgWithAssets (
/ / / / icon: AppAssets . forward_arrow_icon ,
/ / / / iconColor: AppColors . blackColor ,
/ / / / width: 18. w ,
/ / / / height: 13. h ,
/ / / / fit: BoxFit . contain ,
/ / / / ) ,
/ / / / ) ,
/ / / / ] ,
/ / / / ) ,
/ / / / ] ,
/ / / / ) ,
/ / / / ) ,
/ / / / ) ,
/ / / / ) ;
/ / / / } ,
/ / / / separatorBuilder: ( BuildContext cxt , int index ) = > SizedBox ( height: 16. h ) ,
/ / / / ) . onPress ( ( ) {
/ / / / prescriptionVM . setPrescriptionsDetailsLoading ( ) ;
/ / / / Navigator . of ( context ) . push (
/ / / / CustomPageRoute (
/ / / / page: PrescriptionDetailPage ( prescriptionsResponseModel: getPrescriptionRequestModel ( ) ) ,
/ / / / ) ,
/ / / / ) ;
/ / / / } ) ,
/ / SizedBox ( height: 16. h ) ,
/ / const Divider ( color: AppColors . dividerColor ) ,
/ / SizedBox ( height: 16. h ) ,
/ / / / Wrap (
/ / / / runSpacing: 6. w ,
/ / / / children: [
/ / / / / / Expanded (
/ / / / / / child: CustomButton (
/ / / / / / text: widget . prescriptionsResponseModel . isHomeMedicineDeliverySupported ! ? LocaleKeys . resendOrder . tr ( context: context ) : LocaleKeys . prescriptionDeliveryError . tr ( context: context ) ,
/ / / / / / onPressed: ( ) { } ,
/ / / / / / backgroundColor: AppColors . secondaryLightRedColor ,
/ / / / / / borderColor: AppColors . secondaryLightRedColor ,
/ / / / / / textColor: AppColors . primaryRedColor ,
/ / / / / / fontSize: 14 ,
/ / / / / / isBold: true ,
/ / / / / / borderRadius: 12. h ,
/ / / / / / height: 40. h ,
/ / / / / / icon: AppAssets . appointment_calendar_icon ,
/ / / / / / iconColor: AppColors . primaryRedColor ,
/ / / / / / iconSize: 16. h ,
/ / / / / / ) ,
/ / / / / / ) ,
/ / / / / / SizedBox ( width: 16. h ) ,
/ / / / Expanded (
/ / / / child: CustomButton (
/ / / / text: " Refill & Delivery " . needTranslation ,
/ / / / onPressed: ( ) {
/ / / / Navigator . of ( context )
/ / / / . push (
/ / / / CustomPageRoute (
/ / / / page: PrescriptionsListPage ( ) ,
/ / / / ) ,
/ / / / )
/ / / / . then ( ( val ) {
/ / / / prescriptionsViewModel . setPrescriptionsDetailsLoading ( ) ;
/ / / / prescriptionsViewModel . getPrescriptionDetails ( getPrescriptionRequestModel ( ) ) ;
/ / / / } ) ;
/ / / / } ,
/ / / / backgroundColor: AppColors . secondaryLightRedColor ,
/ / / / borderColor: AppColors . secondaryLightRedColor ,
/ / / / textColor: AppColors . primaryRedColor ,
/ / / / fontSize: 14. f ,
/ / / / isBold: true ,
/ / / / borderRadius: 12. r ,
/ / / / height: 40. h ,
/ / / / icon: AppAssets . requests ,
/ / / / iconColor: AppColors . primaryRedColor ,
/ / / / iconSize: 16. h ,
/ / / / ) ,
/ / / / ) ,
/ / / /
/ / / / SizedBox ( width: 16. w ) ,
/ / / / Expanded (
/ / / / child: CustomButton (
/ / / / text: " All Prescriptions " . needTranslation ,
/ / / / onPressed: ( ) {
/ / / / Navigator . of ( context )
/ / / / . push (
/ / / / CustomPageRoute (
/ / / / page: PrescriptionsListPage ( ) ,
/ / / / ) ,
/ / / / )
/ / / / . then ( ( val ) {
/ / / / prescriptionsViewModel . setPrescriptionsDetailsLoading ( ) ;
/ / / / prescriptionsViewModel . getPrescriptionDetails ( getPrescriptionRequestModel ( ) ) ;
/ / / / } ) ;
/ / / / } ,
/ / / / backgroundColor: AppColors . secondaryLightRedColor ,
/ / / / borderColor: AppColors . secondaryLightRedColor ,
/ / / / textColor: AppColors . primaryRedColor ,
/ / / / fontSize: 14. f ,
/ / / / isBold: true ,
/ / / / borderRadius: 12. r ,
/ / / / height: 40. h ,
/ / / / icon: AppAssets . requests ,
/ / / / iconColor: AppColors . primaryRedColor ,
/ / / / iconSize: 16. h ,
/ / / / ) ,
/ / / / ) ,
/ / / / ] ,
/ / / / ) ,
/ / ] ,
/ / ) ,
/ / ) ;
/ / } ) ,
/ / ] ,
/ / ) ,
] ,
) . paddingAll ( 24. w ) ,
) ,
@ -1315,7 +890,8 @@ class _AppointmentDetailsPageState extends State<AppointmentDetailsPage> {
child: Column (
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
if ( widget . patientAppointmentHistoryResponseModel . nextAction = = 15 | | widget . patientAppointmentHistoryResponseModel . nextAction = = 20 )
if ( widget . patientAppointmentHistoryResponseModel . nextAction = = 15 | |
widget . patientAppointmentHistoryResponseModel . nextAction = = 20 )
Column (
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
@ -1323,7 +899,10 @@ class _AppointmentDetailsPageState extends State<AppointmentDetailsPage> {
mainAxisAlignment: MainAxisAlignment . spaceBetween ,
children: [
LocaleKeys . amountBeforeTax . tr ( context: context ) . toText18 ( isBold: true ) ,
Utils . getPaymentAmountWithSymbol ( widget . patientAppointmentHistoryResponseModel . patientShare ! . toString ( ) . toText16 ( isBold: true ) , AppColors . blackColor , 13 ,
Utils . getPaymentAmountWithSymbol (
widget . patientAppointmentHistoryResponseModel . patientShare ! . toString ( ) . toText16 ( isBold: true ) ,
AppColors . blackColor ,
13 ,
isSaudiCurrency: true ) ,
] ,
) ,
@ -1331,22 +910,24 @@ class _AppointmentDetailsPageState extends State<AppointmentDetailsPage> {
Row (
mainAxisAlignment: MainAxisAlignment . spaceBetween ,
children: [
Expanded ( child: LocaleKeys . upcomingPaymentNow . tr ( context: context ) . toText12 ( isBold: true , color: AppColors . greyTextColor ) ) ,
" VAT 15%( ${ widget . patientAppointmentHistoryResponseModel . patientTaxAmount } ) " . toText14 ( isBold: true , color: AppColors . greyTextColor , letterSpacing: - 0.64 ) ,
Expanded (
child: LocaleKeys . upcomingPaymentNow . tr ( context: context ) . toText12 ( isBold: true , color: AppColors . greyTextColor ) ) ,
" VAT 15%( ${ widget . patientAppointmentHistoryResponseModel . patientTaxAmount } ) "
. toText14 ( isBold: true , color: AppColors . greyTextColor , letterSpacing: - 0.64 ) ,
] ,
) ,
SizedBox ( height: 18. h ) ,
Row (
mainAxisAlignment: MainAxisAlignment . spaceBetween ,
children: [
SizedBox (
width: 200. h ,
child: Utils . getPaymentMethods ( ) ,
) ,
Utils . getPaymentMethods ( ) ,
Row (
mainAxisAlignment: MainAxisAlignment . spaceBetween ,
children: [
Utils . getPaymentAmountWithSymbol ( widget . patientAppointmentHistoryResponseModel . patientShareWithTax ! . toString ( ) . toText24 ( isBold: true ) , AppColors . blackColor , 17 ,
Utils . getPaymentAmountWithSymbol (
widget . patientAppointmentHistoryResponseModel . patientShareWithTax ! . toString ( ) . toText24 ( isBold: true ) ,
AppColors . blackColor ,
17 ,
isSaudiCurrency: true ) ,
] ,
) ,
@ -1384,7 +965,8 @@ class _AppointmentDetailsPageState extends State<AppointmentDetailsPage> {
handleAppointmentNextAction ( widget . patientAppointmentHistoryResponseModel . nextAction ) ;
} ,
backgroundColor: AppointmentType . getNextActionButtonColor ( widget . patientAppointmentHistoryResponseModel . nextAction ) ,
borderColor: AppointmentType . getNextActionButtonColor ( widget . patientAppointmentHistoryResponseModel . nextAction ) . withValues ( alpha: 0.01 ) ,
borderColor: AppointmentType . getNextActionButtonColor ( widget . patientAppointmentHistoryResponseModel . nextAction )
. withValues ( alpha: 0.01 ) ,
textColor: widget . patientAppointmentHistoryResponseModel . nextAction = = 15 ? AppColors . textColor : Colors . white ,
fontSize: 16. f ,
fontWeight: FontWeight . w600 ,
@ -1424,7 +1006,10 @@ class _AppointmentDetailsPageState extends State<AppointmentDetailsPage> {
text: LocaleKeys . insideHospital . tr ( context: context ) ,
onPressed: ( ) {
Navigator . pop ( context ) ;
initPenguinSDK ( widget . patientAppointmentHistoryResponseModel . projectID = = 130 ? 1 : ( widget . patientAppointmentHistoryResponseModel . projectID = = 120 ? 3 : - 1 ) ,
initPenguinSDK (
widget . patientAppointmentHistoryResponseModel . projectID = = 130
? 1
: ( widget . patientAppointmentHistoryResponseModel . projectID = = 120 ? 3 : - 1 ) ,
clinicID: widget . patientAppointmentHistoryResponseModel . clinicID . toString ( ) ) ;
} ,
backgroundColor: AppColors . primaryRedColor ,
@ -1443,12 +1028,14 @@ class _AppointmentDetailsPageState extends State<AppointmentDetailsPage> {
Navigator . pop ( context ) ;
await MapLauncher . showMarker (
mapType: MapType . google ,
coords: Coords ( double . parse ( widget . patientAppointmentHistoryResponseModel . latitude ! ) , double . parse ( widget . patientAppointmentHistoryResponseModel . longitude ! ) ) ,
coords: Coords ( double . parse ( widget . patientAppointmentHistoryResponseModel . latitude ! ) ,
double . parse ( widget . patientAppointmentHistoryResponseModel . longitude ! ) ) ,
title: widget . patientAppointmentHistoryResponseModel . projectName ? ? " Habib Hospital " ,
) . catchError ( ( err ) {
MapLauncher . showMarker (
mapType: Platform . isIOS ? MapType . apple : MapType . google ,
coords: Coords ( double . parse ( widget . patientAppointmentHistoryResponseModel . latitude ! ) , double . parse ( widget . patientAppointmentHistoryResponseModel . longitude ! ) ) ,
coords: Coords ( double . parse ( widget . patientAppointmentHistoryResponseModel . latitude ! ) ,
double . parse ( widget . patientAppointmentHistoryResponseModel . longitude ! ) ) ,
title: widget . patientAppointmentHistoryResponseModel . projectName ? ? " Habib Hospital " ,
) ;
} ) ;
@ -1482,7 +1069,9 @@ class _AppointmentDetailsPageState extends State<AppointmentDetailsPage> {
Permission . bluetoothScan ,
Permission . activityRecognition ,
] . request ( ) . whenComplete ( ( ) {
PenguinMethodChannel ( ) . launch ( " penguin " , getIt . get < AppState > ( ) . isArabic ( ) ? " ar " : " en " , getIt . get < AppState > ( ) . getAuthenticatedUser ( ) ? . patientId ? . toString ( ) ? ? " " , true , details: data ) ;
PenguinMethodChannel ( ) . launch ( " penguin " , getIt . get < AppState > ( ) . isArabic ( ) ? " ar " : " en " ,
getIt . get < AppState > ( ) . getAuthenticatedUser ( ) ? . patientId ? . toString ( ) ? ? " " , true ,
details: data ) ;
} ) ;
}
}
@ -1540,12 +1129,20 @@ class _AppointmentDetailsPageState extends State<AppointmentDetailsPage> {
LoaderBottomSheet . hideLoader ( ) ;
myAppointmentsViewModel . setIsAppointmentDataToBeLoaded ( true ) ;
myAppointmentsViewModel . getPatientAppointments ( true , false ) ;
showCommonBottomSheet ( context , child: Utils . getSuccessWidget ( loadingText: LocaleKeys . appointmentConfirmedSuccessfully . tr ( context: context ) ) , callBackFunc: ( str ) {
showCommonBottomSheet ( context ,
child: Utils . getSuccessWidget ( loadingText: LocaleKeys . appointmentConfirmedSuccessfully . tr ( context: context ) ) , callBackFunc: ( str ) {
myAppointmentsViewModel . setIsAppointmentDataToBeLoaded ( true ) ;
myAppointmentsViewModel . initAppointmentsViewModel ( ) ;
myAppointmentsViewModel . getPatientAppointments ( true , false ) ;
Navigator . of ( context ) . pop ( ) ;
} , title: " " , height: ResponsiveExtension . screenHeight * 0.3 , isAutoDismiss: true , isCloseButtonVisible: true , isDismissible: false , isFullScreen: false , isSuccessDialog: true ) ;
} ,
title: " " ,
height: ResponsiveExtension . screenHeight * 0.3 ,
isAutoDismiss: true ,
isCloseButtonVisible: true ,
isDismissible: false ,
isFullScreen: false ,
isSuccessDialog: true ) ;
} ) ;
/ / LoaderBottomSheet . hideLoader ( ) ;
case 15 :
@ -1565,7 +1162,8 @@ class _AppointmentDetailsPageState extends State<AppointmentDetailsPage> {
return Column (
crossAxisAlignment: CrossAxisAlignment . center ,
children: [
Lottie . asset ( AppAnimations . warningAnimation , repeat: false , reverse: false , frameRate: FrameRate ( 60 ) , width: 100. h , height: 100. h , fit: BoxFit . fill ) ,
Lottie . asset ( AppAnimations . warningAnimation ,
repeat: false , reverse: false , frameRate: FrameRate ( 60 ) , width: 100. h , height: 100. h , fit: BoxFit . fill ) ,
SizedBox (
height: 12 ,
) ,