My Appointments implemented, Appointment Details functionality updated, Logged In User details added in APIs & other updates

merge-requests/34/merge
haroon amjad 4 years ago
parent 1c3e088515
commit 28fde5c500

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

@ -5,7 +5,7 @@ import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
const MAX_SMALL_SCREEN = 660;
const BASE_URL = 'https://uat.hmgwebservices.com/Services';
const BASE_URL = 'https://hmgwebservices.com/Services';
const GET_PROJECT = '/Lists.svc/REST/GetProject';
@ -55,6 +55,12 @@ const CONFIRM_APPOINTMENT = "/MobileNotifications.svc/REST/ConfirmAppointment";
//URL to cancel appointment
const CANCEL_APPOINTMENT = "/Doctors.svc/REST/CancelAppointment";
//URL get appointment QR
const GENERATE_QR_APPOINTMENT = "/Doctors.svc/REST/GenerateQRAppointmentNo";
//URL send email appointment QR
const EMAIL_QR_APPOINTMENT = "/Notifications.svc/REST/sendEmailForOnLineCheckin";
//URL to get medicine and pharmacies list
const CHANNEL = 3;
const GENERAL_ID = 'Cs2020@2016\$2958';

@ -166,4 +166,20 @@ const Map<String, Map<String, String>> localizedValues = {
"patientTaxToDo": {"en": "Tax amount: ", "ar": "قيمة الضريبة:"},
"patientShareTotalToDo": {"en": "Total amount Due: ", "ar": "المبلغ الإجمالي المستحق:"},
'paymentMethod': {'en': 'Payment Method', 'ar': 'طريقة الدفع او السداد'},
'noNeedToWaitInLine': {'en': 'No need to stand in line.', 'ar': 'لا داعي للوقوف في الطابور.'},
'useQRAppoAttend': {'en': 'Use the QR code to register the appointment attendance.', 'ar': 'استخدم الكود لتسجيل الحضور في المستشفى.'},
'passQRAppoAttend': {'en': 'Pass the QR code through the attendance devices available in the Hospital.', 'ar': 'تمرير الكود من خلال اجهزة تسجيل الحضور المتوفرة في الفرع.'},
'sitWaitingQR': {'en': 'Sit in the waiting rooms until called by the nurse.', 'ar': 'الجلوس في غرف الانتظار لحين منادتك من قبل الممرضة.'},
'attendRegisterCode': {'en': 'Attendance registration code', 'ar': 'رمز تسجيل الحضور'},
'scanQRHospital': {'en': 'Scan above QR Code to Check-In on the Machine in Hospital', 'ar': 'مسح فوق رمز الاستجابة السريعة للتحقق في الجهاز في المستشفى'},
"sendEmail": {"en": "Send Email", "ar": "ارسال نسخة"},
"close": {"en": "Close", "ar": "مغلق"},
"booked": {"en": "Booked", "ar": "محجوز"},
"confirmed": {"en": "Confirmed", "ar": "مؤكد"},
"arrived": {"en": "Arrived", "ar": "تم الحضور"},
"payNowBookSuccess": {"en": "Pay now via Al Habib App", "ar": "ادفع الآن عبر تطبيق الحبيب"},
"payNowBookSuccesstext1": {"en": "Pay Now using online payment service From secure payment gateways", "ar": "ادفع الآن باستخدام خدمة الدفع عبر الإنترنت من بوابات الدفع الآمنة"},
"payNowBookSuccesstext2": {"en": "You can also Pay Later via online payment Or in Hospital", "ar": "يمكنك أيضًا الدفع لاحقًا عبر الدفع عبر الإنترنت أو في المستشفى"},
'payLater': {'en': 'Pay Later', 'ar': 'ادفع لاحقا'},
};

