|
|
|
@ -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() {
|
|
|
|
|