Dental book appointment changes

sultan_v3.3
haroon amjad 2 years ago
parent 25af2c23ef
commit e5e5bb5352

@ -22,8 +22,10 @@ import 'package:flutter/material.dart';
class DentalComplaints extends StatefulWidget {
SearchInfo searchInfo;
Function onSelectedMethod;
bool isDoctorNameSearch;
DentalComplaints({@required this.searchInfo});
DentalComplaints({@required this.searchInfo, this.onSelectedMethod, this.isDoctorNameSearch = false});
@override
_DentalComplaintsState createState() => _DentalComplaintsState();
@ -66,6 +68,8 @@ class _DentalComplaintsState extends State<DentalComplaints> {
child: DentalComplaintCard(
listDentalChiefComplain: complaintsList[index],
languageID: languageID,
isDoctorNameSearch: widget.isDoctorNameSearch,
onSelectedMethod: widget.onSelectedMethod,
)..logAnalytics = (){
final info = widget.searchInfo;
locator<GAnalytics>().appointment.book_appointment_chief_complaints(appointment_type: 'regular', hospital: info.hospital, clinic: info.clinic, treatment: complaintsList[index]);

@ -1,10 +1,14 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorProfile.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorRateDetails.dart';
import 'package:diplomaticquarterapp/models/Appointments/SearchInfoModel.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/models/Clinics/ClinicListResponse.dart';
import 'package:diplomaticquarterapp/models/header_model.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/DentalComplaints.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/doctor_post_pre_images_page.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/SchedulePage.dart';
import 'package:diplomaticquarterapp/routes.dart';
@ -34,8 +38,9 @@ class DoctorProfile extends StatefulWidget {
DoctorProfileList docProfileList;
final bool isOpenAppt;
bool isLiveCareAppointment;
bool isDoctorNameSearch;
DoctorProfile({@required this.doctor, @required this.docProfileList, @required this.isLiveCareAppointment, this.isOpenAppt = false});
DoctorProfile({@required this.doctor, @required this.docProfileList, @required this.isLiveCareAppointment, this.isOpenAppt = false, this.isDoctorNameSearch = false});
AuthenticatedUser authUser;
@ -89,11 +94,10 @@ class _DoctorProfileState extends State<DoctorProfile> with TickerProviderStateM
minWidth: MediaQuery.of(context).size.width * 0.7,
height: 40.0,
child: CustomTextButton(
backgroundColor: CustomColors.accentColor,
elevation: 0,
backgroundColor: CustomColors.accentColor,
elevation: 0,
onPressed: goToBookConfirm,
child: Text(TranslationBase.of(context).reviewAppointment, style: TextStyle(fontSize: 16.0, letterSpacing: -0.48,
color: Colors.white, fontWeight: FontWeight.w600)),
child: Text(TranslationBase.of(context).reviewAppointment, style: TextStyle(fontSize: 16.0, letterSpacing: -0.48, color: Colors.white, fontWeight: FontWeight.w600)),
),
),
),
@ -445,10 +449,9 @@ class _DoctorProfileState extends State<DoctorProfile> with TickerProviderStateM
),
minWidth: MediaQuery.of(context).size.width,
height: 40.0,
child:CustomTextButton(
elevation: 0.0,
backgroundColor: Colors.white,
child: CustomTextButton(
elevation: 0.0,
backgroundColor: Colors.white,
onPressed: () {
Navigator.of(context).pop();
},
@ -489,23 +492,52 @@ class _DoctorProfileState extends State<DoctorProfile> with TickerProviderStateM
}
void goToBookConfirm() async {
if (DocAvailableAppointments.areSlotsAvailable) {
if (projectViewModel.isLogin) {
final timeSlot = DocAvailableAppointments.selectedAppoDateTime;
navigateToBookConfirm(context);
projectViewModel.analytics.appointment.book_appointment_review(appointment_type: 'regular', dateTime: timeSlot, doctor: widget.doctor);
} else {
ConfirmDialog dialog = new ConfirmDialog(
context: context,
confirmMessage: TranslationBase.of(context).loginToUseService,
okText: TranslationBase.of(context).confirm,
cancelText: TranslationBase.of(context).cancel_nocaps,
okFunction: () => {navigateToLogin()},
cancelFunction: () => {});
dialog.showAlertDialog(context);
}
} else
AppToast.showErrorToast(message: TranslationBase.of(context).selectSlot);
if (widget.isDoctorNameSearch) {
navigateToDentalComplaints(context);
} else {
if (DocAvailableAppointments.areSlotsAvailable) {
if (projectViewModel.isLogin) {
final timeSlot = DocAvailableAppointments.selectedAppoDateTime;
navigateToBookConfirm(context);
projectViewModel.analytics.appointment.book_appointment_review(appointment_type: 'regular', dateTime: timeSlot, doctor: widget.doctor);
} else {
ConfirmDialog dialog = new ConfirmDialog(
context: context,
confirmMessage: TranslationBase.of(context).loginToUseService,
okText: TranslationBase.of(context).confirm,
cancelText: TranslationBase.of(context).cancel_nocaps,
okFunction: () => {navigateToLogin()},
cancelFunction: () => {});
dialog.showAlertDialog(context);
}
} else
AppToast.showErrorToast(message: TranslationBase.of(context).selectSlot);
}
}
Future navigateToDentalComplaints(BuildContext context) async {
HospitalsModel selectedHospital = new HospitalsModel();
selectedHospital.name = widget.doctor.projectName;
ListClinicCentralized selectedClinic = new ListClinicCentralized();
selectedClinic.clinicDescription = widget.doctor.clinicName;
SearchInfo searchInfo = new SearchInfo();
searchInfo.ProjectID = widget.doctor.projectID;
searchInfo.ClinicID = widget.doctor.clinicID;
searchInfo.date = DateTime.now();
searchInfo.hospital = selectedHospital;
searchInfo.clinic = selectedClinic;
Navigator.push(
context,
FadePage(
page: DentalComplaints(searchInfo: searchInfo),
),
).then((value) {
// setState(() {
// dropdownValue = null;
// });
});
}
navigateToLogin() {

@ -15,9 +15,10 @@ class SearchResults extends StatefulWidget {
List<PatientDoctorAppointmentList> patientDoctorAppointmentListHospital;
bool isLiveCareAppointment;
bool isObGyneAppointment;
bool isDoctorNameSearch;
OBGyneProcedureListResponse obGyneProcedureListResponse;
SearchResults({@required this.doctorsList, this.patientDoctorAppointmentListHospital, this.isObGyneAppointment = false, @required this.isLiveCareAppointment, this.obGyneProcedureListResponse});
SearchResults({@required this.doctorsList, this.patientDoctorAppointmentListHospital, this.isObGyneAppointment = false, this.isDoctorNameSearch = false, @required this.isLiveCareAppointment, this.obGyneProcedureListResponse});
@override
_SearchResultsState createState() => _SearchResultsState();
@ -61,6 +62,7 @@ class _SearchResultsState extends State<SearchResults> {
doctor: doctor,
isLiveCareAppointment: widget.isLiveCareAppointment,
isObGyneAppointment: widget.isObGyneAppointment,
isDoctorNameSearch: widget.isDoctorNameSearch,
obGyneProcedureListResponse: widget.obGyneProcedureListResponse,
onTap: () {
projectViewModel.analytics.appointment.book_appointment_select_doctor(appointment_type: 'regular', doctor: doctor);

@ -153,7 +153,7 @@ class _SearchByDoctorState extends State<SearchByDoctor> {
}
navigateToSearchResults(context, List<DoctorList> docList, List<PatientDoctorAppointmentList> patientDoctorAppointmentListHospital) {
Navigator.push(context, FadePage(page: SearchResults(isLiveCareAppointment: false, doctorsList: docList, patientDoctorAppointmentListHospital: patientDoctorAppointmentListHospital)));
Navigator.push(context, FadePage(page: SearchResults(isLiveCareAppointment: false, isDoctorNameSearch: true, doctorsList: docList, patientDoctorAppointmentListHospital: patientDoctorAppointmentListHospital)));
}
Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {String prefix, bool isEnable = true, bool hasSelection = false}) {

@ -1,5 +1,3 @@
import 'package:diplomaticquarterapp/analytics/google-analytics.dart';
import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/models/Appointments/DentalChiefComplaintsModel.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart';
@ -14,8 +12,10 @@ class DentalComplaintCard extends StatefulWidget {
final ListDentalChiefComplain listDentalChiefComplain;
VoidCallback logAnalytics;
var languageID;
Function onSelectedMethod;
bool isDoctorNameSearch;
DentalComplaintCard({@required this.listDentalChiefComplain, this.languageID});
DentalComplaintCard({@required this.listDentalChiefComplain, this.languageID, this.onSelectedMethod, this.isDoctorNameSearch = false});
@override
_DentalComplaintCardState createState() => _DentalComplaintCardState();
@ -27,9 +27,12 @@ class _DentalComplaintCardState extends State<DentalComplaintCard> {
return Container(
child: InkWell(
onTap: () {
if(widget.logAnalytics != null)
widget.logAnalytics();
if (widget.logAnalytics != null) widget.logAnalytics();
// if(widget.isDoctorNameSearch) {
// widget.onSelectedMethod();
// } else {
getChiefComplaintsList();
// }
},
child: Container(
width: double.infinity,

@ -1,7 +1,11 @@
import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorProfile.dart';
import 'package:diplomaticquarterapp/models/Appointments/OBGyneProcedureListResponse.dart';
import 'package:diplomaticquarterapp/models/Appointments/SearchInfoModel.dart';
import 'package:diplomaticquarterapp/models/Clinics/ClinicListResponse.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/DentalComplaints.dart';
import 'package:diplomaticquarterapp/pages/ToDoList/ObGyne/ObGyne-TimeSlots.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
@ -9,6 +13,7 @@ import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart';
import 'package:diplomaticquarterapp/widgets/dragable_sheet.dart';
import 'package:diplomaticquarterapp/widgets/my_rich_text.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
@ -22,10 +27,18 @@ class DoctorView extends StatelessWidget {
bool isLiveCareAppointment;
bool isObGyneAppointment;
bool isShowFlag;
bool isDoctorNameSearch;
OBGyneProcedureListResponse obGyneProcedureListResponse;
final VoidCallback onTap;
DoctorView({@required this.doctor, @required this.isLiveCareAppointment, this.isObGyneAppointment = false, this.isShowFlag = true, this.onTap, this.obGyneProcedureListResponse});
DoctorView(
{@required this.doctor,
@required this.isLiveCareAppointment,
this.isObGyneAppointment = false,
this.isDoctorNameSearch = false,
this.isShowFlag = true,
this.onTap,
this.obGyneProcedureListResponse});
ProjectViewModel projectViewModel;
@ -37,7 +50,12 @@ class DoctorView extends StatelessWidget {
if (isObGyneAppointment) {
next(context);
} else {
if (isShowFlag) getDoctorsProfile(context, doctor, isAppo: true);
// if (doctor.clinicID == 17 && isDoctorNameSearch) {
// showDentalChiefComplaintsList(context);
// } else
if (isShowFlag) {
getDoctorsProfile(context, doctor, isAppo: true);
}
(onTap ?? () {})(); // For log analytics of doctor click from book appointment
}
},
@ -138,6 +156,24 @@ class DoctorView extends StatelessWidget {
);
}
showDentalChiefComplaintsList(BuildContext context) {
HospitalsModel selectedHospital = new HospitalsModel();
selectedHospital.name = doctor.projectName;
ListClinicCentralized selectedClinic = new ListClinicCentralized();
selectedClinic.clinicDescription = doctor.clinicName;
SearchInfo searchInfo = new SearchInfo();
searchInfo.ProjectID = doctor.projectID;
searchInfo.ClinicID = doctor.clinicID;
searchInfo.date = DateTime.now();
searchInfo.hospital = selectedHospital;
searchInfo.clinic = selectedClinic;
showDraggableDialog(context, DentalComplaints(isDoctorNameSearch: true, onSelectedMethod: () {
Navigator.pop(context);
}, searchInfo: searchInfo));
}
String getDoctorSpeciality(List<String> docSpecial) {
String docSpeciality = "";
docSpecial.forEach((v) {
@ -193,7 +229,8 @@ class DoctorView extends StatelessWidget {
}
void next(BuildContext context) {
Navigator.push(context, FadePage(page: ObGyneTimeSlots(projectID: doctor.projectID, selectedClinicID: doctor.clinicID, selectedDoctorID: doctor.doctorID, obGyneProcedureListResponse: obGyneProcedureListResponse)));
Navigator.push(context,
FadePage(page: ObGyneTimeSlots(projectID: doctor.projectID, selectedClinicID: doctor.clinicID, selectedDoctorID: doctor.doctorID, obGyneProcedureListResponse: obGyneProcedureListResponse)));
}
Future navigateToDoctorProfile(context, docObject, docProfile, {isAppo}) async {
@ -205,6 +242,7 @@ class DoctorView extends StatelessWidget {
isLiveCareAppointment: isLiveCareAppointment,
docProfileList: docProfile,
isOpenAppt: isAppo,
isDoctorNameSearch: isDoctorNameSearch,
),
),
);

Loading…
Cancel
Save