@ -1,7 +1,10 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.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/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
@ -28,6 +31,8 @@ class BookConfirm extends StatefulWidget {
DoctorsListService service;
PatientShareResponse patientShareResponse;
AuthenticatedUser authUser;
@override
_BookConfirmState createState() => _BookConfirmState();
@ -36,6 +41,8 @@ class BookConfirm extends StatefulWidget {
class _BookConfirmState extends State<BookConfirm> {
@override
void initState() {
widget.authUser = new AuthenticatedUser();
getPatientData();
widget.service = new DoctorsListService();
widget.patientShareResponse = new PatientShareResponse();
super.initState();
@ -296,14 +303,14 @@ class _BookConfirmState extends State<BookConfirm> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text("TAMER FANASHEH",
Text(widget.authUser.firstName + " " + widget.authUser.lastName,
style: TextStyle(
fontSize: 14.0,
color: Colors.grey[900],
letterSpacing: 1.0)),
Container(
margin: EdgeInsets.only(top: 5.0),
child: Text("Gender: Male",
child: Text("Gender: " + widget.authUser.genderDescription,
style: TextStyle(
fontSize: 12.0,
color: Colors.grey[600],
@ -311,7 +318,7 @@ class _BookConfirmState extends State<BookConfirm> {
),
Container(
margin: EdgeInsets.only(top: 5.0, bottom: 3.0),
child: Text("Age: 33",
child: Text("Age: " + widget.authUser.age.toString(),
style: TextStyle(
fontSize: 12.0,
color: Colors.grey[600],
@ -356,10 +363,10 @@ class _BookConfirmState extends State<BookConfirm> {
);
}
cancelAppointment(DoctorList docObject, AppoitmentAllHistoryResultList appo) {
cancelAppointment(DoctorList docObject, AppoitmentAllHistoryResultList appo, BuildContext context) {
ConfirmDialog.closeAlertDialog(context);
DoctorsListService service = new DoctorsListService();
service.cancelAppointment(appo).then((res) {
service.cancelAppointment(appo, context).then((res) {
if (res['MessageStatus'] == 1) {
insertAppointment(context, docObject);
} else {
@ -374,7 +381,7 @@ class _BookConfirmState extends State<BookConfirm> {
AppoitmentAllHistoryResultList appo;
widget.service
.insertAppointment(docObject.doctorID, docObject.clinicID,
docObject.projectID, widget.selectedTime, widget.selectedDate)
docObject.projectID, widget.selectedTime, widget.selectedDate, context)
.then((res) {
if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: "Appointment Booked Successfully");
@ -399,7 +406,7 @@ class _BookConfirmState extends State<BookConfirm> {
confirmMessage: res['ErrorEndUserMessage'],
okText: TranslationBase.of(context).confirm,
cancelText: TranslationBase.of(context).cancel_nocaps,
okFunction: () => {cancelAppointment(docObject, appo)},
okFunction: () => {cancelAppointment(docObject, appo, context)},
cancelFunction: () => {});
dialog.showAlertDialog(context);
}
@ -411,7 +418,7 @@ class _BookConfirmState extends State<BookConfirm> {
getPatientShare(context, String appointmentNo, int clinicID, int projectID,
DoctorList docObject) {
widget.service
.getPatientShare(appointmentNo, clinicID, projectID)
.getPatientShare(appointmentNo, clinicID, projectID, context)
.then((res) {
print(res);
widget.patientShareResponse = new PatientShareResponse.fromJson(res);
@ -461,6 +468,18 @@ class _BookConfirmState extends State<BookConfirm> {
return docSpeciality;
}
getPatientData() async {
AppSharedPreferences sharedPref = AppSharedPreferences();
if (await sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(
await sharedPref.getObject(USER_PROFILE));
setState(() {
print(data);
widget.authUser = data;
});
}
}
Future navigateToBookSuccess(context, DoctorList docObject,
PatientShareResponse patientShareResponse) async {
print(widget.appoDateFormatted);

@ -1,8 +1,12 @@
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart';
import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/material.dart';
import 'QRCode.dart';
class BookSuccess extends StatefulWidget {
PatientShareResponse patientShareResponse;
DoctorList docObject;
@ -21,6 +25,12 @@ class BookSuccess extends StatefulWidget {
}
class _BookSuccessState extends State<BookSuccess> {
@override
void initState() {
// TODO: implement initState
super.initState();
}
@override
Widget build(BuildContext context) {
return Scaffold(
@ -140,125 +150,392 @@ class _BookSuccessState extends State<BookSuccess> {
],
),
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Container(
margin: EdgeInsets.only(top: 30.0, bottom: 40.0),
alignment: Alignment.center,
child: Text(TranslationBase.of(context).confirmAppo,
style: TextStyle(fontSize: 18.0, letterSpacing: 0.8)),
getNextActionWidget(),
],
),
),
);
}
Widget getNextActionWidget() {
switch (widget.patientShareResponse.nextAction) {
case 0:
return Container();
break;
case 10:
return _getConfirmAppo();
break;
case 15:
return _getPaymentPendingAppo();
break;
case 20:
return _getPayNowAppo();
break;
case 30:
return _getQRAppo();
break;
}
}
String getNextAction() {
switch (widget.patientShareResponse.nextAction) {
case 0:
return 'No Action';
break;
case 10:
return 'Confirm';
break;
case 15:
return 'Payment Pending';
break;
case 20:
return 'Pay Now';
break;
case 30:
return 'QR Code';
break;
}
}
Widget _getConfirmAppo() {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Container(
margin: EdgeInsets.only(top: 30.0, bottom: 40.0),
alignment: Alignment.center,
child: Text(TranslationBase.of(context).confirmAppo,
style: TextStyle(fontSize: 18.0, letterSpacing: 0.8)),
),
Flex(
direction: Axis.horizontal,
children: <Widget>[
Expanded(
child: Container(
padding: EdgeInsets.only(left: 10.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
_getBulletPoint("1"),
Container(
child: Text(
"Please confirm the appointment to avoid the cancellation",
overflow: TextOverflow.fade,
style: TextStyle(fontSize: 13.0)),
),
],
),
Flex(
direction: Axis.horizontal,
),
),
],
),
Flex(
direction: Axis.horizontal,
children: <Widget>[
Expanded(
child: Container(
padding: EdgeInsets.only(top: 20.0, left: 10.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Expanded(
child: Container(
padding: EdgeInsets.only(left: 10.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
_getBulletPoint("1"),
Container(
child: Text(
"Please confirm the appointment to avoid the cancellation",
overflow: TextOverflow.fade,
style: TextStyle(fontSize: 13.0)),
),
],
),
),
_getBulletPoint("2"),
Container(
width: MediaQuery.of(context).size.width * 0.8,
child: Text(
"The online payment process will be available 24 hours before the appointment.",
overflow: TextOverflow.clip,
style: TextStyle(fontSize: 13.0)),
),
],
),
Flex(
direction: Axis.horizontal,
),
),
],
),
Container(
margin: EdgeInsets.fromLTRB(50.0, 20.0, 50.0, 20.0),
child: Image.asset("assets/images/new-design/payment-method.png"),
),
Container(
alignment: Alignment.bottomCenter,
height: MediaQuery.of(context).size.height * 0.32,
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
minWidth: MediaQuery.of(context).size.width * 0.7,
height: 45.0,
child: RaisedButton(
color: new Color(0xFF60686b),
textColor: Colors.white,
disabledTextColor: Colors.white,
disabledColor: new Color(0xFFbcc2c4),
onPressed: () {},
child: Text(TranslationBase.of(context).confirm.toUpperCase(),
style: TextStyle(fontSize: 18.0)),
),
),
ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
minWidth: MediaQuery.of(context).size.width * 0.7,
height: 45.0,
child: RaisedButton(
color: new Color(0xFFc5272d),
textColor: Colors.white,
disabledTextColor: Colors.white,
disabledColor: new Color(0xFFbcc2c4),
onPressed: () {
navigateToHome(context);
},
child: Text(
TranslationBase.of(context).confirmLater.toUpperCase(),
style: TextStyle(fontSize: 18.0)),
),
),
],
),
),
],
);
}
Widget _getPaymentPendingAppo() {
return Container();
}
Widget _getPayNowAppo() {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Container(
margin: EdgeInsets.only(top: 20.0, bottom: 0.0),
alignment: Alignment.center,
child: Text(TranslationBase.of(context).payNowBookSuccess,
style: TextStyle(fontSize: 20.0, letterSpacing: 0.8, fontWeight: FontWeight.bold)),
),
Container(
alignment: Alignment.center,
child: Image.asset("assets/images/new-design/no-wait-queue.png", width: 120.0,
height: 120.0),
),
Flex(
direction: Axis.horizontal,
children: <Widget>[
Expanded(
child: Container(
padding: EdgeInsets.only(left: 10.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Expanded(
child: Container(
padding: EdgeInsets.only(top: 20.0, left: 10.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
_getBulletPoint("2"),
Container(
width: MediaQuery.of(context).size.width * 0.8,
child: Text(
"The online payment process will be available 24 hours before the appointment.",
overflow: TextOverflow.clip,
style: TextStyle(fontSize: 13.0)),
),
],
),
),
_getBulletPoint("1"),
Container(
width: MediaQuery.of(context).size.width * 0.8,
child: Text(
TranslationBase.of(context).payNowBookSuccesstext1,
overflow: TextOverflow.fade,
style: TextStyle(fontSize: 13.0)),
),
],
),
),
),
],
),
Container(
margin: EdgeInsets.fromLTRB(50.0, 20.0, 50.0, 20.0),
child: Image.asset("assets/images/new-design/payment-method.png"),
),
Flex(
direction: Axis.horizontal,
children: <Widget>[
Expanded(
child: Container(
padding: EdgeInsets.only(top: 0.0, left: 10.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
_getBulletPoint("2"),
Container(
width: MediaQuery.of(context).size.width * 0.8,
child: Text(
TranslationBase.of(context).payNowBookSuccesstext2,
overflow: TextOverflow.clip,
style: TextStyle(fontSize: 13.0)),
),
],
),
Container(
margin: EdgeInsets.fromLTRB(50.0, 20.0, 50.0, 20.0),
child: Image.asset(
"assets/images/new-design/payment-method.png"),
),
),
],
),
Container(
alignment: Alignment.bottomCenter,
height: MediaQuery.of(context).size.height * 0.2,
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
Container(
alignment: Alignment.bottomCenter,
height: MediaQuery.of(context).size.height * 0.32,
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
minWidth: MediaQuery.of(context).size.width * 0.7,
height: 45.0,
child: RaisedButton(
color: new Color(0xFF60686b),
textColor: Colors.white,
disabledTextColor: Colors.white,
disabledColor: new Color(0xFFbcc2c4),
onPressed: () {},
child: Text(
TranslationBase.of(context).confirm.toUpperCase(),
style: TextStyle(fontSize: 18.0)),
),
minWidth: MediaQuery.of(context).size.width * 0.7,
height: 45.0,
child: RaisedButton(
color: new Color(0xFF60686b),
textColor: Colors.white,
disabledTextColor: Colors.white,
disabledColor: new Color(0xFFbcc2c4),
onPressed: () {},
child: Text(TranslationBase.of(context).payNow.toUpperCase(),
style: TextStyle(fontSize: 18.0)),
),
),
ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
minWidth: MediaQuery.of(context).size.width * 0.7,
height: 45.0,
child: RaisedButton(
color: new Color(0xFFc5272d),
textColor: Colors.white,
disabledTextColor: Colors.white,
disabledColor: new Color(0xFFbcc2c4),
onPressed: () {
navigateToHome(context);
},
child: Text(
TranslationBase.of(context).payLater.toUpperCase(),
style: TextStyle(fontSize: 18.0)),
),
),
],
),
),
],
);
}
Widget _getQRAppo() {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Container(
margin: EdgeInsets.only(top: 30.0, bottom: 40.0),
alignment: Alignment.center,
child: Text(TranslationBase.of(context).noNeedToWaitInLine,
style: TextStyle(fontSize: 18.0, letterSpacing: 0.8)),
),
Container(
alignment: Alignment.center,
child: Image.asset("assets/images/new-design/device_icon.png", width: 120.0,
height: 120.0),
),
Flex(
direction: Axis.horizontal,
children: <Widget>[
Expanded(
child: Container(
padding: EdgeInsets.only(left: 10.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Container(
margin: EdgeInsets.only(top: 15.0),
child: Row(
children: <Widget>[
_getBulletPoint("1"),
Container(
width: MediaQuery.of(context).size.width * 0.8,
child: Text(
TranslationBase.of(context).useQRAppoAttend,
overflow: TextOverflow.fade,
style: TextStyle(fontSize: 13.0)),
),
],
),
ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
minWidth: MediaQuery.of(context).size.width * 0.7,
height: 45.0,
child: RaisedButton(
color: new Color(0xFFc5272d),
textColor: Colors.white,
disabledTextColor: Colors.white,
disabledColor: new Color(0xFFbcc2c4),
onPressed: () {
navigateToHome(context);
},
child: Text(
TranslationBase.of(context)
.confirmLater
.toUpperCase(),
style: TextStyle(fontSize: 18.0)),
),
),
Container(
margin: EdgeInsets.only(top: 15.0),
child: Row(
children: <Widget>[
_getBulletPoint("2"),
Container(
width: MediaQuery.of(context).size.width * 0.8,
child: Text(
TranslationBase.of(context).passQRAppoAttend,
overflow: TextOverflow.fade,
style: TextStyle(fontSize: 13.0)),
),
],
),
],
),
),
Container(
margin: EdgeInsets.only(top: 15.0),
child: Row(
children: <Widget>[
_getBulletPoint("3"),
Container(
width: MediaQuery.of(context).size.width * 0.8,
child: Text(
TranslationBase.of(context).sitWaitingQR,
overflow: TextOverflow.fade,
style: TextStyle(fontSize: 13.0)),
),
],
),
),
],
),
],
),
),
],
),
),
Container(
alignment: Alignment.bottomCenter,
height: MediaQuery.of(context).size.height * 0.18,
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
minWidth: MediaQuery.of(context).size.width * 0.7,
height: 45.0,
child: RaisedButton(
color: new Color(0xFF60686b),
textColor: Colors.white,
disabledTextColor: Colors.white,
disabledColor: new Color(0xFFbcc2c4),
onPressed: () {
// navigateToQR(context);
getAppoQR(context);
},
child: Text(TranslationBase.of(context).viewQR.toUpperCase(),
style: TextStyle(fontSize: 18.0)),
),
),
],
),
),
],
);
}
_getTextStyling() {
return TextStyle(fontSize: 14.0, color: Colors.white, letterSpacing: 0.7);
}
@ -292,7 +569,29 @@ class _BookSuccessState extends State<BookSuccess> {
}
Future navigateToHome(context) async {
Navigator.popUntil(context, ModalRoute.withName('/'));
Navigator.of(context).pushNamed(HOME);
}
getAppoQR(context) {
DoctorsListService service = new DoctorsListService();
service
.generateAppointmentQR(widget.patientShareResponse, context)
.then((res) {
print(res);
navigateToQR(context, res['AppointmentQR']);
}).catchError((err) {
print(err);
});
}
Future navigateToQR(context, String appoQR) async {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => QRCode(
patientShareResponse: widget.patientShareResponse,
appoQR: appoQR,
)));
}
_getNormalText(text) {

@ -0,0 +1,297 @@
import 'dart:convert';
import 'dart:typed_data';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/routes.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/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
class QRCode extends StatefulWidget {
PatientShareResponse patientShareResponse;
String appoQR;
AuthenticatedUser authUser;
AppSharedPreferences sharedPref = AppSharedPreferences();
QRCode({@required this.patientShareResponse, @required this.appoQR});
@override
_QRCodeState createState() => _QRCodeState();
}
class _QRCodeState extends State<QRCode> {
Uint8List _bytes;
@override
void initState() {
// TODO: implement initState
_bytes = base64.decode(widget.appoQR.split(',').last);
widget.authUser = new AuthenticatedUser();
super.initState();
}
@override
Widget build(BuildContext context) {
return AppScaffold(
appBarTitle: TranslationBase.of(context).attendRegisterCode,
isShowAppBar: true,
body: SingleChildScrollView(
child: Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Container(
margin: EdgeInsets.only(top: 30.0),
alignment: Alignment.center,
child: Image.memory(_bytes, scale: 0.5),
),
Container(
margin: EdgeInsets.only(top: 20.0, left: 20.0, right: 20.0),
child: Divider(
color: Colors.red[700],
thickness: 0.8,
),
),
Container(
child: Row(
children: <Widget>[
Container(
margin:
EdgeInsets.only(top: 10.0, left: 40.0, bottom: 10.0),
child: Image.asset(
"assets/images/new-design/device_icon.png",
width: 120.0,
height: 120.0),
),
Container(
width: MediaQuery.of(context).size.width * 0.5,
margin: EdgeInsets.only(
top: 15.0, bottom: 10.0, left: 20.0, right: 20.0),
child: Text(TranslationBase.of(context).scanQRHospital,
style: TextStyle(
color: Colors.red[700],
fontSize: 20.0,
fontWeight: FontWeight.bold)),
),
],
),
),
Container(
margin: EdgeInsets.only(top: 10.0, left: 20.0, right: 20.0),
child: Divider(
color: Colors.red[700],
thickness: 0.8,
),
),
Container(
margin: EdgeInsets.only(
top: 15.0, bottom: 10.0, left: 20.0, right: 20.0),
child: Text(TranslationBase.of(context).appoInfo,
style: TextStyle(
fontSize: 18.0,
color: Colors.grey[700],
fontWeight: FontWeight.bold)),
),
Container(
margin: EdgeInsets.only(left: 20.0, bottom: 20.0),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
color: Colors.grey[200],
boxShadow: [
BoxShadow(color: Colors.grey, spreadRadius: 2),
],
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
margin: EdgeInsets.only(
top: 15.0, bottom: 10.0, left: 20.0, right: 20.0),
child: Text(widget.patientShareResponse.doctorNameObj,
style: TextStyle(
fontSize: 18.0,
color: Colors.grey[700],
fontWeight: FontWeight.bold)),
),
Container(
margin: EdgeInsets.only(
bottom: 10.0, left: 20.0, right: 20.0),
child: Text(
getDoctorSpeciality(
widget.patientShareResponse.doctorSpeciality),
style: TextStyle(
fontSize: 18.0, color: Colors.grey[700])),
),
Container(
margin: EdgeInsets.only(
top: 0.0, bottom: 10.0, left: 20.0, right: 20.0),
child: Text(widget.patientShareResponse.projectName,
style: TextStyle(
fontSize: 18.0, color: Colors.grey[700])),
),
Container(
margin: EdgeInsets.only(
top: 0.0, bottom: 10.0, left: 20.0, right: 20.0),
child: Text(
getDate(widget.patientShareResponse.appointmentDate),
style: TextStyle(
fontSize: 18.0, color: Colors.grey[700])),
),
],
),
),
Container(
alignment: Alignment.bottomCenter,
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
minWidth: MediaQuery.of(context).size.width * 0.7,
height: 45.0,
child: RaisedButton(
color: new Color(0xFF60686b),
textColor: Colors.white,
disabledTextColor: Colors.white,
disabledColor: new Color(0xFFbcc2c4),
onPressed: () {
// navigateToQR(context);
// getAppoQR(context);
sendEmail();
},
child: Text(
TranslationBase.of(context).sendEmail.toUpperCase(),
style: TextStyle(fontSize: 18.0)),
),
),
],
),
),
Container(
alignment: Alignment.bottomCenter,
height: MediaQuery.of(context).size.height * 0.1,
margin: EdgeInsets.only(bottom: 20.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
minWidth: MediaQuery.of(context).size.width * 0.7,
height: 45.0,
child: RaisedButton(
color: new Color(0xFF60686b),
textColor: Colors.white,
disabledTextColor: Colors.white,
disabledColor: new Color(0xFFbcc2c4),
onPressed: () {
navigateToHome(context);
},
child: Text(
TranslationBase.of(context).close.toUpperCase(),
style: TextStyle(fontSize: 18.0)),
),
),
],
),
),
],
),
),
),
);
}
sendEmail() async {
DoctorsListService service = new DoctorsListService();
if (await widget.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(
await widget.sharedPref.getObject(USER_PROFILE));
setState(() {
widget.authUser = data;
});
}
ConfirmDialog dialog = new ConfirmDialog(
context: context,
confirmMessage: "Send a copy of this QR to the email " +
widget.authUser.emailAddress +
"?",
okText: TranslationBase.of(context).confirm,
cancelText: TranslationBase.of(context).cancel_nocaps,
okFunction: () {
service
.sendAppointmentQREmail(
widget.authUser.emailAddress,
widget.patientShareResponse.appointmentDate,
widget.patientShareResponse.appointmentNo.toString(),
widget.patientShareResponse.doctorNameObj,
widget.patientShareResponse.projectName,
widget.appoQR,
getDoctorSpeciality(
widget.patientShareResponse.doctorSpeciality),
context)
.then((res) {
print(res);
ConfirmDialog.closeAlertDialog(context);
}).catchError((err) {
ConfirmDialog.closeAlertDialog(context);
AppToast.showErrorToast(message: err);
print(err);
});
},
cancelFunction: () => {});
dialog.showAlertDialog(context);
}
Future navigateToHome(context) async {
Navigator.of(context).pushNamed(HOME);
}
getPatientShare(context, String appointmentNo, int clinicID, int projectID,
DoctorList docObject) {}
String getDate(String appoDate) {
var appoDateFormatted = "";
var dateObj = DateUtil.convertStringToDate(appoDate);
setState(() {
appoDateFormatted = DateUtil.getWeekDay(dateObj.weekday) +
", " +
dateObj.day.toString() +
" " +
DateUtil.getMonth(dateObj.month) +
" " +
dateObj.year.toString() +
", " +
dateObj.hour.toString() +
":" +
dateObj.minute.toString() +
":00";
});
return appoDateFormatted;
}
String getDoctorSpeciality(List<String> docSpecial) {
String docSpeciality = "";
docSpecial.forEach((v) {
docSpeciality = docSpeciality + v + "\n";
});
return docSpeciality;
}
}

