New loading dialog added into appointment flow

fix_login
haroon amjad 4 years ago
parent 6fd7a3fa3d
commit 1553e71e7d

@ -661,6 +661,7 @@ const Map<String, Map<String, String>> localizedValues = {
"ar": "الفحص ليس تشخيص."
},
"remeberthat": {"en": "Remember that", "ar": "تذكر ذلك:"},
"loginToUseService": {"en": "You need to login to use this service", "ar": "هذة الخدمة تتطلب تسجيل الدخول"},
"select-gender": {"en": "Select Gender", "ar": "اختر الجنس"},
"i-am-a": {"en": "I am a ...", "ar": "أنا ..."},

@ -383,8 +383,10 @@ class _BookConfirmState extends State<BookConfirm> {
cancelAppointment(DoctorList docObject, AppoitmentAllHistoryResultList appo,
BuildContext context) {
ConfirmDialog.closeAlertDialog(context);
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
service.cancelAppointment(appo, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
Future.delayed(new Duration(milliseconds: 1500), () {
if (!widget.isLiveCareAppointment) {
@ -398,8 +400,8 @@ class _BookConfirmState extends State<BookConfirm> {
}
}).catchError((err) {
print(err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
GifLoaderDialogUtils.hideDialog(context);
});
}
insertAppointment(context, DoctorList docObject) {
@ -423,6 +425,7 @@ class _BookConfirmState extends State<BookConfirm> {
docObject.projectID, docObject);
});
} else {
GifLoaderDialogUtils.hideDialog(context);
appo = new AppoitmentAllHistoryResultList();
appo.appointmentNo = res['SameClinicApptList'][0]['AppointmentNo'];
appo.clinicID = res['SameClinicApptList'][0]['DoctorID'];
@ -451,6 +454,7 @@ class _BookConfirmState extends State<BookConfirm> {
}
insertLiveCareScheduledAppointment(context, DoctorList docObject) {
GifLoaderDialogUtils.showMyDialog(context);
AppoitmentAllHistoryResultList appo;
widget.service
.insertLiveCareScheduleAppointment(
@ -471,6 +475,7 @@ class _BookConfirmState extends State<BookConfirm> {
docObject.clinicID, docObject.projectID, docObject);
});
} else {
GifLoaderDialogUtils.hideDialog(context);
appo = new AppoitmentAllHistoryResultList();
appo.appointmentNo = res['SameClinicApptList'][0]['AppointmentNo'];
appo.clinicID = res['SameClinicApptList'][0]['DoctorID'];
@ -514,6 +519,7 @@ class _BookConfirmState extends State<BookConfirm> {
getLiveCareAppointmentPatientShare(context, String appointmentNo,
int clinicID, int projectID, DoctorList docObject) {
GifLoaderDialogUtils.hideDialog(context);
widget.service
.getLiveCareAppointmentPatientShare(
appointmentNo, clinicID, projectID, context)
@ -523,8 +529,7 @@ class _BookConfirmState extends State<BookConfirm> {
navigateToBookSuccess(context, docObject, widget.patientShareResponse);
}).catchError((err) {
print(err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
});
}
String getTime(DateTime dateTime) {

@ -40,6 +40,8 @@ class _DoctorProfileState extends State<DoctorProfile>
bool showFooterButton = false;
var event = RobotProvider();
AppSharedPreferences sharedPref = AppSharedPreferences();
@override
void initState() {
_tabController = new TabController(
@ -69,6 +71,7 @@ class _DoctorProfileState extends State<DoctorProfile>
return AppScaffold(
appBarTitle: TranslationBase.of(context).bookAppo,
isShowAppBar: true,
isShowDecPage: false,
bottomSheet: showFooterButton
? Container(
width: MediaQuery.of(context).size.width,
@ -211,7 +214,6 @@ class _DoctorProfileState extends State<DoctorProfile>
}
getPatientData() async {
AppSharedPreferences sharedPref = AppSharedPreferences();
if (await sharedPref.getObject(USER_PROFILE) != null) {
var data =
AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE));
@ -222,14 +224,14 @@ class _DoctorProfileState extends State<DoctorProfile>
}
}
void goToBookConfirm() {
void goToBookConfirm() async {
if (DocAvailableAppointments.areSlotsAvailable) {
if (widget.authUser.patientID != null) {
if (await sharedPref.getObject(USER_PROFILE) != null) {
navigateToBookConfirm(context);
} else {
ConfirmDialog dialog = new ConfirmDialog(
context: context,
confirmMessage: "You have to login to use this service",
confirmMessage: TranslationBase.of(context).loginToUseService,
okText: TranslationBase.of(context).confirm,
cancelText: TranslationBase.of(context).cancel_nocaps,
okFunction: () => {navigateToLogin()},

@ -4,10 +4,10 @@ import 'package:diplomaticquarterapp/models/Appointments/timeSlot.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
import 'package:smart_progress_bar/smart_progress_bar.dart';
import 'package:table_calendar/table_calendar.dart';
import '../../../uitl/date_uitl.dart';
@ -331,11 +331,13 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments>
}
getDoctorFreeSlots(context, DoctorList docObject) {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
service
.getDoctorFreeSlots(docObject.doctorID, docObject.clinicID,
docObject.projectID, context)
.then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
if (res['FreeTimeSlots'].length != 0) {
freeSlotsResponse = res['FreeTimeSlots'];
@ -350,16 +352,17 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments>
}
}).catchError((err) {
print(err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
});
}
getDoctorScheduledFreeSlots(context, DoctorList docObject) {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
service
.getDoctorScheduledFreeSlots(docObject.doctorID, docObject.clinicID,
docObject.projectID, docObject.serviceID, context)
.then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
if (res['PatientER_DoctorFreeSlots'].length != 0) {
freeSlotsResponse = res['PatientER_DoctorFreeSlots'];
@ -374,8 +377,7 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments>
}
}).catchError((err) {
print(err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
});
}
Widget _buildEventsMarker(DateTime date, List events) {

@ -201,12 +201,14 @@ class _SearchByClinicState extends State<SearchByClinic> {
}
getDoctorsList(BuildContext context) {
GifLoaderDialogUtils.showMyDialog(context);
SearchInfo searchInfo = new SearchInfo();
if (dropdownValue == "17") {
searchInfo.ProjectID = int.parse(projectDropdownValue);
searchInfo.ClinicID = int.parse(dropdownValue);
searchInfo.date = DateTime.now();
GifLoaderDialogUtils.hideDialog(context);
navigateToDentalComplaints(context, searchInfo);
} else {
List<DoctorList> doctorsList = [];
@ -222,6 +224,7 @@ class _SearchByClinicState extends State<SearchByClinic> {
nearestAppo,
context)
.then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
setState(() {
if (res['DoctorList'].length != 0) {
@ -240,17 +243,16 @@ class _SearchByClinicState extends State<SearchByClinic> {
result = LinkedHashSet<String>.from(arr).toList();
numAll = result.length;
navigateToSearchResults(
context, doctorsList, result, numAll, arrDistance);
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
AppToast.showErrorToast(message: err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
});
}
}

@ -1,6 +1,7 @@
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/material.dart';
import 'package:smart_progress_bar/smart_progress_bar.dart';
@ -82,6 +83,7 @@ class _SearchByDoctorState extends State<SearchByDoctor> {
}
getDoctorsList(BuildContext context) {
GifLoaderDialogUtils.showMyDialog(context);
List<DoctorList> doctorsList = [];
DoctorsListService service = new DoctorsListService();
@ -123,7 +125,7 @@ class _SearchByDoctorState extends State<SearchByDoctor> {
});
} else {}
});
GifLoaderDialogUtils.hideDialog(context);
navigateToSearchResults(
context, doctorsList, _patientDoctorAppointmentListHospital);
} else {
@ -131,8 +133,7 @@ class _SearchByDoctorState extends State<SearchByDoctor> {
}
}).catchError((err) {
print(err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
});
}
_onDocTextChanged(content) {

@ -27,6 +27,7 @@ class _BranchViewState extends State<BranchView> {
return AppScaffold(
appBarTitle: TranslationBase.of(context).bookAppo,
isShowAppBar: true,
isShowDecPage: false,
isBottomBar: false,
body: new ListView.builder(
itemBuilder: (BuildContext context, int index) {

@ -31,7 +31,7 @@ class CardCommon extends StatelessWidget {
child: Text(this.text,
overflow: TextOverflow.clip,
style: TextStyle(
color: new Color(0xFFc5272d),
color: new Color(0xFF40ACC9),
letterSpacing: 1.0,
fontSize: 20.0)),
),

@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/models/Appointments/DoctorProfile.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:flutter/material.dart';
import 'package:rating_bar/rating_bar.dart';
import 'package:smart_progress_bar/smart_progress_bar.dart';
@ -135,12 +136,14 @@ class DoctorView extends StatelessWidget {
}
getDoctorsProfile(context, DoctorList docObject, {isAppo}) {
GifLoaderDialogUtils.showMyDialog(context);
List<DoctorProfileList> docProfileList = [];
DoctorsListService service = new DoctorsListService();
service
.getDoctorsProfile(docObject.doctorID, docObject.clinicID,
docObject.projectID, context)
.then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
if (res['DoctorProfileList'].length != 0) {
res['DoctorProfileList'].forEach((v) {
@ -154,7 +157,7 @@ class DoctorView extends StatelessWidget {
}
}).catchError((err) {
print(err);
}).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
});
}
String getDate(String date) {

@ -5,11 +5,11 @@ import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/AppointmentCar
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'package:smart_progress_bar/smart_progress_bar.dart';
class MyAppointments extends StatefulWidget {
List<AppoitmentAllHistoryResultList> appoList = [];
@ -33,6 +33,7 @@ class _MyAppointmentsState extends State<MyAppointments>
bool isDataLoaded = false;
var sharedPref = new AppSharedPreferences();
@override
void initState() {
_tabController = new TabController(length: 3, vsync: this);
@ -77,6 +78,7 @@ class _MyAppointmentsState extends State<MyAppointments>
}
getPatientAppointmentHistory() {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
widget.appoList.clear();
widget.bookedAppoList.clear();
@ -85,6 +87,7 @@ class _MyAppointmentsState extends State<MyAppointments>
service.getPatientAppointmentHistory(false, context).then((res) {
print(res['AppoimentAllHistoryResultList'].length);
if (res['MessageStatus'] == 1) {
GifLoaderDialogUtils.hideDialog(context);
setState(() {
if (res['AppoimentAllHistoryResultList'].length != 0) {
res['AppoimentAllHistoryResultList'].forEach((v) {
@ -100,11 +103,11 @@ class _MyAppointmentsState extends State<MyAppointments>
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
AppToast.showErrorToast(message: err);
Navigator.of(context).pop();
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
});
}
bool isConfirmed(AppoitmentAllHistoryResultList appo) {

@ -18,12 +18,12 @@ import 'package:diplomaticquarterapp/pages/medical/radiology/radiology_details_p
import 'package:diplomaticquarterapp/pages/medical/vital_sign/vital_sign_details_screen.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'package:smart_progress_bar/smart_progress_bar.dart';
import 'package:url_launcher/url_launcher.dart';
class AppointmentActions extends StatefulWidget {
@ -351,49 +351,49 @@ class _AppointmentActionsState extends State<AppointmentActions> {
cancelAppointment() {
ConfirmDialog.closeAlertDialog(context);
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
service
.cancelAppointment(widget.appo, context)
.then((res) {
print(res);
if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: res['ErrorEndUserMessage']);
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
})
.catchError((err) {
print(err);
})
.showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6))
.then((value) {
Navigator.of(context).pop();
});
service.cancelAppointment(widget.appo, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
print(res);
if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: res['ErrorEndUserMessage']);
Navigator.of(context).pop();
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
});
}
openAppointmentRadiology() {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
FinalRadiology finalRadiology = new FinalRadiology();
service
.getPatientRadOrders(widget.appo.appointmentNo.toString(), context)
.then((res) {
GifLoaderDialogUtils.hideDialog(context);
print(res['FinalRadiologyList']);
finalRadiology =
new FinalRadiology.fromJson(res['FinalRadiologyList'][0]);
print(finalRadiology.reportData);
navigateToRadiologyDetails(finalRadiology);
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
AppToast.showErrorToast(message: err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
});
}
openPrescriptionReport() {
GifLoaderDialogUtils.showMyDialog(context);
List<PrescriptionReportEnh> prescriptionReportEnhList = List();
DoctorsListService service = new DoctorsListService();
service.getPatientPrescriptionReports(widget.appo, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
res['ListPRM'].forEach((report) {
prescriptionReportEnhList.add(PrescriptionReportEnh.fromJson(report));
});
@ -405,10 +405,10 @@ class _AppointmentActionsState extends State<AppointmentActions> {
AppToast.showErrorToast(message: "Sorry there is no data");
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
AppToast.showErrorToast(message: err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
});
}
Future navigateToMedicinePrescriptionReport(
@ -463,8 +463,10 @@ class _AppointmentActionsState extends State<AppointmentActions> {
}
askYourDoc() {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
service.isAllowedToAskDoctor(widget.appo.doctorID, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
print(res['PatientDoctorAppointmentResultList']);
if (res['PatientDoctorAppointmentResultList'].length != 0) {
getCallRequestType();
@ -473,15 +475,17 @@ class _AppointmentActionsState extends State<AppointmentActions> {
message: TranslationBase.of(context).askDocNotAllowed);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
AppToast.showErrorToast(message: err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
});
}
getCallRequestType() {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
service.getCallRequestType(context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
List<AskDocRequestType> requestData = new List<AskDocRequestType>();
res['ListReqTypes'].forEach((element) {
requestData.add(new AskDocRequestType.fromJson(element));
@ -490,9 +494,9 @@ class _AppointmentActionsState extends State<AppointmentActions> {
showAskDocRequestDialog(requestData);
});
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
});
}
showAskDocRequestDialog(List<AskDocRequestType> requestData) {
@ -525,28 +529,32 @@ class _AppointmentActionsState extends State<AppointmentActions> {
}
sendAskDocRequest(int requestType) {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
service
.sendAskDocCallRequest(widget.appo, requestType.toString(), context)
.then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: "Request Sent Successfully");
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
AppToast.showErrorToast(message: err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
});
}
confirmAppointment() {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
service
.confirmAppointment(widget.appo.appointmentNo, widget.appo.clinicID,
widget.appo.projectID, widget.appo.isLiveCareAppointment, context)
.then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: res['ErrorEndUserMessage']);
Navigator.of(context).pop();
@ -554,9 +562,9 @@ class _AppointmentActionsState extends State<AppointmentActions> {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
});
}
navigateToInsuranceApprovals(int appoNo) {

@ -11,6 +11,7 @@ import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
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/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart';
@ -18,7 +19,6 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:rating_bar/rating_bar.dart';
import 'package:smart_progress_bar/smart_progress_bar.dart';
class ToDo extends StatefulWidget {
PatientShareResponse patientShareResponse;
@ -106,7 +106,12 @@ class _ToDoState extends State<ToDo> {
TranslationBase.of(context)
.liveCareAppo,
style: TextStyle(fontSize: 12.0))
: Text(widget.appoList[index].projectName != null ? widget.appoList[index].projectName : "-",
: Text(
widget.appoList[index].projectName !=
null
? widget
.appoList[index].projectName
: "-",
style: TextStyle(fontSize: 11.0)),
),
],
@ -464,8 +469,10 @@ class _ToDoState extends State<ToDo> {
}
getPatientAppointmentHistory() {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
service.getPatientAppointmentHistory(true, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
setState(() {
if (res['AppoimentAllHistoryResultList'].length != 0) {
@ -485,26 +492,29 @@ class _ToDoState extends State<ToDo> {
}
}).catchError((err) {
print(err);
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
});
}
getPatientShare(context, AppoitmentAllHistoryResultList appo) {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
service
.getPatientShare(appo.appointmentNo.toString(), appo.clinicID,
appo.projectID, context)
.then((res) {
GifLoaderDialogUtils.hideDialog(context);
widget.patientShareResponse = new PatientShareResponse.fromJson(res);
openPaymentDialog(appo, widget.patientShareResponse);
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
});
}
getAppoQR(context, AppoitmentAllHistoryResultList appo) {
GifLoaderDialogUtils.showMyDialog(context);
PatientShareResponse patientShareResponse = new PatientShareResponse();
patientShareResponse.doctorNameObj = appo.doctorNameObj;
@ -518,12 +528,13 @@ class _ToDoState extends State<ToDo> {
DoctorsListService service = new DoctorsListService();
service.generateAppointmentQR(patientShareResponse, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
print(res);
navigateToQR(context, res['AppointmentQR'], patientShareResponse);
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
});
}
Future navigateToQR(
@ -620,6 +631,7 @@ class _ToDoState extends State<ToDo> {
}
checkPaymentStatus(AppoitmentAllHistoryResultList appo) {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
service
.checkPaymentStatus(
@ -627,8 +639,7 @@ class _ToDoState extends State<ToDo> {
appo.projectID, appo.clinicID, appo.appointmentNo),
context)
.then((res) {
print("Printing Payment Status Reponse!!!!");
print(res);
GifLoaderDialogUtils.hideDialog(context);
String paymentInfo = res['Response_Message'];
if (paymentInfo == 'Success') {
createAdvancePayment(res, appo);
@ -636,18 +647,20 @@ class _ToDoState extends State<ToDo> {
AppToast.showErrorToast(message: res['Response_Message']);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
});
}
createAdvancePayment(res, AppoitmentAllHistoryResultList appo) {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
String paymentReference = res['Fort_id'].toString();
service
.createAdvancePayment(
appo, res['Amount'], res['Fort_id'], res['PaymentMethod'], context)
.then((res) {
GifLoaderDialogUtils.hideDialog(context);
print(res['OnlineCheckInAppointments'][0]['AdvanceNumber']);
addAdvancedNumberRequest(
res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(),
@ -656,23 +669,25 @@ class _ToDoState extends State<ToDo> {
appo);
}).catchError((err) {
print(err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
GifLoaderDialogUtils.hideDialog(context);
});
}
addAdvancedNumberRequest(String advanceNumber, String paymentReference,
String appointmentID, AppoitmentAllHistoryResultList appo) {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
service
.addAdvancedNumberRequest(
advanceNumber, paymentReference, appointmentID, context)
.then((res) {
GifLoaderDialogUtils.hideDialog(context);
print(res);
getAppoQR(context, appo);
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
});
}
Future navigateToPaymentMethod(
@ -705,51 +720,46 @@ class _ToDoState extends State<ToDo> {
}
confirmAppointment(AppoitmentAllHistoryResultList appo) {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
service
.confirmAppointment(appo.appointmentNo, appo.clinicID, appo.projectID,
appo.isLiveCareAppointment, context)
.then((res) {
if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: res['ErrorEndUserMessage']);
getPatientAppointmentHistory();
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
})
.catchError((err) {
print(err);
})
.showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6))
.then((value) {
if (appo.isLiveCareAppointment) {
insertLiveCareVIDARequest(appo);
} else {
getPatientAppointmentHistory();
}
});
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: res['ErrorEndUserMessage']);
if (appo.isLiveCareAppointment) {
insertLiveCareVIDARequest(appo);
} else {
getPatientAppointmentHistory();
}
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
});
}
insertLiveCareVIDARequest(AppoitmentAllHistoryResultList appo) {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
service
.insertVIDARequest(appo.appointmentNo, appo.clinicID, appo.projectID,
appo.serviceID, appo.doctorID, context)
.then((res) {
if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: res['ErrorEndUserMessage']);
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
})
.catchError((err) {
print(err);
})
.showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6))
.then((value) {
getPatientAppointmentHistory();
});
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: res['ErrorEndUserMessage']);
getPatientAppointmentHistory();
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) {
print(err);
GifLoaderDialogUtils.hideDialog(context);
});
}
}

@ -728,6 +728,8 @@ class TranslationBase {
String get selectAge => localizedValues['select-age'][locale.languageCode];
String get iAm => localizedValues['i-am'][locale.languageCode];
String get yearOld => localizedValues['years-old'][locale.languageCode];
String get loginToUseService => localizedValues['loginToUseService'][locale.languageCode];
}
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

Loading…
Cancel
Save