Merge branch 'diplomatic-quarter-live' of https://gitlab.com/Cloud_Solution/diplomatic-quarter into home_page

 Conflicts:
	lib/uitl/translations_delegate_base.dart
fix_login
Mohammad Aljmma 4 years ago
commit 479aea4df8

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

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

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

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

@ -201,12 +201,14 @@ class _SearchByClinicState extends State<SearchByClinic> {
} }
getDoctorsList(BuildContext context) { getDoctorsList(BuildContext context) {
GifLoaderDialogUtils.showMyDialog(context);
SearchInfo searchInfo = new SearchInfo(); SearchInfo searchInfo = new SearchInfo();
if (dropdownValue == "17") { if (dropdownValue == "17") {
searchInfo.ProjectID = int.parse(projectDropdownValue); searchInfo.ProjectID = int.parse(projectDropdownValue);
searchInfo.ClinicID = int.parse(dropdownValue); searchInfo.ClinicID = int.parse(dropdownValue);
searchInfo.date = DateTime.now(); searchInfo.date = DateTime.now();
GifLoaderDialogUtils.hideDialog(context);
navigateToDentalComplaints(context, searchInfo); navigateToDentalComplaints(context, searchInfo);
} else { } else {
List<DoctorList> doctorsList = []; List<DoctorList> doctorsList = [];
@ -222,6 +224,7 @@ class _SearchByClinicState extends State<SearchByClinic> {
nearestAppo, nearestAppo,
context) context)
.then((res) { .then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
setState(() { setState(() {
if (res['DoctorList'].length != 0) { if (res['DoctorList'].length != 0) {
@ -240,17 +243,16 @@ class _SearchByClinicState extends State<SearchByClinic> {
result = LinkedHashSet<String>.from(arr).toList(); result = LinkedHashSet<String>.from(arr).toList();
numAll = result.length; numAll = result.length;
navigateToSearchResults( navigateToSearchResults(
context, doctorsList, result, numAll, arrDistance); context, doctorsList, result, numAll, arrDistance);
} else { } else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']); AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
} }
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err); print(err);
AppToast.showErrorToast(message: 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/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.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/uitl/translations_delegate_base.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:smart_progress_bar/smart_progress_bar.dart'; import 'package:smart_progress_bar/smart_progress_bar.dart';
@ -82,6 +83,7 @@ class _SearchByDoctorState extends State<SearchByDoctor> {
} }
getDoctorsList(BuildContext context) { getDoctorsList(BuildContext context) {
GifLoaderDialogUtils.showMyDialog(context);
List<DoctorList> doctorsList = []; List<DoctorList> doctorsList = [];
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
@ -123,7 +125,7 @@ class _SearchByDoctorState extends State<SearchByDoctor> {
}); });
} else {} } else {}
}); });
GifLoaderDialogUtils.hideDialog(context);
navigateToSearchResults( navigateToSearchResults(
context, doctorsList, _patientDoctorAppointmentListHospital); context, doctorsList, _patientDoctorAppointmentListHospital);
} else { } else {
@ -131,8 +133,7 @@ class _SearchByDoctorState extends State<SearchByDoctor> {
} }
}).catchError((err) { }).catchError((err) {
print(err); print(err);
}).showProgressBar( });
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
} }
_onDocTextChanged(content) { _onDocTextChanged(content) {

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

@ -31,7 +31,7 @@ class CardCommon extends StatelessWidget {
child: Text(this.text, child: Text(this.text,
overflow: TextOverflow.clip, overflow: TextOverflow.clip,
style: TextStyle( style: TextStyle(
color: new Color(0xFFc5272d), color: new Color(0xFF40ACC9),
letterSpacing: 1.0, letterSpacing: 1.0,
fontSize: 20.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/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:rating_bar/rating_bar.dart'; import 'package:rating_bar/rating_bar.dart';
import 'package:smart_progress_bar/smart_progress_bar.dart'; import 'package:smart_progress_bar/smart_progress_bar.dart';
@ -135,12 +136,14 @@ class DoctorView extends StatelessWidget {
} }
getDoctorsProfile(context, DoctorList docObject, {isAppo}) { getDoctorsProfile(context, DoctorList docObject, {isAppo}) {
GifLoaderDialogUtils.showMyDialog(context);
List<DoctorProfileList> docProfileList = []; List<DoctorProfileList> docProfileList = [];
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service service
.getDoctorsProfile(docObject.doctorID, docObject.clinicID, .getDoctorsProfile(docObject.doctorID, docObject.clinicID,
docObject.projectID, context) docObject.projectID, context)
.then((res) { .then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
if (res['DoctorProfileList'].length != 0) { if (res['DoctorProfileList'].length != 0) {
res['DoctorProfileList'].forEach((v) { res['DoctorProfileList'].forEach((v) {
@ -154,7 +157,7 @@ class DoctorView extends StatelessWidget {
} }
}).catchError((err) { }).catchError((err) {
print(err); print(err);
}).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); });
} }
String getDate(String date) { 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/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.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/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:smart_progress_bar/smart_progress_bar.dart';
class MyAppointments extends StatefulWidget { class MyAppointments extends StatefulWidget {
List<AppoitmentAllHistoryResultList> appoList = []; List<AppoitmentAllHistoryResultList> appoList = [];
@ -33,6 +33,7 @@ class _MyAppointmentsState extends State<MyAppointments>
bool isDataLoaded = false; bool isDataLoaded = false;
var sharedPref = new AppSharedPreferences(); var sharedPref = new AppSharedPreferences();
@override @override
void initState() { void initState() {
_tabController = new TabController(length: 3, vsync: this); _tabController = new TabController(length: 3, vsync: this);
@ -77,6 +78,7 @@ class _MyAppointmentsState extends State<MyAppointments>
} }
getPatientAppointmentHistory() { getPatientAppointmentHistory() {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
widget.appoList.clear(); widget.appoList.clear();
widget.bookedAppoList.clear(); widget.bookedAppoList.clear();
@ -85,6 +87,7 @@ class _MyAppointmentsState extends State<MyAppointments>
service.getPatientAppointmentHistory(false, context).then((res) { service.getPatientAppointmentHistory(false, context).then((res) {
print(res['AppoimentAllHistoryResultList'].length); print(res['AppoimentAllHistoryResultList'].length);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
GifLoaderDialogUtils.hideDialog(context);
setState(() { setState(() {
if (res['AppoimentAllHistoryResultList'].length != 0) { if (res['AppoimentAllHistoryResultList'].length != 0) {
res['AppoimentAllHistoryResultList'].forEach((v) { res['AppoimentAllHistoryResultList'].forEach((v) {
@ -100,11 +103,11 @@ class _MyAppointmentsState extends State<MyAppointments>
AppToast.showErrorToast(message: res['ErrorEndUserMessage']); AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
} }
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err); print(err);
AppToast.showErrorToast(message: err); AppToast.showErrorToast(message: err);
Navigator.of(context).pop(); Navigator.of(context).pop();
}).showProgressBar( });
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
} }
bool isConfirmed(AppoitmentAllHistoryResultList appo) { 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/pages/medical/vital_sign/vital_sign_details_screen.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.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/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:smart_progress_bar/smart_progress_bar.dart';
import 'package:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher.dart';
class AppointmentActions extends StatefulWidget { class AppointmentActions extends StatefulWidget {
@ -351,49 +351,49 @@ class _AppointmentActionsState extends State<AppointmentActions> {
cancelAppointment() { cancelAppointment() {
ConfirmDialog.closeAlertDialog(context); ConfirmDialog.closeAlertDialog(context);
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service service.cancelAppointment(widget.appo, context).then((res) {
.cancelAppointment(widget.appo, context) GifLoaderDialogUtils.hideDialog(context);
.then((res) {
print(res); print(res);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: res['ErrorEndUserMessage']); AppToast.showSuccessToast(message: res['ErrorEndUserMessage']);
Navigator.of(context).pop();
} else { } else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']); AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
} }
}) }).catchError((err) {
.catchError((err) { GifLoaderDialogUtils.hideDialog(context);
print(err); print(err);
})
.showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6))
.then((value) {
Navigator.of(context).pop();
}); });
} }
openAppointmentRadiology() { openAppointmentRadiology() {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
FinalRadiology finalRadiology = new FinalRadiology(); FinalRadiology finalRadiology = new FinalRadiology();
service service
.getPatientRadOrders(widget.appo.appointmentNo.toString(), context) .getPatientRadOrders(widget.appo.appointmentNo.toString(), context)
.then((res) { .then((res) {
GifLoaderDialogUtils.hideDialog(context);
print(res['FinalRadiologyList']); print(res['FinalRadiologyList']);
finalRadiology = finalRadiology =
new FinalRadiology.fromJson(res['FinalRadiologyList'][0]); new FinalRadiology.fromJson(res['FinalRadiologyList'][0]);
print(finalRadiology.reportData); print(finalRadiology.reportData);
navigateToRadiologyDetails(finalRadiology); navigateToRadiologyDetails(finalRadiology);
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err); print(err);
AppToast.showErrorToast(message: err); AppToast.showErrorToast(message: err);
}).showProgressBar( });
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
} }
openPrescriptionReport() { openPrescriptionReport() {
GifLoaderDialogUtils.showMyDialog(context);
List<PrescriptionReportEnh> prescriptionReportEnhList = List(); List<PrescriptionReportEnh> prescriptionReportEnhList = List();
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.getPatientPrescriptionReports(widget.appo, context).then((res) { service.getPatientPrescriptionReports(widget.appo, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
res['ListPRM'].forEach((report) { res['ListPRM'].forEach((report) {
prescriptionReportEnhList.add(PrescriptionReportEnh.fromJson(report)); prescriptionReportEnhList.add(PrescriptionReportEnh.fromJson(report));
}); });
@ -405,10 +405,10 @@ class _AppointmentActionsState extends State<AppointmentActions> {
AppToast.showErrorToast(message: "Sorry there is no data"); AppToast.showErrorToast(message: "Sorry there is no data");
} }
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err); print(err);
AppToast.showErrorToast(message: err); AppToast.showErrorToast(message: err);
}).showProgressBar( });
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
} }
Future navigateToMedicinePrescriptionReport( Future navigateToMedicinePrescriptionReport(
@ -463,8 +463,10 @@ class _AppointmentActionsState extends State<AppointmentActions> {
} }
askYourDoc() { askYourDoc() {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.isAllowedToAskDoctor(widget.appo.doctorID, context).then((res) { service.isAllowedToAskDoctor(widget.appo.doctorID, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
print(res['PatientDoctorAppointmentResultList']); print(res['PatientDoctorAppointmentResultList']);
if (res['PatientDoctorAppointmentResultList'].length != 0) { if (res['PatientDoctorAppointmentResultList'].length != 0) {
getCallRequestType(); getCallRequestType();
@ -473,15 +475,17 @@ class _AppointmentActionsState extends State<AppointmentActions> {
message: TranslationBase.of(context).askDocNotAllowed); message: TranslationBase.of(context).askDocNotAllowed);
} }
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err); print(err);
AppToast.showErrorToast(message: err); AppToast.showErrorToast(message: err);
}).showProgressBar( });
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
} }
getCallRequestType() { getCallRequestType() {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.getCallRequestType(context).then((res) { service.getCallRequestType(context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
List<AskDocRequestType> requestData = new List<AskDocRequestType>(); List<AskDocRequestType> requestData = new List<AskDocRequestType>();
res['ListReqTypes'].forEach((element) { res['ListReqTypes'].forEach((element) {
requestData.add(new AskDocRequestType.fromJson(element)); requestData.add(new AskDocRequestType.fromJson(element));
@ -490,9 +494,9 @@ class _AppointmentActionsState extends State<AppointmentActions> {
showAskDocRequestDialog(requestData); showAskDocRequestDialog(requestData);
}); });
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err); print(err);
}).showProgressBar( });
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
} }
showAskDocRequestDialog(List<AskDocRequestType> requestData) { showAskDocRequestDialog(List<AskDocRequestType> requestData) {
@ -525,28 +529,32 @@ class _AppointmentActionsState extends State<AppointmentActions> {
} }
sendAskDocRequest(int requestType) { sendAskDocRequest(int requestType) {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service service
.sendAskDocCallRequest(widget.appo, requestType.toString(), context) .sendAskDocCallRequest(widget.appo, requestType.toString(), context)
.then((res) { .then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: "Request Sent Successfully"); AppToast.showSuccessToast(message: "Request Sent Successfully");
} else { } else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']); AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
} }
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err); print(err);
AppToast.showErrorToast(message: err); AppToast.showErrorToast(message: err);
}).showProgressBar( });
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
} }
confirmAppointment() { confirmAppointment() {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service service
.confirmAppointment(widget.appo.appointmentNo, widget.appo.clinicID, .confirmAppointment(widget.appo.appointmentNo, widget.appo.clinicID,
widget.appo.projectID, widget.appo.isLiveCareAppointment, context) widget.appo.projectID, widget.appo.isLiveCareAppointment, context)
.then((res) { .then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: res['ErrorEndUserMessage']); AppToast.showSuccessToast(message: res['ErrorEndUserMessage']);
Navigator.of(context).pop(); Navigator.of(context).pop();
@ -554,9 +562,9 @@ class _AppointmentActionsState extends State<AppointmentActions> {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']); AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
} }
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err); print(err);
}).showProgressBar( });
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
} }
navigateToInsuranceApprovals(int appoNo) { 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_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.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/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.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/material.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
import 'package:rating_bar/rating_bar.dart'; import 'package:rating_bar/rating_bar.dart';
import 'package:smart_progress_bar/smart_progress_bar.dart';
class ToDo extends StatefulWidget { class ToDo extends StatefulWidget {
PatientShareResponse patientShareResponse; PatientShareResponse patientShareResponse;
@ -106,7 +106,12 @@ class _ToDoState extends State<ToDo> {
TranslationBase.of(context) TranslationBase.of(context)
.liveCareAppo, .liveCareAppo,
style: TextStyle(fontSize: 12.0)) 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)), style: TextStyle(fontSize: 11.0)),
), ),
], ],
@ -464,8 +469,10 @@ class _ToDoState extends State<ToDo> {
} }
getPatientAppointmentHistory() { getPatientAppointmentHistory() {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.getPatientAppointmentHistory(true, context).then((res) { service.getPatientAppointmentHistory(true, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
setState(() { setState(() {
if (res['AppoimentAllHistoryResultList'].length != 0) { if (res['AppoimentAllHistoryResultList'].length != 0) {
@ -485,26 +492,29 @@ class _ToDoState extends State<ToDo> {
} }
}).catchError((err) { }).catchError((err) {
print(err); print(err);
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err); AppToast.showErrorToast(message: err);
}).showProgressBar( });
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
} }
getPatientShare(context, AppoitmentAllHistoryResultList appo) { getPatientShare(context, AppoitmentAllHistoryResultList appo) {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service service
.getPatientShare(appo.appointmentNo.toString(), appo.clinicID, .getPatientShare(appo.appointmentNo.toString(), appo.clinicID,
appo.projectID, context) appo.projectID, context)
.then((res) { .then((res) {
GifLoaderDialogUtils.hideDialog(context);
widget.patientShareResponse = new PatientShareResponse.fromJson(res); widget.patientShareResponse = new PatientShareResponse.fromJson(res);
openPaymentDialog(appo, widget.patientShareResponse); openPaymentDialog(appo, widget.patientShareResponse);
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err); print(err);
}).showProgressBar( });
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
} }
getAppoQR(context, AppoitmentAllHistoryResultList appo) { getAppoQR(context, AppoitmentAllHistoryResultList appo) {
GifLoaderDialogUtils.showMyDialog(context);
PatientShareResponse patientShareResponse = new PatientShareResponse(); PatientShareResponse patientShareResponse = new PatientShareResponse();
patientShareResponse.doctorNameObj = appo.doctorNameObj; patientShareResponse.doctorNameObj = appo.doctorNameObj;
@ -518,12 +528,13 @@ class _ToDoState extends State<ToDo> {
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.generateAppointmentQR(patientShareResponse, context).then((res) { service.generateAppointmentQR(patientShareResponse, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
print(res); print(res);
navigateToQR(context, res['AppointmentQR'], patientShareResponse); navigateToQR(context, res['AppointmentQR'], patientShareResponse);
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err); print(err);
}).showProgressBar( });
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
} }
Future navigateToQR( Future navigateToQR(
@ -620,6 +631,7 @@ class _ToDoState extends State<ToDo> {
} }
checkPaymentStatus(AppoitmentAllHistoryResultList appo) { checkPaymentStatus(AppoitmentAllHistoryResultList appo) {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service service
.checkPaymentStatus( .checkPaymentStatus(
@ -627,8 +639,7 @@ class _ToDoState extends State<ToDo> {
appo.projectID, appo.clinicID, appo.appointmentNo), appo.projectID, appo.clinicID, appo.appointmentNo),
context) context)
.then((res) { .then((res) {
print("Printing Payment Status Reponse!!!!"); GifLoaderDialogUtils.hideDialog(context);
print(res);
String paymentInfo = res['Response_Message']; String paymentInfo = res['Response_Message'];
if (paymentInfo == 'Success') { if (paymentInfo == 'Success') {
createAdvancePayment(res, appo); createAdvancePayment(res, appo);
@ -636,18 +647,20 @@ class _ToDoState extends State<ToDo> {
AppToast.showErrorToast(message: res['Response_Message']); AppToast.showErrorToast(message: res['Response_Message']);
} }
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err); print(err);
}).showProgressBar( });
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
} }
createAdvancePayment(res, AppoitmentAllHistoryResultList appo) { createAdvancePayment(res, AppoitmentAllHistoryResultList appo) {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
String paymentReference = res['Fort_id'].toString(); String paymentReference = res['Fort_id'].toString();
service service
.createAdvancePayment( .createAdvancePayment(
appo, res['Amount'], res['Fort_id'], res['PaymentMethod'], context) appo, res['Amount'], res['Fort_id'], res['PaymentMethod'], context)
.then((res) { .then((res) {
GifLoaderDialogUtils.hideDialog(context);
print(res['OnlineCheckInAppointments'][0]['AdvanceNumber']); print(res['OnlineCheckInAppointments'][0]['AdvanceNumber']);
addAdvancedNumberRequest( addAdvancedNumberRequest(
res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(),
@ -656,23 +669,25 @@ class _ToDoState extends State<ToDo> {
appo); appo);
}).catchError((err) { }).catchError((err) {
print(err); print(err);
}).showProgressBar( GifLoaderDialogUtils.hideDialog(context);
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); });
} }
addAdvancedNumberRequest(String advanceNumber, String paymentReference, addAdvancedNumberRequest(String advanceNumber, String paymentReference,
String appointmentID, AppoitmentAllHistoryResultList appo) { String appointmentID, AppoitmentAllHistoryResultList appo) {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service service
.addAdvancedNumberRequest( .addAdvancedNumberRequest(
advanceNumber, paymentReference, appointmentID, context) advanceNumber, paymentReference, appointmentID, context)
.then((res) { .then((res) {
GifLoaderDialogUtils.hideDialog(context);
print(res); print(res);
getAppoQR(context, appo); getAppoQR(context, appo);
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err); print(err);
}).showProgressBar( });
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
} }
Future navigateToPaymentMethod( Future navigateToPaymentMethod(
@ -705,51 +720,46 @@ class _ToDoState extends State<ToDo> {
} }
confirmAppointment(AppoitmentAllHistoryResultList appo) { confirmAppointment(AppoitmentAllHistoryResultList appo) {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service service
.confirmAppointment(appo.appointmentNo, appo.clinicID, appo.projectID, .confirmAppointment(appo.appointmentNo, appo.clinicID, appo.projectID,
appo.isLiveCareAppointment, context) appo.isLiveCareAppointment, context)
.then((res) { .then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: res['ErrorEndUserMessage']); 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) { if (appo.isLiveCareAppointment) {
insertLiveCareVIDARequest(appo); insertLiveCareVIDARequest(appo);
} else { } else {
getPatientAppointmentHistory(); getPatientAppointmentHistory();
} }
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
}); });
} }
insertLiveCareVIDARequest(AppoitmentAllHistoryResultList appo) { insertLiveCareVIDARequest(AppoitmentAllHistoryResultList appo) {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service service
.insertVIDARequest(appo.appointmentNo, appo.clinicID, appo.projectID, .insertVIDARequest(appo.appointmentNo, appo.clinicID, appo.projectID,
appo.serviceID, appo.doctorID, context) appo.serviceID, appo.doctorID, context)
.then((res) { .then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: res['ErrorEndUserMessage']); AppToast.showSuccessToast(message: res['ErrorEndUserMessage']);
getPatientAppointmentHistory();
} else { } else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']); AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
} }
}) }).catchError((err) {
.catchError((err) {
print(err); print(err);
}) GifLoaderDialogUtils.hideDialog(context);
.showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6))
.then((value) {
getPatientAppointmentHistory();
}); });
} }
} }

@ -731,6 +731,8 @@ class TranslationBase {
String get book => localizedValues['Book'][locale.languageCode]; String get book => localizedValues['Book'][locale.languageCode];
String get appointmentLabel => localizedValues['AppointmentLabel'][locale.languageCode]; String get appointmentLabel => localizedValues['AppointmentLabel'][locale.languageCode];
String get bloodType => localizedValues['BloodType'][locale.languageCode]; String get bloodType => localizedValues['BloodType'][locale.languageCode];
String get loginToUseService => localizedValues['loginToUseService'][locale.languageCode];
} }
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> { class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

Loading…
Cancel
Save