@ -30,7 +30,8 @@ class _SearchState extends State<Search> with SingleTickerProviderStateMixin {
],
controller: _tabController,
),
title: Text(TranslationBase.of(context).bookAppo),
title: Text(TranslationBase.of(context).bookAppo,
style: TextStyle(color: Colors.white)),
),
body: TabBarView(
physics: NeverScrollableScrollPhysics(),

@ -55,7 +55,8 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments>
_selectedDay: ['Event A0']
};
getDoctorFreeSlots(context, widget.doctor);
WidgetsBinding.instance
.addPostFrameCallback((_) => getDoctorFreeSlots(context, widget.doctor));
_calendarController = CalendarController();
_animationController = AnimationController(
@ -322,7 +323,7 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments>
DoctorsListService service = new DoctorsListService();
service
.getDoctorFreeSlots(
docObject.doctorID, docObject.clinicID, docObject.projectID)
docObject.doctorID, docObject.clinicID, docObject.projectID, context)
.then((res) {
if (res['MessageStatus'] == 1) {
if (res['FreeTimeSlots'].length != 0) {

@ -20,8 +20,8 @@ class _SearchByClinicState extends State<SearchByClinic> {
@override
void initState() {
// TODO: implement initState
getClinicsList();
WidgetsBinding.instance
.addPostFrameCallback((_) => getClinicsList());
super.initState();
}
@ -74,7 +74,7 @@ class _SearchByClinicState extends State<SearchByClinic> {
setState(() {
dropdownValue = newValue;
print(dropdownValue);
getDoctorsList();
getDoctorsList(context);
});
},
),
@ -86,7 +86,7 @@ class _SearchByClinicState extends State<SearchByClinic> {
getClinicsList() {
ClinicListService service = new ClinicListService();
service.getClinicsList().then((res) {
service.getClinicsList(context).then((res) {
if (res['MessageStatus'] == 1) {
setState(() {
res['ListClinicCentralized'].forEach((v) {
@ -99,10 +99,10 @@ class _SearchByClinicState extends State<SearchByClinic> {
});
}
getDoctorsList() {
getDoctorsList(BuildContext context) {
List<DoctorList> doctorsList = [];
DoctorsListService service = new DoctorsListService();
service.getDoctorsList(int.parse(dropdownValue), 0).then((res) {
service.getDoctorsList(int.parse(dropdownValue), 0, context).then((res) {
if (res['MessageStatus'] == 1) {
setState(() {
if (res['DoctorList'].length != 0) {

@ -69,17 +69,17 @@ class _SearchByDoctorState extends State<SearchByDoctor> {
textColor: Colors.white,
disabledTextColor: Colors.white,
disabledColor: new Color(0xFFbcc2c4),
onPressed: _isButtonDisabled ? null : _searchDoctor,
onPressed: _isButtonDisabled ? null : _searchDoctor(context),
child: Text(TranslationBase.of(context).search,
style: TextStyle(fontSize: 18.0)),
),
);
}
getDoctorsList() {
getDoctorsList(BuildContext context) {
List<DoctorList> doctorsList = [];
DoctorsListService service = new DoctorsListService();
service.getDoctorsListByName(doctorNameController.text).then((res) {
service.getDoctorsListByName(doctorNameController.text, context).then((res) {
if (res['MessageStatus'] == 1) {
setState(() {
if(res['DoctorList'].length != 0) {
@ -111,8 +111,8 @@ class _SearchByDoctorState extends State<SearchByDoctor> {
print(_isButtonDisabled);
}
void _searchDoctor() {
getDoctorsList();
_searchDoctor(BuildContext context) {
getDoctorsList(context);
}
Future navigateToSearchResults(context, List<DoctorList> docList) async {

@ -16,7 +16,6 @@ class DoctorView extends StatelessWidget {
Widget build(BuildContext context) {
return InkWell(
onTap: () {
// navigateToDoctorProfile(context);
getDoctorsProfile(context, doctor);
},
child: Card(
@ -117,7 +116,7 @@ class DoctorView extends StatelessWidget {
DoctorsListService service = new DoctorsListService();
service
.getDoctorsProfile(
docObject.doctorID, docObject.clinicID, docObject.projectID)
docObject.doctorID, docObject.clinicID, docObject.projectID, context)
.then((res) {
if (res['MessageStatus'] == 1) {
if (res['DoctorProfileList'].length != 0) {

@ -165,7 +165,7 @@ class _AppointmentDetailsState extends State<AppointmentDetails>
),
),
Container(
height: MediaQuery.of(context).size.height * 0.8,
height: MediaQuery.of(context).size.height * 0.87,
child: TabBarView(
physics: NeverScrollableScrollPhysics(),
children: [
@ -213,6 +213,7 @@ class _AppointmentDetailsState extends State<AppointmentDetails>
docObj.actualDoctorRate = widget.appo.actualDoctorRate;
docObj.projectName = widget.appo.projectName;
docObj.originalClinicID = widget.appo.originalClinicID;
docObj.doctorImageURL = widget.appo.doctorImageURL;
return docObj;
}
}

@ -0,0 +1,243 @@
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/models/AppointmentType.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/AppointmentCardView.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
class MyAppointments extends StatefulWidget {
List<AppoitmentAllHistoryResultList> appoList = [];
List<AppoitmentAllHistoryResultList> bookedAppoList = [];
List<AppoitmentAllHistoryResultList> confirmedAppoList = [];
List<AppoitmentAllHistoryResultList> arrivedAppoList = [];
@override
_MyAppointmentsState createState() => _MyAppointmentsState();
}
class _MyAppointmentsState extends State<MyAppointments>
with SingleTickerProviderStateMixin {
TabController _tabController;
bool isDataLoaded = false;
@override
void initState() {
_tabController = new TabController(length: 3, vsync: this);
WidgetsBinding.instance
.addPostFrameCallback((_) => getPatientAppointmentHistory());
super.initState();
}
@override
Widget build(BuildContext context) {
return AppScaffold(
appBarTitle: "My Appointments",
isShowAppBar: true,
body: Container(
child: Column(children: [
/// this is will not colored with theme data
TabBar(
tabs: [
Tab(text: TranslationBase.of(context).booked),
Tab(text: TranslationBase.of(context).confirmed),
Tab(text: TranslationBase.of(context).arrived),
],
controller: _tabController,
),
Divider(
color: Colors.grey[600],
thickness: 0.5,
),
Expanded(
child: new TabBarView(
physics: NeverScrollableScrollPhysics(),
children: [
isDataLoaded ? getBookedAppointments() : Container(),
isDataLoaded ? getConfirmedAppointments() : Container(),
isDataLoaded ? getArrivedAppointments() : Container()
],
controller: _tabController,
),
),
]),
),
);
}
getPatientAppointmentHistory() {
DoctorsListService service = new DoctorsListService();
widget.appoList.clear();
widget.bookedAppoList.clear();
widget.confirmedAppoList.clear();
widget.arrivedAppoList.clear();
service.getPatientAppointmentHistory(false, context).then((res) {
print(res['AppoimentAllHistoryResultList'].length);
if (res['MessageStatus'] == 1) {
setState(() {
if (res['AppoimentAllHistoryResultList'].length != 0) {
res['AppoimentAllHistoryResultList'].forEach((v) {
widget.appoList
.add(new AppoitmentAllHistoryResultList.fromJson(v));
});
sortAppointmentList();
openAppointmentsTab();
isDataLoaded = true;
} else {}
});
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) {
print(err);
});
}
bool isConfirmed(AppoitmentAllHistoryResultList appo) {
return AppointmentType.isConfirmed(appo);
}
bool isArrived(AppoitmentAllHistoryResultList appo) {
return AppointmentType.isArrived(appo);
}
bool isBooked(AppoitmentAllHistoryResultList appo) {
return AppointmentType.isBooked(appo);
}
sortAppointmentList() {
widget.appoList.forEach((v) {
if (isBooked(v)) {
widget.bookedAppoList.add(v);
}
if (isConfirmed(v)) {
widget.confirmedAppoList.add(v);
}
if (isArrived(v)) {
widget.arrivedAppoList.add(v);
}
});
}
openAppointmentsTab() {
if (widget.bookedAppoList.length != 0) {
_tabController.animateTo((_tabController.index + 1) % 1);
return;
}
if (widget.confirmedAppoList.length != 0) {
_tabController.animateTo((_tabController.index + 1) % 2);
return;
}
if (widget.arrivedAppoList.length != 0) {
_tabController.animateTo((_tabController.index + 1) % 3);
return;
}
}
Widget getBookedAppointments() {
return Container(
child: widget.bookedAppoList.length != 0
? new ListView.builder(
itemCount: widget.bookedAppoList.length,
itemBuilder: (context, i) {
return AppointmentCard(
appo: widget.bookedAppoList[i],
onReloadAppointmentHistory: getPatientAppointmentHistory,
);
},
)
: Container(
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Image.asset(
"assets/images/new-design/noAppointmentIcon.png"),
Container(
margin: EdgeInsets.only(top: 10.0),
child: Text("No Booked Appointments",
style: TextStyle(
fontSize: 16.0,
)),
),
],
),
),
),
);
}
Widget getConfirmedAppointments() {
return widget.confirmedAppoList.length != 0
? Container(
child: new ListView.builder(
itemCount: widget.confirmedAppoList.length,
itemBuilder: (context, i) {
return AppointmentCard(
appo: widget.confirmedAppoList[i],
onReloadAppointmentHistory: getPatientAppointmentHistory,
);
},
),
)
: Container(
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Image.asset("assets/images/new-design/noAppointmentIcon.png"),
Container(
margin: EdgeInsets.only(top: 10.0),
child: Text("No Confirmed Appointments",
style: TextStyle(
fontSize: 16.0,
)),
),
],
),
),
);
}
Widget getArrivedAppointments() {
return widget.arrivedAppoList.length != 0
? Container(
child: new ListView.builder(
itemCount: widget.arrivedAppoList.length,
itemBuilder: (context, i) {
return AppointmentCard(
appo: widget.arrivedAppoList[i],
onReloadAppointmentHistory: getPatientAppointmentHistory,
);
},
),
)
: Container(
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Image.asset("assets/images/new-design/noAppointmentIcon.png"),
Container(
margin: EdgeInsets.only(top: 10.0),
child: Text("No Arrived Appointments",
style: TextStyle(
fontSize: 16.0,
)),
),
],
),
),
);
}
}

@ -19,7 +19,7 @@ class _VisitTicketState extends State<VisitTicket> {
@override
void initState() {
getPatientAppointmentCurfewHistory();
getPatientAppointmentCurfewHistory(context);
super.initState();
}
@ -46,10 +46,10 @@ class _VisitTicketState extends State<VisitTicket> {
);
}
getPatientAppointmentCurfewHistory() {
getPatientAppointmentCurfewHistory(BuildContext context) {
loading(true);
DoctorsListService service = new DoctorsListService();
service.getPatientAppointmentHistory(true).then((res) {
service.getPatientAppointmentHistory(true, context).then((res) {
print(res['AppoimentAllHistoryResultList']);
if (res['MessageStatus'] == 1) {
setState(() {

@ -42,7 +42,7 @@ class ArrivedButtons {
{
"title": "Insurance",
"subtitle": "Approvals",
"icon": "assets/images/new-design/insurance_approvals_icon-in.png",
"icon": "assets/images/new-design/insurance_approvals_icon.png",
"caller": "goToTodoList"
},
{

@ -42,7 +42,7 @@ class ArrivedButtons {
{
"title": "Insurance",
"subtitle": "Approvals",
"icon": "assets/images/new-design/insurance_approvals_icon-in.png",
"icon": "assets/images/new-design/insurance_approvals_icon.png",
"caller": "goToTodoList"
},
{

@ -303,20 +303,16 @@ class _AppointmentActionsState extends State<AppointmentActions> {
cancelAppointment() {
ConfirmDialog.closeAlertDialog(context);
loading(true);
DoctorsListService service = new DoctorsListService();
service.cancelAppointment(widget.appo).then((res) {
service.cancelAppointment(widget.appo, context).then((res) {
print(res);
if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: res['ErrorEndUserMessage']);
loading(false);
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
loading(false);
}
}).catchError((err) {
print(err);
loading(false);
});
}
@ -355,7 +351,7 @@ class _AppointmentActionsState extends State<AppointmentActions> {
DoctorsListService service = new DoctorsListService();
service
.confirmAppointment(widget.appo.appointmentNo, widget.appo.clinicID,
widget.appo.projectID)
widget.appo.projectID, context)
.then((res) {
if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: res['ErrorEndUserMessage']);

@ -0,0 +1,144 @@
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:flutter/material.dart';
import 'package:rating_bar/rating_bar.dart';
import '../AppointmentDetails.dart';
class AppointmentCard extends StatefulWidget {
AppoitmentAllHistoryResultList appo;
final Function onReloadAppointmentHistory;
AppointmentCard(
{@required this.appo, @required this.onReloadAppointmentHistory});
@override
_ApointmentCardState createState() => _ApointmentCardState();
}
class _ApointmentCardState extends State<AppointmentCard> {
@override
Widget build(BuildContext context) {
return InkWell(
onTap: () {
navigateToAppointmentDetails(context, widget.appo);
},
child: Card(
margin: EdgeInsets.fromLTRB(20.0, 16.0, 20.0, 8.0),
color: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
),
child: Container(
decoration: BoxDecoration(),
padding: EdgeInsets.all(7.0),
width: MediaQuery.of(context).size.width,
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
ClipRRect(
borderRadius: BorderRadius.circular(100.0),
child: Image.network(widget.appo.doctorImageURL,
fit: BoxFit.fill, height: 60.0, width: 60.0),
),
Container(
width: MediaQuery.of(context).size.width * 0.666,
margin: EdgeInsets.fromLTRB(20.0, 10.0, 10.0, 0.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
widget.appo.doctorTitle +
" " +
widget.appo.doctorNameObj,
style: TextStyle(
fontSize: 14.0,
color: Colors.grey[700],
letterSpacing: 1.0)),
Container(
margin: EdgeInsets.only(top: 3.0),
child: Text(widget.appo.clinicName,
style: TextStyle(
fontSize: 12.0,
color: Colors.grey[600],
letterSpacing: 1.0)),
),
Container(
margin: EdgeInsets.only(top: 3.0),
child: Text(widget.appo.projectName,
style: TextStyle(
fontSize: 12.0,
color: Colors.grey[600],
letterSpacing: 1.0)),
),
Container(
margin: EdgeInsets.only(top: 3.0, bottom: 3.0),
child: Text(getDate(widget.appo.appointmentDate).trim(),
style: TextStyle(
fontSize: 12.0,
color: Colors.grey[600],
letterSpacing: 1.0)),
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
RatingBar.readOnly(
initialRating:
widget.appo.actualDoctorRate.toDouble(),
size: 20.0,
filledColor: Colors.yellow[700],
emptyColor: Colors.grey[500],
isHalfAllowed: true,
halfFilledIcon: Icons.star_half,
filledIcon: Icons.star,
emptyIcon: Icons.star,
),
Container(
transform: Matrix4.translationValues(0.0, -40.0, 0.0),
child: Image.asset(
"assets/images/new-design/arrow.png",
width: 25.0,
height: 25.0),
),
],
),
],
),
),
],
),
),
),
);
}
String getDate(String date) {
DateTime dateObj = DateUtil.convertStringToDate(date);
return DateUtil.getWeekDay(dateObj.weekday) +
", " +
dateObj.day.toString() +
" " +
DateUtil.getMonth(dateObj.month) +
" " +
dateObj.year.toString();
}
String getDoctorSpeciality(List<String> docSpecial) {
String docSpeciality = "";
docSpecial.forEach((v) {
docSpeciality = docSpeciality + v + "\n";
});
return docSpeciality;
}
Future navigateToAppointmentDetails(context, appo) async {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => AppointmentDetails(appo: appo)))
.then((value) {
widget.onReloadAppointmentHistory();
});
}
}

@ -1,9 +1,13 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/QRCode.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/AppointmentDetails.dart';
import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart';
import 'package:diplomaticquarterapp/pages/ToDoList/widgets/paymentDialog.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
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';
@ -25,13 +29,16 @@ class ToDo extends StatefulWidget {
class _ToDoState extends State<ToDo> {
AppSharedPreferences sharedPref = AppSharedPreferences();
bool isLoading = false;
AuthenticatedUser authUser;
AuthProvider authProvider = new AuthProvider();
@override
void initState() {
// authUser = authProvider.getAuthenticatedUser();
print("initState!!!!!");
widget.patientShareResponse = new PatientShareResponse();
getPatientAppointmentHistory();
WidgetsBinding.instance
.addPostFrameCallback((_) => getPatientAppointmentHistory());
super.initState();
}
@ -39,222 +46,208 @@ class _ToDoState extends State<ToDo> {
Widget build(BuildContext context) {
return AppScaffold(
appBarTitle: TranslationBase.of(context).todoList,
body: isLoading == false
? SingleChildScrollView(
child: Container(
child: ListView.builder(
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: ScrollPhysics(),
padding: EdgeInsets.all(0.0),
itemCount: widget.appoList.length,
itemBuilder: (context, index) {
return Container(
margin: EdgeInsets.all(10.0),
child: Card(
margin: EdgeInsets.fromLTRB(8.0, 0.0, 8.0, 8.0),
color: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
body: SingleChildScrollView(
child: Container(
child: ListView.builder(
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: ScrollPhysics(),
padding: EdgeInsets.all(0.0),
itemCount: widget.appoList.length,
itemBuilder: (context, index) {
return Container(
margin: EdgeInsets.all(10.0),
child: Card(
margin: EdgeInsets.fromLTRB(8.0, 0.0, 8.0, 8.0),
color: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
),
child: Container(
width: MediaQuery.of(context).size.width,
padding: EdgeInsets.all(10.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Row(
children: <Widget>[
Image.asset(
"assets/images/new-design/time_icon.png",
width: 20.0,
height: 20.0),
Container(
margin: EdgeInsets.only(left: 10.0, right: 30.0),
child: Text(
getDate(
widget.appoList[index].appointmentDate),
style: TextStyle(fontSize: 12.0)),
),
Image.asset(
"assets/images/new-design/hospital_address_icon.png",
width: 20.0,
height: 20.0),
Container(
margin: EdgeInsets.only(left: 10.0, right: 10.0),
child: Text(widget.appoList[index].projectName,
style: TextStyle(fontSize: 12.0)),
),
],
),
child: Container(
width: MediaQuery.of(context).size.width,
padding: EdgeInsets.all(10.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Row(
children: <Widget>[
Image.asset(
"assets/images/new-design/time_icon.png",
width: 20.0,
height: 20.0),
Container(
margin: EdgeInsets.only(
left: 10.0, right: 30.0),
child: Text(
getDate(widget
.appoList[index].appointmentDate),
style: TextStyle(fontSize: 12.0)),
),
Image.asset(
"assets/images/new-design/hospital_address_icon.png",
width: 20.0,
height: 20.0),
Container(
margin: EdgeInsets.only(
left: 10.0, right: 10.0),
child: Text(
widget.appoList[index].projectName,
style: TextStyle(fontSize: 12.0)),
),
],
),
Container(
Container(
margin: EdgeInsets.only(top: 5.0),
child: Divider(
color: Colors.grey[500],
),
),
Flex(
direction: Axis.horizontal,
children: <Widget>[
Expanded(
flex: 1,
child: Container(
height:
MediaQuery.of(context).size.height * 0.1,
margin: EdgeInsets.only(top: 5.0),
child: Divider(
color: Colors.grey[500],
child: ClipRRect(
borderRadius: BorderRadius.circular(100.0),
child: Image.network(
widget.appoList[index].doctorImageURL,
fit: BoxFit.fill),
),
),
Flex(
direction: Axis.horizontal,
children: <Widget>[
Expanded(
flex: 1,
child: Container(
height:
MediaQuery.of(context).size.height *
0.1,
margin: EdgeInsets.only(top: 5.0),
child: ClipRRect(
borderRadius:
BorderRadius.circular(100.0),
child: Image.network(
),
Expanded(
flex: 3,
child: Container(
margin: EdgeInsets.only(
top: 20.0, left: 20.0, right: 20.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
widget.appoList[index].doctorTitle +
" " +
widget
.appoList[index].doctorImageURL,
fit: BoxFit.fill),
),
),
),
Expanded(
flex: 3,
child: Container(
.appoList[index].doctorNameObj,
style: TextStyle(
fontSize: 14.0,
color: Colors.black,
fontWeight: FontWeight.bold,
letterSpacing: 1.0)),
Container(
margin: EdgeInsets.only(
top: 20.0, left: 20.0, right: 20.0),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
Text(
widget.appoList[index]
.doctorTitle +
" " +
widget.appoList[index]
.doctorNameObj,
style: TextStyle(
fontSize: 14.0,
color: Colors.black,
fontWeight: FontWeight.bold,
letterSpacing: 1.0)),
Container(
margin: EdgeInsets.only(
top: 3.0, bottom: 3.0),
child: Text(
getDoctorSpeciality(widget
.appoList[index]
.doctorSpeciality)
.trim(),
style: TextStyle(
fontSize: 12.0,
color: Colors.grey[600],
letterSpacing: 1.0)),
),
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
RatingBar.readOnly(
initialRating: widget
.appoList[index]
.actualDoctorRate
.toDouble(),
size: 20.0,
filledColor: Colors.yellow[700],
emptyColor: Colors.grey[500],
isHalfAllowed: true,
halfFilledIcon: Icons.star_half,
filledIcon: Icons.star,
emptyIcon: Icons.star,
),
],
),
],
),
top: 3.0, bottom: 3.0),
child: Text(
getDoctorSpeciality(widget
.appoList[index]
.doctorSpeciality)
.trim(),
style: TextStyle(
fontSize: 12.0,
color: Colors.grey[600],
letterSpacing: 1.0)),
),
),
Expanded(
flex: 1,
child: InkWell(
onTap: () => performNextAction(
widget.appoList[index]),
child: Container(
margin: EdgeInsets.only(top: 20.0),
child: Column(
children: <Widget>[
Image.asset(
getNextActionImage(widget
.appoList[index]
.nextAction),
width: 50.0,
height: 50.0),
Container(
margin: EdgeInsets.only(top: 5.0),
child: Text(
getNextActionText(widget
.appoList[index]
.nextAction),
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 12.0)),
)
],
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
RatingBar.readOnly(
initialRating: widget
.appoList[index].actualDoctorRate
.toDouble(),
size: 20.0,
filledColor: Colors.yellow[700],
emptyColor: Colors.grey[500],
isHalfAllowed: true,
halfFilledIcon: Icons.star_half,
filledIcon: Icons.star,
emptyIcon: Icons.star,
),
),
],
),
)
],
),
Divider(
color: Colors.grey[500],
],
),
),
Flex(
direction: Axis.horizontal,
children: <Widget>[
Expanded(
flex: 2,
child: Container(
child: Text(
getNextActionDescription(widget
),
Expanded(
flex: 1,
child: InkWell(
onTap: () =>
performNextAction(widget.appoList[index]),
child: Container(
margin: EdgeInsets.only(top: 20.0),
child: Column(
children: <Widget>[
Image.asset(
getNextActionImage(widget
.appoList[index].nextAction),
style: TextStyle(
fontSize: 12.0,
color: Colors.grey[700])),
),
),
Expanded(
flex: 1,
child: GestureDetector(
onTap: () {
navigateToAppointmentDetails(
context, widget.appoList[index]);
},
child: Container(
width: 50.0,
height: 50.0),
Container(
margin: EdgeInsets.only(top: 5.0),
child: Text(
TranslationBase.of(context)
.upcomingDetails,
textAlign: TextAlign.end,
style: TextStyle(
fontSize: 12.0,
color: Colors.red[600],
decoration:
TextDecoration.underline)),
),
),
)
],
)
],
),
getNextActionText(widget
.appoList[index].nextAction),
textAlign: TextAlign.center,
style: TextStyle(fontSize: 12.0)),
)
],
),
),
),
)
],
),
Divider(
color: Colors.grey[500],
),
Flex(
direction: Axis.horizontal,
children: <Widget>[
Expanded(
flex: 2,
child: Container(
child: Text(
getNextActionDescription(
widget.appoList[index].nextAction),
style: TextStyle(
fontSize: 12.0,
color: Colors.grey[700])),
),
),
Expanded(
flex: 1,
child: GestureDetector(
onTap: () {
navigateToAppointmentDetails(
context, widget.appoList[index]);
},
child: Container(
child: Text(
TranslationBase.of(context)
.upcomingDetails,
textAlign: TextAlign.end,
style: TextStyle(
fontSize: 12.0,
color: Colors.red[600],
decoration:
TextDecoration.underline)),
),
),
)
],
),
),
);
},
],
),
),
),
),
)
: AppCircularProgressIndicator(),
);
},
),
),
),
);
}
@ -305,6 +298,10 @@ class _ToDoState extends State<ToDo> {
case 20:
getPatientShare(context, appo);
break;
case 30:
getAppoQR(context, appo);
break;
}
}
@ -425,9 +422,8 @@ class _ToDoState extends State<ToDo> {
}
getPatientAppointmentHistory() {
loading(true);
DoctorsListService service = new DoctorsListService();
service.getPatientAppointmentHistory(true).then((res) {
service.getPatientAppointmentHistory(true, context).then((res) {
print(res['AppoimentAllHistoryResultList']);
if (res['MessageStatus'] == 1) {
setState(() {
@ -439,33 +435,59 @@ class _ToDoState extends State<ToDo> {
});
} else {}
});
loading(false);
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
loading(false);
}
}).catchError((err) {
print(err);
loading(false);
});
}
getPatientShare(context, AppoitmentAllHistoryResultList appo) {
loading(true);
DoctorsListService service = new DoctorsListService();
service
.getPatientShare(
appo.appointmentNo.toString(), appo.clinicID, appo.projectID)
.getPatientShare(appo.appointmentNo.toString(), appo.clinicID,
appo.projectID, context)
.then((res) {
loading(false);
widget.patientShareResponse = new PatientShareResponse.fromJson(res);
openPaymentDialog(appo, widget.patientShareResponse);
}).catchError((err) {
loading(false);
print(err);
});
}
getAppoQR(context, AppoitmentAllHistoryResultList appo) {
PatientShareResponse patientShareResponse = new PatientShareResponse();
patientShareResponse.doctorNameObj = appo.doctorNameObj;
patientShareResponse.doctorSpeciality = appo.doctorSpeciality;
patientShareResponse.projectName = appo.projectName;
patientShareResponse.appointmentDate = appo.appointmentDate;
patientShareResponse.appointmentNo = appo.appointmentNo;
patientShareResponse.clinicID = appo.clinicID;
patientShareResponse.projectID = appo.projectID;
patientShareResponse.isFollowup = appo.isFollowup;
DoctorsListService service = new DoctorsListService();
service.generateAppointmentQR(patientShareResponse, context).then((res) {
print(res);
navigateToQR(context, res['AppointmentQR'], patientShareResponse);
}).catchError((err) {
print(err);
});
}
Future navigateToQR(
context, String appoQR, PatientShareResponse patientShareResponse) async {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => QRCode(
patientShareResponse: patientShareResponse,
appoQR: appoQR,
)));
}
openPaymentDialog(AppoitmentAllHistoryResultList appo,
PatientShareResponse patientShareResponse) {
showGeneralDialog(
@ -489,33 +511,29 @@ class _ToDoState extends State<ToDo> {
context: context,
pageBuilder: (context, animation1, animation2) {})
.then((value) {
getPatientAppointmentHistory();
// getPatientAppointmentHistory();
});
}
Future navigateToPaymentMethod(context) async {
Navigator.push(
context, MaterialPageRoute(builder: (context) => PaymentMethod()));
}
confirmAppointment(AppoitmentAllHistoryResultList appo) {
loading(true);
DoctorsListService service = new DoctorsListService();
service
.confirmAppointment(appo.appointmentNo, appo.clinicID, appo.projectID)
.confirmAppointment(
appo.appointmentNo, appo.clinicID, appo.projectID, context)
.then((res) {
if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: res['ErrorEndUserMessage']);
loading(false);
getPatientAppointmentHistory();
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
loading(false);
}
}).catchError((err) {
print(err);
loading(false);
});
}
loading(bool flag) {
setState(() {
isLoading = flag;
});
}
}

@ -2,7 +2,6 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
class PaymentMethod extends StatefulWidget {
@override

@ -9,7 +9,9 @@ class PaymentDialog extends StatefulWidget {
AppoitmentAllHistoryResultList appo;
PatientShareResponse patientShareResponse;
PaymentDialog({@required this.appo, this.patientShareResponse});
final Function onPaymentMethodSelected;
PaymentDialog({@required this.appo, @required this.onPaymentMethodSelected, this.patientShareResponse});
@override
_PaymentDialogState createState() => _PaymentDialogState();
@ -158,7 +160,7 @@ class _PaymentDialogState extends State<PaymentDialog> {
child: InkWell(
onTap: () {
Navigator.of(context).pop();
naviagetToPaymentMethod(context);
widget.onPaymentMethodSelected();
},
child: Container(
child: Text("Ok",
@ -196,10 +198,10 @@ class _PaymentDialogState extends State<PaymentDialog> {
color: Colors.grey[700], fontSize: 15.0, fontFamily: "Open-Sans-Bold");
}
Future naviagetToPaymentMethod(context) async {
Navigator.push(
context, MaterialPageRoute(builder: (context) => PaymentMethod()));
}
// Future navigateToPaymentMethod(context) async {
// Navigator.push(
// context, MaterialPageRoute(builder: (context) => PaymentMethod()));
// }
String getDate(String date) {
DateTime dateObj = DateUtil.convertStringToDate(date);

@ -1,5 +1,4 @@
import 'dart:math';
import 'package:diplomaticquarterapp/pages/MyAppointments/MyAppointments.dart';
import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_home_page.dart';
import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -47,8 +46,9 @@ class _MedicalProfilePageState extends State<MedicalProfilePage> {
Expanded(
flex: 1,
child: InkWell(
onTap: (){
Navigator.push(context, FadePage(page: DoctorHomePage()));
onTap: () {
Navigator.push(
context, FadePage(page: DoctorHomePage()));
},
child: MedicalProfileItem(
title: 'My Doctor',
@ -60,9 +60,7 @@ class _MedicalProfilePageState extends State<MedicalProfilePage> {
Expanded(
flex: 1,
child: InkWell(
onTap: (){
},
onTap: () {},
child: MedicalProfileItem(
title: 'Lab',
imagePath: 'lab_result_icon.png',
@ -85,9 +83,9 @@ class _MedicalProfilePageState extends State<MedicalProfilePage> {
Expanded(
flex: 1,
child: InkWell(
onTap: (){
Navigator.push(context, FadePage(page: HomePrescriptionsPage()));
onTap: () {
Navigator.push(context,
FadePage(page: HomePrescriptionsPage()));
},
child: MedicalProfileItem(
title: 'Medicines',
@ -130,7 +128,17 @@ class _MedicalProfilePageState extends State<MedicalProfilePage> {
),
Expanded(
flex: 1,
child: Container(),
child: InkWell(
onTap: () {
Navigator.push(
context, FadePage(page: MyAppointments()));
},
child: MedicalProfileItem(
title: 'My Appointments',
imagePath: 'my_appointment_icon.png',
subTitle: 'List',
),
),
)
],
),

@ -1,17 +1,36 @@
import 'dart:io';
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/models/Request.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:flutter/cupertino.dart';
class DoctorsListService extends BaseService {
AppSharedPreferences sharedPref = AppSharedPreferences();
AppGlobal appGlobal = new AppGlobal();
Future<Map> getDoctorsList(int clinicID, int projectID) async {
AuthenticatedUser authUser = new AuthenticatedUser();
AuthProvider authProvider = new AuthProvider();
Future<Map> getDoctorsList(
int clinicID, int projectID, BuildContext context) async {
Utils.showProgressDialog(context);
Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(
await this.sharedPref.getObject(USER_PROFILE));
authUser = data;
}
var languageID = await sharedPref.getString(APP_LANGUAGE);
Request req = appGlobal.getPublicRequest();
request = {
@ -28,9 +47,9 @@ class DoctorsListService extends BaseService {
"ProjectID": projectID,
"ContinueDentalPlan": false,
"IsSearchAppointmnetByClinicID": true,
"PatientID": 0,
"gender": 0,
"age": 0,
"PatientID": authUser.patientID,
"gender": authUser.gender,
"age": authUser.age,
"IsGetNearAppointment": false,
"Latitude": 0,
"Longitude": 0,
@ -41,15 +60,24 @@ class DoctorsListService extends BaseService {
await baseAppClient.post(GET_DOCTORS_LIST_URL,
onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
localRes = response;
Utils.hideProgressDialog();
}, onFailure: (String error, int statusCode) {
Utils.hideProgressDialog();
throw error;
}, body: request);
return Future.value(localRes);
}
Future<Map> getDoctorsListByName(String docName) async {
Future<Map> getDoctorsListByName(String docName, BuildContext context) async {
Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(
await this.sharedPref.getObject(USER_PROFILE));
authUser = data;
}
var languageID = await sharedPref.getString(APP_LANGUAGE);
Request req = appGlobal.getPublicRequest();
request = {
@ -67,9 +95,9 @@ class DoctorsListService extends BaseService {
"ContinueDentalPlan": false,
"IsSearchAppointmnetByClinicID": false,
"DoctorName": docName,
"PatientID": 0,
"gender": 0,
"age": 0,
"PatientID": authUser.patientID,
"gender": authUser.gender,
"age": authUser.age,
"IsGetNearAppointment": false,
"Latitude": 0,
"Longitude": 0,
@ -80,14 +108,15 @@ class DoctorsListService extends BaseService {
await baseAppClient.post(GET_DOCTORS_LIST_URL,
onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
return Future.value(localRes);
}
Future<Map> getDoctorsProfile(int docID, int clinicID, int projectID) async {
Future<Map> getDoctorsProfile(int docID, int clinicID, int projectID, context) async {
Utils.showProgressDialog(context);
Map<String, dynamic> request;
var languageID = await sharedPref.getString(APP_LANGUAGE);
Request req = appGlobal.getPublicRequest();
@ -114,14 +143,18 @@ class DoctorsListService extends BaseService {
await baseAppClient.post(GET_DOCTOR_PROFILE,
onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
localRes = response;
Utils.hideProgressDialog();
}, onFailure: (String error, int statusCode) {
Utils.hideProgressDialog();
throw error;
}, body: request);
return Future.value(localRes);
}
Future<Map> getDoctorFreeSlots(int docID, int clinicID, int projectID) async {
Future<Map> getDoctorFreeSlots(
int docID, int clinicID, int projectID, BuildContext context) async {
Utils.showProgressDialog(context);
Map<String, dynamic> request;
var languageID = await sharedPref.getString(APP_LANGUAGE);
Request req = appGlobal.getPublicRequest();
@ -148,19 +181,29 @@ class DoctorsListService extends BaseService {
await baseAppClient.post(GET_DOCTOR_FREE_SLOTS,
onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
localRes = response;
Utils.hideProgressDialog();
}, onFailure: (String error, int statusCode) {
Utils.hideProgressDialog();
throw error;
}, body: request);
return Future.value(localRes);
}
Future<Map> insertAppointment(int docID, int clinicID, int projectID,
String selectedTime, String selectedDate) async {
String selectedTime, String selectedDate, BuildContext context) async {
Utils.showProgressDialog(context);
Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(
await this.sharedPref.getObject(USER_PROFILE));
authUser = data;
}
var languageID = await sharedPref.getString(APP_LANGUAGE);
Request req = appGlobal.getPublicRequest();
request = {
"IsForLiveCare": false,
"ProjectID": projectID,
@ -172,7 +215,7 @@ class DoctorsListService extends BaseService {
"InitialSlotDuration": 0,
"StrAppointmentDate": selectedDate,
"IsVirtual": false,
"DeviceType": "iOS",
"DeviceType": Platform.isIOS ? 'iOS' : 'Android',
"BookedBy": 102,
"VisitType": 1,
"VisitFor": 1,
@ -181,29 +224,40 @@ class DoctorsListService extends BaseService {
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress,
"generalid": req.generalid,
"PatientOutSA": 0,
"PatientOutSA": authUser.outSA,
"SessionID": "YckwoXhUmWBsnHKEKig",
"isDentalAllowedBackend": false,
"DeviceTypeID": 1,
"PatientID": 1231755,
"DeviceTypeID": req.DeviceTypeID,
"PatientID": authUser.patientID,
"TokenID": "@dm!n",
"PatientTypeID": 1,
"PatientType": 1
"PatientTypeID": authUser.patientType,
"PatientType": authUser.patientType
};
dynamic localRes;
await baseAppClient.post(INSERT_SPECIFIC_APPOINTMENT,
onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
localRes = response;
Utils.hideProgressDialog();
}, onFailure: (String error, int statusCode) {
Utils.hideProgressDialog();
throw error;
}, body: request);
return Future.value(localRes);
}
Future<Map> getPatientShare(String appoID, int clinicID, int projectID) async {
Future<Map> getPatientShare(
String appoID, int clinicID, int projectID, BuildContext context) async {
Utils.showProgressDialog(context);
Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(
await this.sharedPref.getObject(USER_PROFILE));
authUser = data;
}
var languageID = await sharedPref.getString(APP_LANGUAGE);
Request req = appGlobal.getPublicRequest();
@ -217,29 +271,40 @@ class DoctorsListService extends BaseService {
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress,
"generalid": req.generalid,
"PatientOutSA": 0,
"PatientOutSA": authUser.outSA,
"SessionID": "YckwoXhUmWBsnHKEKig",
"isDentalAllowedBackend": false,
"DeviceTypeID": 1,
"PatientID": 1231755,
"DeviceTypeID": req.DeviceTypeID,
"PatientID": authUser.patientID,
"TokenID": "@dm!n",
"PatientTypeID": 1,
"PatientType": 1
"PatientTypeID": authUser.patientType,
"PatientType": authUser.patientType
};
dynamic localRes;
await baseAppClient.post(GET_PATIENT_SHARE,
onSuccess: (response, statusCode) async {
localRes = response['OnlineCheckInAppointments'][0];
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
localRes = response['OnlineCheckInAppointments'][0];
Utils.hideProgressDialog();
}, onFailure: (String error, int statusCode) {
Utils.hideProgressDialog();
throw error;
}, body: request);
return Future.value(localRes);
}
Future<Map> getPatientAppointmentHistory(bool isActiveAppointment) async {
Future<Map> getPatientAppointmentHistory(
bool isActiveAppointment, BuildContext context) async {
Utils.showProgressDialog(context);
Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(
await this.sharedPref.getObject(USER_PROFILE));
authUser = data;
}
var languageID = await sharedPref.getString(APP_LANGUAGE);
Request req = appGlobal.getPublicRequest();
@ -253,25 +318,28 @@ class DoctorsListService extends BaseService {
"PatientOutSA": 0,
"SessionID": "YckwoXhUmWBsnHKEKig",
"isDentalAllowedBackend": false,
"DeviceTypeID": 1,
"PatientID": 1231755,
"DeviceTypeID": req.DeviceTypeID,
"PatientID": authUser.patientID,
"TokenID": "@dm!n",
"PatientTypeID": 1,
"PatientType": 1
"PatientTypeID": authUser.patientType,
"PatientType": authUser.patientType
};
dynamic localRes;
await baseAppClient.post(GET_PATIENT_APPOINTMENT_HISTORY,
onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
localRes = response;
Utils.hideProgressDialog();
}, onFailure: (String error, int statusCode) {
Utils.hideProgressDialog();
throw error;
}, body: request);
return Future.value(localRes);
}
Future<Map> getPatientAppointmentCurfewHistory(bool isActiveAppointment) async {
Future<Map> getPatientAppointmentCurfewHistory(
bool isActiveAppointment) async {
Map<String, dynamic> request;
var languageID = await sharedPref.getString(APP_LANGUAGE);
Request req = appGlobal.getPublicRequest();
@ -286,7 +354,7 @@ class DoctorsListService extends BaseService {
"PatientOutSA": 0,
"SessionID": "YckwoXhUmWBsnHKEKig",
"isDentalAllowedBackend": false,
"DeviceTypeID": 1,
"DeviceTypeID": req.DeviceTypeID,
"PatientID": 1231755,
"TokenID": "@dm!n",
"PatientTypeID": 1,
@ -297,15 +365,24 @@ class DoctorsListService extends BaseService {
await baseAppClient.post(GET_PATIENT_APPOINTMENT_CURFEW_HISTORY,
onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
return Future.value(localRes);
}
Future<Map> confirmAppointment(int appoNo, int clinicID, int projectID) async {
Future<Map> confirmAppointment(
int appoNo, int clinicID, int projectID, BuildContext context) async {
Utils.showProgressDialog(context);
Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(
await this.sharedPref.getObject(USER_PROFILE));
authUser = data;
}
var languageID = await sharedPref.getString(APP_LANGUAGE);
Request req = appGlobal.getPublicRequest();
@ -322,26 +399,37 @@ class DoctorsListService extends BaseService {
"PatientOutSA": 0,
"SessionID": "YckwoXhUmWBsnHKEKig",
"isDentalAllowedBackend": false,
"DeviceTypeID": 1,
"PatientID": 1231755,
"DeviceTypeID": req.DeviceTypeID,
"PatientID": authUser.patientID,
"TokenID": "@dm!n",
"PatientTypeID": 1,
"PatientType": 1
"PatientTypeID": authUser.patientType,
"PatientType": authUser.patientType
};
dynamic localRes;
await baseAppClient.post(CONFIRM_APPOINTMENT,
onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
localRes = response;
Utils.hideProgressDialog();
}, onFailure: (String error, int statusCode) {
Utils.hideProgressDialog();
throw error;
}, body: request);
return Future.value(localRes);
}
Future<Map> cancelAppointment(AppoitmentAllHistoryResultList appo) async {
Future<Map> cancelAppointment(
AppoitmentAllHistoryResultList appo, BuildContext context) async {
Utils.showProgressDialog(context);
Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(
await this.sharedPref.getObject(USER_PROFILE));
authUser = data;
}
var languageID = await sharedPref.getString(APP_LANGUAGE);
Request req = appGlobal.getPublicRequest();
@ -361,25 +449,130 @@ class DoctorsListService extends BaseService {
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress,
"generalid": req.generalid,
"PatientOutSA": 0,
"PatientOutSA": authUser.outSA,
"SessionID": "YckwoXhUmWBsnHKEKig",
"isDentalAllowedBackend": false,
"DeviceTypeID": 1,
"PatientID": 1231755,
"DeviceTypeID": req.DeviceTypeID,
"PatientID": authUser.patientID,
"TokenID": "@dm!n",
"PatientTypeID": 1,
"PatientType": 1
"PatientTypeID": authUser.patientType,
"PatientType": authUser.patientType
};
dynamic localRes;
await baseAppClient.post(CANCEL_APPOINTMENT,
onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
localRes = response;
Utils.hideProgressDialog();
}, onFailure: (String error, int statusCode) {
Utils.hideProgressDialog();
throw error;
}, body: request);
return Future.value(localRes);
}
Future<Map> generateAppointmentQR(
PatientShareResponse patientShareResponse, BuildContext context) async {
Utils.showProgressDialog(context);
Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(
await this.sharedPref.getObject(USER_PROFILE));
authUser = data;
}
var languageID = await sharedPref.getString(APP_LANGUAGE);
Request req = appGlobal.getPublicRequest();
request = {
"AppointmentNo": patientShareResponse.appointmentNo,
"ClinicID": patientShareResponse.clinicID,
"ProjectID": patientShareResponse.projectID,
"IsFollowup": patientShareResponse.isFollowup,
"VersionID": req.VersionID,
"Channel": req.Channel,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress,
"generalid": req.generalid,
"PatientOutSA": authUser.outSA,
"SessionID": "YckwoXhUmWBsnHKEKig",
"isDentalAllowedBackend": false,
"DeviceTypeID": req.DeviceTypeID,
"PatientID": authUser.patientID,
"TokenID": "@dm!n",
"PatientTypeID": authUser.patientType,
"PatientType": authUser.patientType
};
dynamic localRes;
await baseAppClient.post(GENERATE_QR_APPOINTMENT,
onSuccess: (response, statusCode) async {
localRes = response;
Utils.hideProgressDialog();
}, onFailure: (String error, int statusCode) {
Utils.hideProgressDialog();
throw error;
}, body: request);
return Future.value(localRes);
}
Future<Map> sendAppointmentQREmail(
String to,
String appoDate,
String appoNo,
String docName,
String projName,
String QR,
String speciality,
BuildContext context) async {
Utils.showProgressDialog(context);
Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(
await this.sharedPref.getObject(USER_PROFILE));
authUser = data;
}
var languageID = await sharedPref.getString(APP_LANGUAGE);
Request req = appGlobal.getPublicRequest();
request = {
"AppointmentNo": appoNo,
"AppointmentDate": appoDate,
"DoctorName": docName,
"ProjectName": projName,
"QR": QR,
"Speciality": speciality,
"To": to,
"VersionID": req.VersionID,
"Channel": req.Channel,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress,
"generalid": req.generalid,
"PatientOutSA": authUser.outSA,
"SessionID": "YckwoXhUmWBsnHKEKig",
"isDentalAllowedBackend": false,
"DeviceTypeID": req.DeviceTypeID,
"PatientID": authUser.patientID,
"TokenID": "@dm!n",
"PatientTypeID": authUser.patientType,
"PatientType": authUser.patientType
};
dynamic localRes;
await baseAppClient.post(EMAIL_QR_APPOINTMENT,
onSuccess: (response, statusCode) async {
localRes = response;
Utils.hideProgressDialog();
}, onFailure: (String error, int statusCode) {
Utils.hideProgressDialog();
throw error;
}, body: request);
return Future.value(localRes);
}
}

@ -1,25 +1,20 @@
import 'dart:convert';
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_request.dart';
import 'package:diplomaticquarterapp/core/service/client/base_app_client.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_request.dart';
import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart';
import 'package:diplomaticquarterapp/models/Authentication/check_paitent_authentication_req.dart';
import 'package:diplomaticquarterapp/models/Authentication/check_user_status_req.dart';
import 'package:diplomaticquarterapp/models/Authentication/checkpatient_for_registration.dart';
import 'package:diplomaticquarterapp/models/Authentication/get_mobile_info_request.dart';
import 'package:diplomaticquarterapp/models/Authentication/get_mobile_info_response.dart';
import 'package:diplomaticquarterapp/models/Authentication/insert_device_imei_request.dart';
import 'package:diplomaticquarterapp/models/Authentication/select_device_imei_res.dart';
import 'package:diplomaticquarterapp/core/service/client/base_app_client.dart';
import 'package:diplomaticquarterapp/models/Request.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/cupertino.dart';
// SharedPreferences sharedPref = new SharedPreferences();
enum APP_STATUS { LOADING, UNAUTHENTICATED, AUTHENTICATED }
AppSharedPreferences sharedPref = new AppSharedPreferences();
const String INSERT_DEVICE_IMEI = '/Patients.svc/REST/Patient_INSERTDeviceIMEI';
@ -40,6 +35,7 @@ class AuthProvider with ChangeNotifier {
bool isLogin = false;
bool isLoading = true;
dynamic authenticatedUser;
AuthProvider() {
getUserAuthentication();
}
@ -250,9 +246,10 @@ class AuthProvider with ChangeNotifier {
}
}
AuthenticatedUser getAuthenticatedUser() {
Future<AuthenticatedUser> getAuthenticatedUser() async {
this.isLogin = true;
return authenticatedUser;
return Future.value(
AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE)));
}
Future<dynamic> checkPatientForRegisteration(

@ -4,12 +4,14 @@ import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:diplomaticquarterapp/core/service/client/base_app_client.dart';
import 'package:diplomaticquarterapp/models/Request.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
class ClinicListService extends BaseService {
AppSharedPreferences sharedPref = AppSharedPreferences();
AppGlobal appGlobal = new AppGlobal();
Future<Map> getClinicsList() async {
Future<Map> getClinicsList(context) async {
Utils.showProgressDialog(context);
Map<String, dynamic> request;
var languageID = await sharedPref.getString(APP_LANGUAGE);
Request req = appGlobal.getPublicRequest();
@ -30,7 +32,9 @@ class ClinicListService extends BaseService {
await baseAppClient.post(GET_CLINICS_LIST_URL,
onSuccess: (response, statusCode) async {
localRes = response;
Utils.hideProgressDialog();
}, onFailure: (String error, int statusCode) {
Utils.hideProgressDialog();
throw error;
}, body: request);
return Future.value(localRes);

@ -268,8 +268,30 @@ class TranslationBase {
String get patientTaxToDo => localizedValues['patientTaxToDo'][locale.languageCode];
String get patientShareTotalToDo => localizedValues['patientShareTotalToDo'][locale.languageCode];
String get paymentMethod => localizedValues['paymentMethod'][locale.languageCode];
String get moreVerification =>
localizedValues['more-verify'][locale.languageCode];
String get welcomeBack =>
localizedValues['welcome-back'][locale.languageCode];
String get accountInfo =>
localizedValues['account-info'][locale.languageCode];
String get useAnotherAccount =>
localizedValues['another-acc'][locale.languageCode];
String get next => localizedValues['next'][locale.languageCode];
String get noNeedToWaitInLine => localizedValues['noNeedToWaitInLine'][locale.languageCode];
String get useQRAppoAttend => localizedValues['useQRAppoAttend'][locale.languageCode];
String get passQRAppoAttend => localizedValues['passQRAppoAttend'][locale.languageCode];
String get sitWaitingQR => localizedValues['sitWaitingQR'][locale.languageCode];
String get attendRegisterCode => localizedValues['attendRegisterCode'][locale.languageCode];
String get scanQRHospital => localizedValues['scanQRHospital'][locale.languageCode];
String get sendEmail => localizedValues['sendEmail'][locale.languageCode];
String get close => localizedValues['close'][locale.languageCode];
String get booked => localizedValues['booked'][locale.languageCode];
String get confirmed => localizedValues['confirmed'][locale.languageCode];
String get arrived => localizedValues['arrived'][locale.languageCode];
String get payNowBookSuccess => localizedValues['payNowBookSuccess'][locale.languageCode];
String get payNowBookSuccesstext1 => localizedValues['payNowBookSuccesstext1'][locale.languageCode];
String get payNowBookSuccesstext2 => localizedValues['payNowBookSuccesstext2'][locale.languageCode];
String get payLater => localizedValues['payLater'][locale.languageCode];
}

@ -1,5 +1,7 @@
import 'package:connectivity/connectivity.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:progress_dialog/progress_dialog.dart';
import 'app_shared_preferences.dart';
import 'app_toast.dart';
@ -7,6 +9,8 @@ import 'app_toast.dart';
AppSharedPreferences sharedPref = new AppSharedPreferences();
class Utils {
static ProgressDialog pr;
///show custom Error Toast
/// [message] to show for user
static showErrorToast([String message]) {
@ -96,4 +100,34 @@ class Utils {
var length = loginType == 1 ? 10 : 7;
return "([0-9]{" + length.toString() + "})";
}
static showProgressDialog(context, [String message = "Loading..."]) async {
pr = ProgressDialog(context,
type: ProgressDialogType.Normal, isDismissible: false, showLogs: false);
pr.style(
message: message,
borderRadius: 10.0,
backgroundColor: Colors.white,
elevation: 10.0,
insetAnimCurve: Curves.easeInOut,
progress: 0.0,
maxProgress: 100.0,
progressTextStyle: TextStyle(
color: Colors.black, fontSize: 13.0, fontWeight: FontWeight.w400),
messageTextStyle: TextStyle(
color: Colors.black, fontSize: 19.0, fontWeight: FontWeight.w600));
if (!pr.isShowing()) {
await pr.show();
} else {
await pr.hide();
await pr.show();
}
}
static hideProgressDialog() async {
if (pr.isShowing()) {
await pr.hide();
}
}
}

@ -1,10 +1,10 @@
import 'dart:convert';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
import 'dart:convert';
class MyInAppBrowser extends InAppBrowser {
// static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT
@ -97,11 +97,18 @@ class MyInAppBrowser extends InAppBrowser {
await sharedPref.getString(PUSH_TOKEN);
}
getPatientData() async {
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(
await this.sharedPref.getObject(USER_PROFILE));
authUser = data;
}
}
String generateURL(int amount, String orderDesc, String transactionID,
String projId, String emailId, String paymentMethod,
[var patientData, var servID, var LiveServID]) {
authUser = authProvider.getAuthenticatedUser();
getPatientData();
String currentLanguageID = getLanguageID() == 'ar' ? 'AR' : 'EN';
String form = getForm();
@ -153,12 +160,12 @@ class MyInAppBrowser extends InAppBrowser {
}
Codec<String, String> stringToBase64Url = utf8.fuse(base64Url);
String encoded = stringToBase64Url.encode('data:text/html;base64,' + form); // dXNlcm5hbWU6cGFzc3dvcmQ=
String decoded = stringToBase64Url.decode(encoded); // username:password
String encoded = stringToBase64Url
.encode('data:text/html;base64,' + form); // dXNlcm5hbWU6cGFzc3dvcmQ=
String decoded = stringToBase64Url.decode(encoded); // username:password
print(form);
print(encoded);
return encoded;
}
String getForm() {

@ -14,6 +14,7 @@ class AppScaffold extends StatelessWidget {
final Widget bottomSheet;
final bool isLoading;
final bool isShowAppBar;
final bool hasAppBarParam;
final BaseViewModel baseViewModel;
AppScaffold(
@ -21,6 +22,7 @@ class AppScaffold extends StatelessWidget {
this.appBarTitle = '',
this.isLoading = false,
this.isShowAppBar = false,
this.hasAppBarParam,
this.bottomSheet,
this.baseViewModel});

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

@ -87,6 +87,9 @@ dependencies:
#InAppBrowser
flutter_inappwebview: ^4.0.0+4
#ProgressDialog
progress_dialog: ^1.2.4

Loading…
Cancel
Save