Merge branch 'haroon_dev' of http://34.17.182.140/Haroon6138/HMG_Patient_App_New into haroon_dev

haroon_dev
haroon amjad 1 day ago
commit 355a553fc6

@ -404,6 +404,7 @@ class BookAppointmentsViewModel extends ChangeNotifier {
isWaitingAppointmentSelected = false; isWaitingAppointmentSelected = false;
isPatientRescheduleAppointment = false; isPatientRescheduleAppointment = false;
bodyTypes = [maleLaserCategory, femaleLaserCategory]; bodyTypes = [maleLaserCategory, femaleLaserCategory];
selectedChiefComplaintID = 0;
// getLocation(); // getLocation();
notifyListeners(); notifyListeners();
} }

@ -424,6 +424,7 @@ class _ReviewAppointmentPageState extends State<ReviewAppointmentPage> {
void initiateBookAppointment() async { void initiateBookAppointment() async {
// LoadingUtils.showFullScreenLoader(barrierDismissible: true, isSuccessDialog: false, loadingText: bookAppointmentsViewModel.isPatientRescheduleAppointment ? LocaleKeys.reschedulingAppo.tr(context: context) : LocaleKeys.bookingYourAppointment.tr(context: context)); // LoadingUtils.showFullScreenLoader(barrierDismissible: true, isSuccessDialog: false, loadingText: bookAppointmentsViewModel.isPatientRescheduleAppointment ? LocaleKeys.reschedulingAppo.tr(context: context) : LocaleKeys.bookingYourAppointment.tr(context: context));
Clarity.sendCustomEvent('Appointment_book_success');
LoaderBottomSheet.showLoader( LoaderBottomSheet.showLoader(
loadingText: bookAppointmentsViewModel.isPatientRescheduleAppointment loadingText: bookAppointmentsViewModel.isPatientRescheduleAppointment
? LocaleKeys.reschedulingAppo.tr(context: context) ? LocaleKeys.reschedulingAppo.tr(context: context)
@ -449,6 +450,7 @@ class _ReviewAppointmentPageState extends State<ReviewAppointmentPage> {
callBackFunc: () { callBackFunc: () {
bookAppointmentsViewModel.setIsPatientRescheduleAppointment(false); bookAppointmentsViewModel.setIsPatientRescheduleAppointment(false);
bookAppointmentsViewModel.setIsLiveCareSchedule(false); bookAppointmentsViewModel.setIsLiveCareSchedule(false);
bookAppointmentsViewModel.setSelectedChiefComplaintID(0);
Navigator.pushAndRemoveUntil( Navigator.pushAndRemoveUntil(
context, context,
CustomPageRoute( CustomPageRoute(
@ -524,6 +526,7 @@ class _ReviewAppointmentPageState extends State<ReviewAppointmentPage> {
child: Utils.getSuccessWidget(loadingText: LocaleKeys.appointmentSuccess.tr()).paddingSymmetrical(0.h, 24.h), callBackFunc: () { child: Utils.getSuccessWidget(loadingText: LocaleKeys.appointmentSuccess.tr()).paddingSymmetrical(0.h, 24.h), callBackFunc: () {
bookAppointmentsViewModel.setIsLiveCareSchedule(false); bookAppointmentsViewModel.setIsLiveCareSchedule(false);
bookAppointmentsViewModel.setIsPatientRescheduleAppointment(false); bookAppointmentsViewModel.setIsPatientRescheduleAppointment(false);
bookAppointmentsViewModel.setSelectedChiefComplaintID(0);
Navigator.pushAndRemoveUntil(context, CustomPageRoute(page: LandingNavigation()), (r) => false); Navigator.pushAndRemoveUntil(context, CustomPageRoute(page: LandingNavigation()), (r) => false);
}, isFullScreen: false, isCloseButtonVisible: false, isAutoDismiss: true); }, isFullScreen: false, isCloseButtonVisible: false, isAutoDismiss: true);
}); });

@ -14,8 +14,10 @@ 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/extensions/widget_extensions.dart';
import 'package:hmg_patient_app_new/features/authentication/authentication_view_model.dart'; import 'package:hmg_patient_app_new/features/authentication/authentication_view_model.dart';
import 'package:hmg_patient_app_new/features/book_appointments/book_appointments_view_model.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/get_clinic_list_response_model.dart';
import 'package:hmg_patient_app_new/features/book_appointments/models/timeslots.dart'; import 'package:hmg_patient_app_new/features/book_appointments/models/timeslots.dart';
import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; import 'package:hmg_patient_app_new/generated/locale_keys.g.dart';
import 'package:hmg_patient_app_new/presentation/book_appointment/dental_chief_complaints_page.dart';
import 'package:hmg_patient_app_new/presentation/book_appointment/review_appointment_page.dart'; import 'package:hmg_patient_app_new/presentation/book_appointment/review_appointment_page.dart';
import 'package:hmg_patient_app_new/presentation/book_appointment/waiting_appointment/waiting_appointment_info.dart'; import 'package:hmg_patient_app_new/presentation/book_appointment/waiting_appointment/waiting_appointment_info.dart';
import 'package:hmg_patient_app_new/presentation/home/navigation_screen.dart'; import 'package:hmg_patient_app_new/presentation/home/navigation_screen.dart';
@ -110,102 +112,102 @@ class _AppointmentCalendarState extends State<AppointmentCalendar> {
showNavigationArrow: false, showNavigationArrow: false,
headerHeight: 60.h, headerHeight: 60.h,
headerStyle: CalendarHeaderStyle( headerStyle: CalendarHeaderStyle(
backgroundColor: AppColors.transparent, backgroundColor: AppColors.transparent,
// textAlign: isArabic ? TextAlign.end : TextAlign.start, // textAlign: isArabic ? TextAlign.end : TextAlign.start,
textStyle: TextStyle(fontSize: 18.f, fontWeight: FontWeight.w600, letterSpacing: -0.46, color: AppColors.primaryRedColor), textStyle: TextStyle(fontSize: 18.f, fontWeight: FontWeight.w600, letterSpacing: -0.46, color: AppColors.primaryRedColor),
), ),
viewHeaderStyle: ViewHeaderStyle( viewHeaderStyle: ViewHeaderStyle(
// backgroundColor: AppColors.scaffoldBgColor, // backgroundColor: AppColors.scaffoldBgColor,
dayTextStyle: TextStyle(fontSize: 14.f, fontWeight: FontWeight.w600, letterSpacing: -0.46, color: AppColors.textColor), dayTextStyle: TextStyle(fontSize: 14.f, fontWeight: FontWeight.w600, letterSpacing: -0.46, color: AppColors.textColor),
), ),
view: CalendarView.month, view: CalendarView.month,
todayHighlightColor: Colors.transparent, todayHighlightColor: Colors.transparent,
todayTextStyle: TextStyle(color: AppColors.textColor, fontWeight: FontWeight.bold), todayTextStyle: TextStyle(color: AppColors.textColor, fontWeight: FontWeight.bold),
selectionDecoration: ShapeDecoration( selectionDecoration: ShapeDecoration(
color: AppColors.transparent, color: AppColors.transparent,
shape: SmoothRectangleBorder( shape: SmoothRectangleBorder(
borderRadius: BorderRadius.circular(10.r), borderRadius: BorderRadius.circular(10.r),
smoothness: 1, smoothness: 1,
side: BorderSide(color: AppColors.primaryRedColor, width: 1.5), side: BorderSide(color: AppColors.primaryRedColor, width: 1.5),
),
),
cellBorderColor: AppColors.transparent,
dataSource: MeetingDataSource(_getDataSource()),
monthCellBuilder: (context, details) => Padding(
padding: EdgeInsets.all(12.h),
child: details.date.day.toString().toText14(
isCenter: true,
color: details.date == _calendarController.selectedDate ? AppColors.primaryRedColor : AppColors.textColor,
isEnglishOnly: true,
), ),
), ),
monthViewSettings: MonthViewSettings( cellBorderColor: AppColors.transparent,
dayFormat: "EEE", dataSource: MeetingDataSource(_getDataSource()),
appointmentDisplayMode: MonthAppointmentDisplayMode.indicator, monthCellBuilder: (context, details) => Padding(
showTrailingAndLeadingDates: false, padding: EdgeInsets.all(12.h),
appointmentDisplayCount: 1, child: details.date.day.toString().toText14(
monthCellStyle: MonthCellStyle( isCenter: true,
textStyle: TextStyle(fontSize: 19.f), color: details.date == _calendarController.selectedDate ? AppColors.primaryRedColor : AppColors.textColor,
isEnglishOnly: true,
),
),
monthViewSettings: MonthViewSettings(
dayFormat: "EEE",
appointmentDisplayMode: MonthAppointmentDisplayMode.indicator,
showTrailingAndLeadingDates: false,
appointmentDisplayCount: 1,
monthCellStyle: MonthCellStyle(
textStyle: TextStyle(fontSize: 19.f),
),
),
onTap: (CalendarTapDetails details) {
_calendarController.selectedDate = details.date;
_onDaySelected(details.date!);
},
), ),
), ),
onTap: (CalendarTapDetails details) {
_calendarController.selectedDate = details.date;
_onDaySelected(details.date!);
},
), ),
), ),
), // Custom Navigation Arrows
), Positioned(
// Custom Navigation Arrows top: 0,
Positioned( right: isArabic ? null : 0,
top: 0, left: isArabic ? 0 : null,
right: isArabic ? null : 0, child: SizedBox(
left: isArabic ? 0 : null, height: 60.h,
child: SizedBox( child: Row(
height: 60.h, mainAxisSize: MainAxisSize.min,
child: Row( children: [
mainAxisSize: MainAxisSize.min, // Previous Month Arrow
children: [ GestureDetector(
// Previous Month Arrow onTap: () {
GestureDetector( setState(() {
onTap: () { _calendarController.backward!();
setState(() { });
_calendarController.backward!(); },
}); child: Container(
}, padding: EdgeInsets.all(8.h),
child: Container( child: Icon(
padding: EdgeInsets.all(8.h), // isArabic ? Icons.arrow_forward_ios : Icons.arrow_back_ios,
child: Icon( Icons.arrow_back_ios,
// isArabic ? Icons.arrow_forward_ios : Icons.arrow_back_ios, size: 24.h,
Icons.arrow_back_ios, color: AppColors.primaryRedColor,
size: 24.h, ),
color: AppColors.primaryRedColor, ),
), ),
), // Next Month Arrow
), GestureDetector(
// Next Month Arrow onTap: () {
GestureDetector( setState(() {
onTap: () { _calendarController.forward!();
setState(() { });
_calendarController.forward!(); },
}); child: Container(
}, padding: EdgeInsets.all(8.h),
child: Container( child: Icon(
padding: EdgeInsets.all(8.h), // isArabic ? Icons.arrow_back_ios : Icons.arrow_forward_ios,
child: Icon( Icons.arrow_forward_ios,
// isArabic ? Icons.arrow_back_ios : Icons.arrow_forward_ios, size: 24.h,
Icons.arrow_forward_ios, color: AppColors.primaryRedColor,
size: 24.h, ),
color: AppColors.primaryRedColor, ),
), ),
), ],
), ),
], ),
), ),
), ],
), ),
],
),
), ),
SizedBox(height: 10.h), SizedBox(height: 10.h),
Transform.translate( Transform.translate(
@ -266,15 +268,31 @@ class _AppointmentCalendarState extends State<AppointmentCalendar> {
), ),
); );
} else { } else {
bookAppointmentsViewModel.getAppointmentNearestGate( if (bookAppointmentsViewModel.selectedClinic.clinicID! == 17 && bookAppointmentsViewModel.selectedChiefComplaintID == 0) {
projectID: bookAppointmentsViewModel.selectedDoctor.projectID!, clinicID: bookAppointmentsViewModel.selectedDoctor.clinicID!); GetClinicsListResponseModel selectedClinic = GetClinicsListResponseModel(
bookAppointmentsViewModel.setSelectedAppointmentDateTime(selectedDate, selectedTime, selectedDateDisplay); clinicID: bookAppointmentsViewModel.selectedClinic.clinicID,
Navigator.of(context).pop(); clinicDescription: bookAppointmentsViewModel.selectedClinic.clinicDescription,
Navigator.of(context).push( isLiveCareClinicAndOnline: false,
CustomPageRoute( liveCareServiceID: 0,
page: ReviewAppointmentPage(), liveCareClinicID: 0);
), bookAppointmentsViewModel.setProjectID(bookAppointmentsViewModel.selectedDoctor.projectID.toString());
); bookAppointmentsViewModel.setSelectedClinic(selectedClinic);
bookAppointmentsViewModel.setIsChiefComplaintsListLoading(true);
Navigator.of(context).push(
CustomPageRoute(
page: DentalChiefComplaintsPage(),
),
);
} else {
bookAppointmentsViewModel.getAppointmentNearestGate(projectID: bookAppointmentsViewModel.selectedDoctor.projectID!, clinicID: bookAppointmentsViewModel.selectedDoctor.clinicID!);
bookAppointmentsViewModel.setSelectedAppointmentDateTime(selectedDate, selectedTime, selectedDateDisplay);
Navigator.of(context).pop();
Navigator.of(context).push(
CustomPageRoute(
page: ReviewAppointmentPage(),
),
);
}
} }
} else { } else {
showCommonBottomSheetWithoutHeight( showCommonBottomSheetWithoutHeight(
@ -284,8 +302,7 @@ class _AppointmentCalendarState extends State<AppointmentCalendar> {
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Lottie.asset(AppAnimations.errorAnimation, Lottie.asset(AppAnimations.errorAnimation, repeat: true, reverse: false, frameRate: FrameRate(60), width: 100.h, height: 100.h, fit: BoxFit.fill),
repeat: true, reverse: false, frameRate: FrameRate(60), width: 100.h, height: 100.h, fit: BoxFit.fill),
SizedBox(height: 8.h), SizedBox(height: 8.h),
(LocaleKeys.loginToUseService.tr(context: context)).toText16(color: AppColors.blackColor), (LocaleKeys.loginToUseService.tr(context: context)).toText16(color: AppColors.blackColor),
SizedBox(height: 16.h), SizedBox(height: 16.h),
@ -384,12 +401,7 @@ class _AppointmentCalendarState extends State<AppointmentCalendar> {
selectedButtonIndex = 0; selectedButtonIndex = 0;
List<Map<String, dynamic>> timeList = []; List<Map<String, dynamic>> timeList = [];
for (var i = 0; i < dayEvents.length; i++) { for (var i = 0; i < dayEvents.length; i++) {
Map<String, dynamic> timeSlot = { Map<String, dynamic> timeSlot = {"isoTime": dayEvents[i].isoTime, "start": dayEvents[i].start.toString(), "end": dayEvents[i].end.toString(), "vidaDate": dayEvents[i].vidaDate};
"isoTime": dayEvents[i].isoTime,
"start": dayEvents[i].start.toString(),
"end": dayEvents[i].end.toString(),
"vidaDate": dayEvents[i].vidaDate
};
timeList.add(timeSlot); timeList.add(timeSlot);
} }
if (dayEvents.isNotEmpty) { if (dayEvents.isNotEmpty) {

Loading…
Cancel
Save