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

merge-requests/140/head
Sultan Khan 4 years ago
commit cced69502a

@ -182,6 +182,8 @@ const CHECK_PAYMENT_STATUS =
//URL create advance payment
const CREATE_ADVANCE_PAYMENT = "Services/Doctors.svc/REST/CreateAdvancePayment";
const HIS_CREATE_ADVANCE_PAYMENT = "Services/Patients.svc/REST/HIS_CreateAdvancePayment";
const ADD_ADVANCE_NUMBER_REQUEST =
'Services/PayFort_Serv.svc/REST/AddAdvancedNumberRequest';
@ -242,6 +244,7 @@ const SESSION_ID = 'TMRhVmkGhOsvamErw';
const IS_DENTAL_ALLOWED_BACKEND = false;
const PATIENT_TYPE = 1;
const PATIENT_TYPE_ID = 1;
var DEVICE_TOKEN = "";
var DeviceTypeID = Platform.isIOS ? 1 : 2;
const LANGUAGE_ID = 2;
const GET_PHARMCY_ITEMS = "Services/Lists.svc/REST/GetPharmcyItems_Region";

@ -8,6 +8,9 @@ class AdvanceModel {
String email;
String note;
String depositorName;
String mobileNumber;
String patientName;
int projectID;
CitiesModel citiessModel;
AdvanceModel(
@ -17,5 +20,8 @@ class AdvanceModel {
this.hospitalsModel,
this.fileNumber,
this.depositorName,
this.mobileNumber,
this.patientName,
this.projectID,
this.citiessModel});
}

@ -2,10 +2,13 @@ import 'dart:convert';
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/my_balance/AdvanceModel.dart';
import 'package:diplomaticquarterapp/core/model/my_balance/patient_advance_balance_amount.dart';
import 'package:diplomaticquarterapp/core/model/my_balance/patient_info.dart';
import 'package:diplomaticquarterapp/core/model/my_balance/patient_info_and_mobile_number.dart';
import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart';
import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordsByStatusReq.dart';
import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart';
@ -21,6 +24,8 @@ class MyBalanceService extends BaseService {
String logInTokenID;
String verificationCode;
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
getPatientAdvanceBalanceAmount() async {
hasError = false;
super.error = "";
@ -61,8 +66,8 @@ class MyBalanceService extends BaseService {
super.error = "";
Map<String, dynamic> body = Map();
body['isDentalAllowedBackend'] = false;
body['MobileNo'] = user.mobileNumber;
body['ProjectID'] = user.projectID;
body['MobileNo'] = authenticatedUserObject.user.mobileNumber;
body['ProjectID'] = authenticatedUserObject.user.projectID;
await baseAppClient.post(GET_PATIENT_INFO_BY_ID_AND_MOBILE_NUMBER,
onSuccess: (response, statusCode) async {

@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/blooddonation/blood_groub_details.dart';
import 'package:diplomaticquarterapp/core/model/blooddonation/get_all_cities.dart';
import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart';
import 'package:diplomaticquarterapp/core/model/my_balance/AdvanceModel.dart';
import 'package:diplomaticquarterapp/core/model/my_balance/patient_advance_balance_amount.dart';
import 'package:diplomaticquarterapp/core/model/my_balance/patient_info.dart';
import 'package:diplomaticquarterapp/core/model/my_balance/patient_info_and_mobile_number.dart';
@ -25,11 +26,15 @@ class MyBalanceViewModel extends BaseViewModel {
_myBalanceService.patientAdvanceBalanceAmountList;
//========================
BloodDonationService _bloodDonationService =locator<BloodDonationService>();
List<CitiesModel> get CitiesModelList => _bloodDonationService.CitiesModelList;
BloodDetailsService _bloodDetailsService =locator<BloodDetailsService>();
List<List_BloodGroupDetailsModel> get BloodDetailsModelList => _bloodDetailsService.BloodModelList;//_bloodDonationService.CitiesModelList;
BloodDonationService _bloodDonationService = locator<BloodDonationService>();
List<CitiesModel> get CitiesModelList =>
_bloodDonationService.CitiesModelList;
BloodDetailsService _bloodDetailsService = locator<BloodDetailsService>();
List<List_BloodGroupDetailsModel> get BloodDetailsModelList =>
_bloodDetailsService
.BloodModelList; //_bloodDonationService.CitiesModelList;
//===========================
@ -44,8 +49,8 @@ class MyBalanceViewModel extends BaseViewModel {
PatientInfoAndMobileNumber get patientInfoAndMobileNumber =>
_myBalanceService.patientInfoAndMobileNumber;
String get logInTokenID => _myBalanceService.logInTokenID;
String get verificationCode => _myBalanceService.verificationCode;
getPatientAdvanceBalanceAmount() async {
@ -68,6 +73,7 @@ class MyBalanceViewModel extends BaseViewModel {
} else
setState(ViewState.Idle);
}
//==============
Future getCities() async {
setState(ViewState.Busy);
@ -79,9 +85,11 @@ class MyBalanceViewModel extends BaseViewModel {
} else
setState(ViewState.Idle);
}
Future getBlood() async {
setState(ViewState.Busy);
await _bloodDetailsService .getAllBloodOrders();;
await _bloodDetailsService.getAllBloodOrders();
;
if (_bloodDetailsService.hasError) {
error = _bloodDetailsService.error;
@ -89,6 +97,7 @@ class MyBalanceViewModel extends BaseViewModel {
} else
setState(ViewState.Idle);
}
//===============
Future getPatientInfoByPatientID({String id}) async {
@ -105,7 +114,8 @@ class MyBalanceViewModel extends BaseViewModel {
Future getPatientInfoByPatientIDAndMobileNumber() async {
setState(ViewState.Busy);
await _myBalanceService.getPatientInfoByPatientIDAndMobileNumber();
await _myBalanceService
.getPatientInfoByPatientIDAndMobileNumber();
if (_myBalanceService.hasError) {
error = _myBalanceService.error;
setState(ViewState.ErrorLocal);
@ -115,9 +125,11 @@ class MyBalanceViewModel extends BaseViewModel {
}
}
Future sendActivationCodeForAdvancePayment({int patientID,int projectID}) async {
Future sendActivationCodeForAdvancePayment(
{int patientID, int projectID}) async {
setState(ViewState.Busy);
await _myBalanceService.sendActivationCodeForAdvancePayment(patientID: patientID,projectID: projectID);
await _myBalanceService.sendActivationCodeForAdvancePayment(
patientID: patientID, projectID: projectID);
if (_myBalanceService.hasError) {
error = _myBalanceService.error;
setState(ViewState.ErrorLocal);
@ -126,9 +138,12 @@ class MyBalanceViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
}
Future checkActivationCodeForAdvancePayment({String activationCode}) async {
Future checkActivationCodeForAdvancePayment(
{String activationCode, String patientMobileNumber}) async {
setState(ViewState.Busy);
await _myBalanceService.checkActivationCodeForAdvancePayment(activationCode: activationCode);
await _myBalanceService.checkActivationCodeForAdvancePayment(
activationCode: activationCode);
if (_myBalanceService.hasError) {
error = _myBalanceService.error;
setState(ViewState.ErrorLocal);

@ -3,7 +3,7 @@ import 'package:flutter/cupertino.dart';
class ToDoCountProviderModel with ChangeNotifier {
int _count;
int get count => _count;
int get count => _count == null ? 0 : _count;
void setState(int count) {
_count = count;

@ -1,68 +1,68 @@
class GetAllSharedRecordsByStatusResponse {
Null date;
dynamic date;
int languageID;
int serviceName;
Null time;
Null androidLink;
Null authenticationTokenID;
Null data;
dynamic time;
dynamic androidLink;
dynamic authenticationTokenID;
dynamic data;
bool dataw;
int dietType;
Null errorCode;
Null errorEndUserMessage;
Null errorEndUserMessageN;
Null errorMessage;
dynamic errorCode;
dynamic errorEndUserMessage;
dynamic errorEndUserMessageN;
dynamic errorMessage;
int errorType;
int foodCategory;
Null iOSLink;
dynamic iOSLink;
bool isAuthenticated;
int mealOrderStatus;
int mealType;
int messageStatus;
int numberOfResultRecords;
Null patientBlodType;
Null successMsg;
Null successMsgN;
Null doctorInformationList;
Null getAllPendingRecordsList;
dynamic patientBlodType;
dynamic successMsg;
dynamic successMsgN;
dynamic doctorInformationList;
List<GetAllSharedRecordsByStatusList> getAllPendingRecordsList;
List<GetAllSharedRecordsByStatusList> getAllSharedRecordsByStatusList;
Null getResponseFileList;
List<GetAllSharedRecordsByStatusList> getResponseFileList;
bool isHMGPatient;
bool isLoginSuccessfully;
bool isNeedUpdateIdintificationNo;
bool kioskSendSMS;
Null list;
Null listAskHabibMobileLoginInfo;
Null listAskHabibPatientFile;
Null listMergeFiles;
Null listMobileLoginInfo;
Null listPatientCount;
Null logInTokenID;
Null mohemmPrivilegeList;
dynamic list;
dynamic listAskHabibMobileLoginInfo;
dynamic listAskHabibPatientFile;
dynamic listMergeFiles;
dynamic listMobileLoginInfo;
dynamic listPatientCount;
dynamic logInTokenID;
dynamic mohemmPrivilegeList;
int pateintID;
Null patientBloodType;
Null patientERDriverFile;
Null patientERDriverFileList;
dynamic patientBloodType;
dynamic patientERDriverFile;
dynamic patientERDriverFileList;
bool patientHasFile;
Null patientMergedIDs;
dynamic patientMergedIDs;
bool patientOutSA;
int patientShareRequestID;
int patientType;
int projectIDOut;
Null returnMessage;
dynamic returnMessage;
bool sMSLoginRequired;
Null servicePrivilegeList;
Null sharePatientName;
Null verificationCode;
Null email;
Null errorList;
dynamic servicePrivilegeList;
dynamic sharePatientName;
dynamic verificationCode;
dynamic email;
dynamic errorList;
bool hasFile;
bool isActiveCode;
bool isMerged;
bool isNeedUserAgreement;
bool isSMSSent;
Null memberList;
Null message;
dynamic memberList;
dynamic message;
int statusCode;
GetAllSharedRecordsByStatusResponse(
@ -133,78 +133,92 @@ class GetAllSharedRecordsByStatusResponse {
this.statusCode});
GetAllSharedRecordsByStatusResponse.fromJson(Map<String, dynamic> json) {
date = json['Date'];
languageID = json['LanguageID'];
serviceName = json['ServiceName'];
time = json['Time'];
androidLink = json['AndroidLink'];
authenticationTokenID = json['AuthenticationTokenID'];
data = json['Data'];
dataw = json['Dataw'];
dietType = json['DietType'];
errorCode = json['ErrorCode'];
errorEndUserMessage = json['ErrorEndUserMessage'];
errorEndUserMessageN = json['ErrorEndUserMessageN'];
errorMessage = json['ErrorMessage'];
errorType = json['ErrorType'];
foodCategory = json['FoodCategory'];
iOSLink = json['IOSLink'];
isAuthenticated = json['IsAuthenticated'];
mealOrderStatus = json['MealOrderStatus'];
mealType = json['MealType'];
messageStatus = json['MessageStatus'];
numberOfResultRecords = json['NumberOfResultRecords'];
patientBlodType = json['PatientBlodType'];
successMsg = json['SuccessMsg'];
successMsgN = json['SuccessMsgN'];
doctorInformationList = json['DoctorInformation_List'];
getAllPendingRecordsList = json['GetAllPendingRecordsList'];
if (json['GetAllSharedRecordsByStatusList'] != null) {
getAllSharedRecordsByStatusList =
new List<GetAllSharedRecordsByStatusList>();
json['GetAllSharedRecordsByStatusList'].forEach((v) {
getAllSharedRecordsByStatusList
.add(new GetAllSharedRecordsByStatusList.fromJson(v));
});
try {
date = json['Date'];
languageID = json['LanguageID'];
serviceName = json['ServiceName'];
time = json['Time'];
androidLink = json['AndroidLink'];
authenticationTokenID = json['AuthenticationTokenID'];
data = json['Data'];
dataw = json['Dataw'];
dietType = json['DietType'];
errorCode = json['ErrorCode'];
errorEndUserMessage = json['ErrorEndUserMessage'];
errorEndUserMessageN = json['ErrorEndUserMessageN'];
errorMessage = json['ErrorMessage'];
errorType = json['ErrorType'];
foodCategory = json['FoodCategory'];
iOSLink = json['IOSLink'];
isAuthenticated = json['IsAuthenticated'];
mealOrderStatus = json['MealOrderStatus'];
mealType = json['MealType'];
messageStatus = json['MessageStatus'];
numberOfResultRecords = json['NumberOfResultRecords'];
patientBlodType = json['PatientBlodType'];
successMsg = json['SuccessMsg'];
successMsgN = json['SuccessMsgN'];
doctorInformationList = json['DoctorInformation_List'];
// getAllPendingRecordsList = json['GetAllPendingRecordsList'];
if (json['GetAllPendingRecordsList'] != null) {
getAllSharedRecordsByStatusList = new List<GetAllSharedRecordsByStatusList>();
json['GetAllPendingRecordsList'].forEach((v) {
getAllSharedRecordsByStatusList
.add(new GetAllSharedRecordsByStatusList.fromJson(v));
});
}
if (json['GetAllSharedRecordsByStatusList'] != null) {
getAllSharedRecordsByStatusList = new List<GetAllSharedRecordsByStatusList>();
json['GetAllSharedRecordsByStatusList'].forEach((v) {
getAllSharedRecordsByStatusList
.add(new GetAllSharedRecordsByStatusList.fromJson(v));
});
}
getResponseFileList = json['GetResponseFileList'];
isHMGPatient = json['IsHMGPatient'];
isLoginSuccessfully = json['IsLoginSuccessfully'];
isNeedUpdateIdintificationNo = json['IsNeedUpdateIdintificationNo'];
kioskSendSMS = json['KioskSendSMS'];
list = json['List'];
listAskHabibMobileLoginInfo = json['List_AskHabibMobileLoginInfo'];
listAskHabibPatientFile = json['List_AskHabibPatientFile'];
listMergeFiles = json['List_MergeFiles'];
listMobileLoginInfo = json['List_MobileLoginInfo'];
listPatientCount = json['List_PatientCount'];
logInTokenID = json['LogInTokenID'];
mohemmPrivilegeList = json['MohemmPrivilege_List'];
pateintID = json['PateintID'];
patientBloodType = json['PatientBloodType'];
patientERDriverFile = json['PatientER_DriverFile'];
patientERDriverFileList = json['PatientER_DriverFileList'];
patientHasFile = json['PatientHasFile'];
patientMergedIDs = json['PatientMergedIDs'];
patientOutSA = json['PatientOutSA'];
patientShareRequestID = json['PatientShareRequestID'];
patientType = json['PatientType'];
projectIDOut = json['ProjectIDOut'];
returnMessage = json['ReturnMessage'];
sMSLoginRequired = json['SMSLoginRequired'];
servicePrivilegeList = json['ServicePrivilege_List'];
sharePatientName = json['SharePatientName'];
verificationCode = json['VerificationCode'];
email = json['email'];
errorList = json['errorList'];
hasFile = json['hasFile'];
isActiveCode = json['isActiveCode'];
isMerged = json['isMerged'];
isNeedUserAgreement = json['isNeedUserAgreement'];
isSMSSent = json['isSMSSent'];
memberList = json['memberList'];
message = json['message'];
statusCode = json['statusCode'];
}catch (e){
var asd ="";
print(e);
}
getResponseFileList = json['GetResponseFileList'];
isHMGPatient = json['IsHMGPatient'];
isLoginSuccessfully = json['IsLoginSuccessfully'];
isNeedUpdateIdintificationNo = json['IsNeedUpdateIdintificationNo'];
kioskSendSMS = json['KioskSendSMS'];
list = json['List'];
listAskHabibMobileLoginInfo = json['List_AskHabibMobileLoginInfo'];
listAskHabibPatientFile = json['List_AskHabibPatientFile'];
listMergeFiles = json['List_MergeFiles'];
listMobileLoginInfo = json['List_MobileLoginInfo'];
listPatientCount = json['List_PatientCount'];
logInTokenID = json['LogInTokenID'];
mohemmPrivilegeList = json['MohemmPrivilege_List'];
pateintID = json['PateintID'];
patientBloodType = json['PatientBloodType'];
patientERDriverFile = json['PatientER_DriverFile'];
patientERDriverFileList = json['PatientER_DriverFileList'];
patientHasFile = json['PatientHasFile'];
patientMergedIDs = json['PatientMergedIDs'];
patientOutSA = json['PatientOutSA'];
patientShareRequestID = json['PatientShareRequestID'];
patientType = json['PatientType'];
projectIDOut = json['ProjectIDOut'];
returnMessage = json['ReturnMessage'];
sMSLoginRequired = json['SMSLoginRequired'];
servicePrivilegeList = json['ServicePrivilege_List'];
sharePatientName = json['SharePatientName'];
verificationCode = json['VerificationCode'];
email = json['email'];
errorList = json['errorList'];
hasFile = json['hasFile'];
isActiveCode = json['isActiveCode'];
isMerged = json['isMerged'];
isNeedUserAgreement = json['isNeedUserAgreement'];
isSMSSent = json['isSMSSent'];
memberList = json['memberList'];
message = json['message'];
statusCode = json['statusCode'];
}
Map<String, dynamic> toJson() {
@ -287,7 +301,7 @@ class GetAllSharedRecordsByStatusList {
int responseID;
int regionID;
int status;
Null isActive;
dynamic isActive;
String editedOn;
String createdOn;
String emaiLAddress;

@ -269,7 +269,7 @@ class ConfirmPaymentPage extends StatelessWidget {
DoctorsListService service = new DoctorsListService();
String paymentReference = res['Fort_id'].toString();
service
.createAdvancePayment(appo, res['Amount'], res['Fort_id'],
.createAdvancePayment(appo, appo.projectID.toString(), res['Amount'], res['Fort_id'],
res['PaymentMethod'], AppGlobal.context)
.then((res) {
print(res['OnlineCheckInAppointments'][0]['AdvanceNumber']);

@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResu
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';
@ -101,7 +102,7 @@ class _BookConfirmState extends State<BookConfirm> {
fit: BoxFit.fill, height: 70.0, width: 70.0),
),
Container(
width: MediaQuery.of(context).size.width * 0.6,
width: MediaQuery.of(context).size.width * 0.58,
margin: EdgeInsets.fromLTRB(20.0, 5.0, 10.0, 5.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
@ -303,7 +304,7 @@ class _BookConfirmState extends State<BookConfirm> {
width: 60.0),
),
Container(
width: MediaQuery.of(context).size.width * 0.6,
width: MediaQuery.of(context).size.width * 0.58,
margin: EdgeInsets.fromLTRB(10.0, 5.0, 10.0, 5.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
@ -513,6 +514,9 @@ class _BookConfirmState extends State<BookConfirm> {
widget.patientShareResponse = new PatientShareResponse.fromJson(res);
navigateToBookSuccess(context, docObject, widget.patientShareResponse);
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err);
navigateToHome(context);
print(err);
});
}
@ -528,6 +532,9 @@ class _BookConfirmState extends State<BookConfirm> {
widget.patientShareResponse = new PatientShareResponse.fromJson(res);
navigateToBookSuccess(context, docObject, widget.patientShareResponse);
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err);
navigateToHome(context);
print(err);
});
}
@ -584,6 +591,10 @@ class _BookConfirmState extends State<BookConfirm> {
}
}
Future navigateToHome(context) async {
Navigator.of(context).popAndPushNamed(HOME);
}
Future navigateToBookSuccess(context, DoctorList docObject,
PatientShareResponse patientShareResponse) async {
GifLoaderDialogUtils.hideDialog(context);

@ -12,6 +12,7 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart';
import 'package:flutter/material.dart';
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
import 'package:smart_progress_bar/smart_progress_bar.dart';
import 'QRCode.dart';
@ -21,6 +22,8 @@ class BookSuccess extends StatefulWidget {
DoctorList docObject;
MyInAppBrowser browser;
final ChromeSafariBrowser chromeBrowser =
new MyChromeSafariBrowser(new MyInAppBrowser());
String appoDateFormatted;
String appoTimeFormatted;
@ -78,12 +81,14 @@ class _BookSuccessState extends State<BookSuccess> {
width: 80.0),
),
Container(
width: MediaQuery.of(context).size.width * 0.62,
margin: EdgeInsets.fromLTRB(10.0, 5.0, 10.0, 5.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Text(widget.docObject.projectName,
overflow: TextOverflow.clip,
style: _getTextStyling()),
Container(
margin: EdgeInsets.only(top: 5.0),
@ -93,6 +98,7 @@ class _BookSuccessState extends State<BookSuccess> {
Container(
margin: EdgeInsets.only(top: 5.0, bottom: 3.0),
child: Text(widget.docObject.clinicName,
overflow: TextOverflow.clip,
style: _getTextStyling()),
),
Container(
@ -101,6 +107,7 @@ class _BookSuccessState extends State<BookSuccess> {
widget.appoDateFormatted +
", " +
widget.appoTimeFormatted,
overflow: TextOverflow.clip,
style: _getTextStyling()),
),
Container(
@ -110,7 +117,7 @@ class _BookSuccessState extends State<BookSuccess> {
widget.docObject.doctorTitle +
" " +
widget.docObject.name,
overflow: TextOverflow.ellipsis,
overflow: TextOverflow.clip,
style: _getTextStyling()),
),
],
@ -295,7 +302,8 @@ class _BookSuccessState extends State<BookSuccess> {
appo.appointmentNo =
widget.patientShareResponse.appointmentNo;
appo.serviceID = widget.patientShareResponse.serviceID;
appo.isLiveCareAppointment = widget.patientShareResponse.isLiveCareAppointment;
appo.isLiveCareAppointment =
widget.patientShareResponse.isLiveCareAppointment;
appo.doctorID = widget.patientShareResponse.doctorID;
confirmAppointment(appo);
},
@ -341,8 +349,8 @@ class _BookSuccessState extends State<BookSuccess> {
confirmAppointment(AppoitmentAllHistoryResultList appo) {
DoctorsListService service = new DoctorsListService();
service
.confirmAppointment(
appo.appointmentNo, appo.clinicID, appo.projectID, appo.isLiveCareAppointment, context)
.confirmAppointment(appo.appointmentNo, appo.clinicID, appo.projectID,
appo.isLiveCareAppointment, context)
.then((res) {
if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: res['ErrorEndUserMessage']);
@ -542,22 +550,31 @@ class _BookSuccessState extends State<BookSuccess> {
AuthenticatedUser authenticatedUser,
double amount,
PatientShareResponse patientShareResponse,
AppoitmentAllHistoryResultList appo) {
widget.browser = new MyInAppBrowser(
onExitCallback: onBrowserExit,
appo: appo,
onLoadStartCallback: onBrowserLoadStart);
widget.browser.openPaymentBrowser(
amount,
"Appointment check in",
Utils.getAppointmentTransID(
appo.projectID, appo.clinicID, appo.appointmentNo),
appo.projectID.toString(),
authenticatedUser.emailAddress,
paymentMethod,
authenticatedUser,
widget.browser);
AppoitmentAllHistoryResultList appo) async {
if (paymentMethod == "ApplePay") {
await widget.chromeBrowser.open(
url: "https://flutter.dev/",
options: ChromeSafariBrowserClassOptions(
android: AndroidChromeCustomTabsOptions(
addDefaultShareMenuItem: false),
ios: IOSSafariOptions(barCollapsingEnabled: true)));
} else {
widget.browser = new MyInAppBrowser(
onExitCallback: onBrowserExit,
appo: appo,
onLoadStartCallback: onBrowserLoadStart);
widget.browser.openPaymentBrowser(
amount,
"Appointment check in",
Utils.getAppointmentTransID(
appo.projectID, appo.clinicID, appo.appointmentNo),
appo.projectID.toString(),
authenticatedUser.emailAddress,
paymentMethod,
authenticatedUser,
widget.browser);
}
}
onBrowserLoadStart(String url) {
@ -608,12 +625,34 @@ class _BookSuccessState extends State<BookSuccess> {
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
}
getApplePayAPQ(AppoitmentAllHistoryResultList appo) {
DoctorsListService service = new DoctorsListService();
service
.checkPaymentStatus(
Utils.getAppointmentTransID(
appo.projectID, appo.clinicID, appo.appointmentNo),
context)
.then((res) {
print("Printing Payment Status Reponse!!!!");
print(res);
String paymentInfo = res['Response_Message'];
if (paymentInfo == 'Success') {
createAdvancePayment(res, appo);
} else {
AppToast.showErrorToast(message: res['Response_Message']);
}
}).catchError((err) {
print(err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
}
createAdvancePayment(res, AppoitmentAllHistoryResultList appo) {
DoctorsListService service = new DoctorsListService();
String paymentReference = res['Fort_id'].toString();
service
.createAdvancePayment(
appo, res['Amount'], res['Fort_id'], res['PaymentMethod'], context)
appo, appo.projectID.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], context)
.then((res) {
print(res['OnlineCheckInAppointments'][0]['AdvanceNumber']);
addAdvancedNumberRequest(

@ -252,7 +252,9 @@ class _QRCodeState extends State<QRCode> {
ConfirmDialog.closeAlertDialog(context);
AppToast.showErrorToast(message: err);
print(err);
}).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
}).showProgressBar(
text: "Loading",
backgroundColor: Colors.blue.withOpacity(0.6));
},
cancelFunction: () => {});
dialog.showAlertDialog(context);
@ -290,9 +292,11 @@ class _QRCodeState extends State<QRCode> {
String getDoctorSpeciality(List<String> docSpecial) {
String docSpeciality = "";
docSpecial.forEach((v) {
docSpeciality = docSpeciality + v + "\n";
});
if (docSpecial != null && docSpecial.length != 0) {
docSpecial.forEach((v) {
docSpeciality = docSpeciality + v + "\n";
});
}
return docSpeciality;
}
}

@ -235,7 +235,7 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments>
return children;
},
),
onDaySelected: (date, events) {
onDaySelected: (date, events, holidays) {
_onDaySelected(date, events);
_animationController.forward(from: 0.0);
},

@ -348,7 +348,7 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots>
return children;
},
),
onDaySelected: (date, event) {
onDaySelected: (date, event, holidays) {
_onDaySelected(
date,
event,

@ -220,20 +220,171 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
Widget myFamilyRequest(context) {
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 10.0),
child: Column(
children: <Widget>[
// SizedBox(height: 20.0),
RoundedContainer(
child: ExpansionTile(
child: SingleChildScrollView(
child: Column(
children: <Widget>[
// SizedBox(height: 20.0),
RoundedContainer(
child: ExpansionTile(
title: Text(
TranslationBase.of(context).userViewRequest,
style: TextStyle(fontSize: 18.0, fontWeight: FontWeight.bold),
),
children: <Widget>[
FutureBuilder(
future: getUserViewRequest(), // async work
builder: (BuildContext context,
AsyncSnapshot<dynamic> snapshot) {
switch (snapshot.connectionState) {
case ConnectionState.waiting:
return Padding(
padding: EdgeInsets.only(top: 50),
child: Text('Loading....'));
default:
if (snapshot.hasError)
return Padding(
padding: EdgeInsets.all(10),
child: Text('No data found'));
else
return Column(
children: [
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: <Widget>[
Expanded(
flex: 3,
child: Text(TranslationBase.of(context)
.request)),
Expanded(
flex: 2,
child: Text(
TranslationBase.of(context)
.switchUser,
)),
Expanded(
flex: 1,
child: Text(
TranslationBase.of(context)
.deleteView,
)),
],
),
Column(children: [
Row(children: [
Expanded(flex: 3, child: AppText('Name')),
Expanded(flex: 1, child: AppText('Allow')),
Expanded(flex: 1, child: AppText('Reject')),
]),
Column(
children:familyFileProvider.allSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList
.map<Widget>((result) {
return Padding(
padding: EdgeInsets.all(10),
child: Row(
children: <Widget>[
Expanded(
flex: 3,
child:
Text(result.patientName)),
Expanded(
flex: 1,
child: IconButton(
icon: Icon(
Icons.check_circle,
color: Colors.black,
),
onPressed: () {
acceptRequest(
result, context);
},
)),
Expanded(
flex: 1,
child: IconButton(
icon: Icon(
Icons.delete,
color: Colors.black,
),
onPressed: () {
deleteRequest(
result, context);
},
))
],
));
}).toList())
])
],
);
}
})
],
),
),
RoundedContainer(
child: ExpansionTile(
title: Text(
TranslationBase.of(context).userViewRequest,
TranslationBase.of(context).sentRequest,
style: TextStyle(fontSize: 18.0, fontWeight: FontWeight.bold),
),
children: <Widget>[
FutureBuilder(
future: getUserViewRequest(), // async work
future: getSentRequest(), // async work
builder: (BuildContext context,
AsyncSnapshot<dynamic> snapshot) {
AsyncSnapshot<GetAllSharedRecordsByStatusResponse>
snapshot) {
switch (snapshot.connectionState) {
case ConnectionState.waiting:
return Padding(
padding: EdgeInsets.only(top: 50),
child: Text('Loading....'));
default:
if (snapshot.hasError)
return Padding(
padding: EdgeInsets.all(10),
child: Text('No data found'));
else
return SingleChildScrollView(
child: Container(
height: SizeConfig.screenHeight * .3,
child: ListView(
children: snapshot
.data.getAllSharedRecordsByStatusList
.map<Widget>((result) {
return Padding(
padding: EdgeInsets.all(10),
child: Row(
children: <Widget>[
Expanded(
flex: 3,
child:
Text(result.patientName)),
Expanded(
flex: 2,
child: AppText(
result.statusDescription,
color: Colors.red,
)),
],
));
}).toList(),
)));
}
})
],
)),
RoundedContainer(
child: ExpansionTile(
title: Text(
TranslationBase.of(context).userView,
style: TextStyle(fontSize: 18.0, fontWeight: FontWeight.bold),
),
children: <Widget>[
FutureBuilder(
future: getUserViewRequest(), // async work
builder:
(BuildContext context, AsyncSnapshot<dynamic> snapshot) {
switch (snapshot.connectionState) {
case ConnectionState.waiting:
return Padding(
@ -253,31 +404,27 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
children: <Widget>[
Expanded(
flex: 3,
child: Text(TranslationBase.of(context)
.request)),
child: Text(
TranslationBase.of(context).request)),
Expanded(
flex: 2,
child: Text(
TranslationBase.of(context)
.switchUser,
TranslationBase.of(context).switchUser,
)),
Expanded(
flex: 1,
child: Text(
TranslationBase.of(context)
.deleteView,
TranslationBase.of(context).deleteView,
)),
],
),
Column(children: [
Row(children: [
Expanded(flex: 3, child: AppText('Name')),
Expanded(flex: 1, child: AppText('Allow')),
Expanded(flex: 1, child: AppText('Reject')),
Expanded(flex: 1, child: AppText('Delete')),
]),
Column(
children: snapshot
.data['GetAllPendingRecordsList']
children: familyFileProvider.allSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList
.map<Widget>((result) {
return Padding(
padding: EdgeInsets.all(10),
@ -285,20 +432,7 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
children: <Widget>[
Expanded(
flex: 3,
child:
Text(result.patientName)),
Expanded(
flex: 1,
child: IconButton(
icon: Icon(
Icons.check_circle,
color: Colors.black,
),
onPressed: () {
acceptRequest(
result, context);
},
)),
child: Text(result.patientName)),
Expanded(
flex: 1,
child: IconButton(
@ -310,7 +444,7 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
deleteRequest(
result, context);
},
))
)),
],
));
}).toList())
@ -320,143 +454,9 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
}
})
],
),
),
RoundedContainer(
child: ExpansionTile(
title: Text(
TranslationBase.of(context).sentRequest,
style: TextStyle(fontSize: 18.0, fontWeight: FontWeight.bold),
),
children: <Widget>[
FutureBuilder(
future: getSentRequest(), // async work
builder: (BuildContext context,
AsyncSnapshot<GetAllSharedRecordsByStatusResponse>
snapshot) {
switch (snapshot.connectionState) {
case ConnectionState.waiting:
return Padding(
padding: EdgeInsets.only(top: 50),
child: Text('Loading....'));
default:
if (snapshot.hasError)
return Padding(
padding: EdgeInsets.all(10),
child: Text('No data found'));
else
return SingleChildScrollView(
child: Container(
height: SizeConfig.screenHeight * .3,
child: ListView(
children: snapshot
.data.getAllSharedRecordsByStatusList
.map<Widget>((result) {
return Padding(
padding: EdgeInsets.all(10),
child: Row(
children: <Widget>[
Expanded(
flex: 3,
child:
Text(result.patientName)),
Expanded(
flex: 2,
child: AppText(
result.statusDescription,
color: Colors.red,
)),
],
));
}).toList(),
)));
}
})
],
)),
RoundedContainer(
child: ExpansionTile(
title: Text(
TranslationBase.of(context).userView,
style: TextStyle(fontSize: 18.0, fontWeight: FontWeight.bold),
),
children: <Widget>[
FutureBuilder(
future: getUserViewRequest(), // async work
builder:
(BuildContext context, AsyncSnapshot<dynamic> snapshot) {
switch (snapshot.connectionState) {
case ConnectionState.waiting:
return Padding(
padding: EdgeInsets.only(top: 50),
child: Text('Loading....'));
default:
if (snapshot.hasError)
return Padding(
padding: EdgeInsets.all(10),
child: Text('No data found'));
else
return Column(
children: [
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: <Widget>[
Expanded(
flex: 3,
child: Text(
TranslationBase.of(context).request)),
Expanded(
flex: 2,
child: Text(
TranslationBase.of(context).switchUser,
)),
Expanded(
flex: 1,
child: Text(
TranslationBase.of(context).deleteView,
)),
],
),
Column(children: [
Row(children: [
Expanded(flex: 3, child: AppText('Name')),
Expanded(flex: 1, child: AppText('Delete')),
]),
Column(
children: snapshot
.data['GetAllPendingRecordsList']
.map<Widget>((result) {
return Padding(
padding: EdgeInsets.all(10),
child: Row(
children: <Widget>[
Expanded(
flex: 3,
child: Text(result.patientName)),
Expanded(
flex: 1,
child: IconButton(
icon: Icon(
Icons.delete,
color: Colors.black,
),
onPressed: () {
deleteRequest(
result, context);
},
)),
],
));
}).toList())
])
],
);
}
})
],
))
],
))
],
),
),
);
}

@ -1,8 +1,11 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart';
import 'package:diplomaticquarterapp/locator.dart';
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/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
@ -33,12 +36,14 @@ class _MyAppointmentsState extends State<MyAppointments>
bool isDataLoaded = false;
var sharedPref = new AppSharedPreferences();
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
@override
void initState() {
_tabController = new TabController(length: 3, vsync: this);
WidgetsBinding.instance
.addPostFrameCallback((_) => getPatientAppointmentHistory());
WidgetsBinding.instance.addPostFrameCallback((_) {
if (authenticatedUserObject.isLogin) getPatientAppointmentHistory();
});
super.initState();
}
@ -84,6 +89,11 @@ class _MyAppointmentsState extends State<MyAppointments>
widget.bookedAppoList.clear();
widget.confirmedAppoList.clear();
widget.arrivedAppoList.clear();
widget._patientBookedAppointmentListHospital.clear();
widget._patientConfirmedAppointmentListHospital.clear();
widget._patientArrivedAppointmentListHospital.clear();
service.getPatientAppointmentHistory(false, context).then((res) {
print(res['AppoimentAllHistoryResultList'].length);
if (res['MessageStatus'] == 1) {

@ -1,4 +1,6 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart';
import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
@ -7,7 +9,6 @@ import 'package:diplomaticquarterapp/pages/MyAppointments/AppointmentDetails.dar
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';
@ -34,13 +35,15 @@ class _ToDoState extends State<ToDo> {
AppSharedPreferences sharedPref = AppSharedPreferences();
AuthenticatedUser authUser;
AuthProvider authProvider = new AuthProvider();
AuthenticatedUserObject authenticatedUserObject =
locator<AuthenticatedUserObject>();
@override
void initState() {
widget.patientShareResponse = new PatientShareResponse();
WidgetsBinding.instance
.addPostFrameCallback((_) => getPatientAppointmentHistory());
WidgetsBinding.instance.addPostFrameCallback((_) {
if (authenticatedUserObject.isLogin) getPatientAppointmentHistory();
});
super.initState();
}
@ -511,6 +514,7 @@ class _ToDoState extends State<ToDo> {
openPaymentDialog(appo, widget.patientShareResponse);
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err);
print(err);
});
}
@ -660,7 +664,7 @@ class _ToDoState extends State<ToDo> {
String paymentReference = res['Fort_id'].toString();
service
.createAdvancePayment(
appo, res['Amount'], res['Fort_id'], res['PaymentMethod'], context)
appo, appo.projectID.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], context)
.then((res) {
GifLoaderDialogUtils.hideDialog(context);
print(res['OnlineCheckInAppointments'][0]['AdvanceNumber']);

@ -1,6 +1,7 @@
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
class PaymentMethod extends StatefulWidget {
@override
@ -93,35 +94,6 @@ class _PaymentMethodState extends State<PaymentMethod> {
),
),
),
// Expanded(
// child: Container(
// child: InkWell(
// onTap: () {
// updateSelectedPaymentMethod("SADAD");
// },
// child: Card(
// elevation: 3.0,
// margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0),
// color: Colors.white,
// shape: RoundedRectangleBorder(
// borderRadius: BorderRadius.circular(10),
// side: selectedPaymentMethod == "SADAD"
// ? BorderSide(
// color: Colors.green, width: 5.0)
// : BorderSide(
// color: Colors.transparent, width: 0.0),
// ),
// child: Container(
// height: 120.0,
// padding: EdgeInsets.all(7.0),
// width: MediaQuery.of(context).size.width * 0.45,
// child: Image.asset(
// "assets/images/new-design/sadad.png"),
// ),
// ),
// ),
// ),
// ),
],
),
),
@ -195,9 +167,44 @@ class _PaymentMethodState extends State<PaymentMethod> {
margin: EdgeInsets.only(top: 25.0),
child: Flex(
direction: Axis.horizontal,
children: <Widget>[],
children: <Widget>[
Expanded(
child: Container(
child: InkWell(
onTap: () {
updateSelectedPaymentMethod("ApplePay");
},
child: Card(
elevation: 3.0,
margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0),
color: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
side: selectedPaymentMethod == "ApplePay"
? BorderSide(
color: Colors.green, width: 5.0)
: BorderSide(
color: Colors.transparent, width: 0.0),
),
child: Container(
height: 120.0,
padding: EdgeInsets.all(20.0),
child: SvgPicture.asset(
"assets/images/new-design/applepay.svg"),
),
),
),
),
),
Expanded(
child: Container(),
),
],
),
),
SizedBox(
height: 150.0,
),
],
),
),

@ -12,27 +12,21 @@ import 'package:diplomaticquarterapp/pages/BookAppointment/BookingOptions.dart';
import 'package:diplomaticquarterapp/pages/ToDoList/ToDo.dart';
import 'package:diplomaticquarterapp/pages/livecare/incoming_call.dart';
import 'package:diplomaticquarterapp/pages/medical/medical_profile_page.dart';
import 'package:diplomaticquarterapp/pages/medical/my_admissions_page.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart';
import 'package:diplomaticquarterapp/uitl/CalendarUtils.dart';
import 'package:diplomaticquarterapp/uitl/LocalNotification.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/bottom_navigation/bottom_nav_bar.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/buttons/floatingActionButton.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/drawer/app_drawer_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/slide_up_page.dart';
import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
import 'package:flutter_svg/svg.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:provider/provider.dart';
import 'package:rxdart/rxdart.dart';
import '../../locator.dart';
import 'home_page.dart';
@ -144,6 +138,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
_firebaseMessaging.getToken().then((String token) {
sharedPref.setString(PUSH_TOKEN, token);
if (token != null) {
DEVICE_TOKEN = token;
checkUserStatus(token);
}
requestPermissions();

@ -299,6 +299,7 @@ class _ConfirmLogin extends State<ConfirmLogin> {
authService
.checkPatientAuthentication(request)
.then((value) => {
GifLoaderDialogUtils.hideDialog(context),
if (value['isSMSSent'])
{
sharedPref.setString(LOGIN_TOKEN_ID, value['LogInTokenID']),
@ -322,7 +323,6 @@ class _ConfirmLogin extends State<ConfirmLogin> {
sendActivationCode(type) async {
var request = this.getCommonRequest();
// loading(true);
GifLoaderDialogUtils.showMyDialog(context);
await this.authService.sendActivationCode(request).then((result) {
GifLoaderDialogUtils.hideDialog(context);
@ -332,8 +332,6 @@ class _ConfirmLogin extends State<ConfirmLogin> {
}).catchError((r) {
GifLoaderDialogUtils.hideDialog(context);
});
// SMSOTP.showLoadingDialog(context, false),
}
startSMSService(type) {
@ -503,7 +501,6 @@ class _ConfirmLogin extends State<ConfirmLogin> {
sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID),
sharedPref.setString(TOKEN, result.authenticationTokenID),
checkIfUserAgreedBefore(result),
}
}
else

@ -10,6 +10,7 @@ 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/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
@ -30,6 +31,7 @@ class ConfirmPaymentPage extends StatelessWidget {
MyInAppBrowser browser;
AuthenticatedUser authenticatedUser;
AppSharedPreferences sharedPref = AppSharedPreferences();
String transID = "";
ConfirmPaymentPage(
{this.advanceModel,
@ -54,7 +56,7 @@ class ConfirmPaymentPage extends StatelessWidget {
new AppoitmentAllHistoryResultList();
appo.projectID = patientInfoAndMobileNumber.projectID;
openPayment(selectedPaymentMethod, authenticatedUser,
double.parse(advanceModel.amount), appo);
double.parse(advanceModel.amount), null);
}
});
}
@ -205,13 +207,15 @@ class ConfirmPaymentPage extends StatelessWidget {
appo: appo,
onLoadStartCallback: onBrowserLoadStart);
transID = Utils.getAdvancePaymentTransID(
advanceModel.hospitalsModel.iD, int.parse(advanceModel.fileNumber));
browser.openPaymentBrowser(
amount,
"Advance Payment",
Utils.getAdvancePaymentTransID(
authenticatedUser.projectID, authenticatedUser.patientID),
appo.projectID.toString(),
authenticatedUser.emailAddress,
transID,
advanceModel.hospitalsModel.iD.toString(),
advanceModel.email,
paymentMethod,
authenticatedUser,
browser);
@ -244,59 +248,64 @@ class ConfirmPaymentPage extends StatelessWidget {
}
checkPaymentStatus(AppoitmentAllHistoryResultList appo) {
GifLoaderDialogUtils.showMyDialog(AppGlobal.context);
DoctorsListService service = new DoctorsListService();
service
.checkPaymentStatus(
Utils.getAdvancePaymentTransID(
appo.projectID, authenticatedUser.patientID),
AppGlobal.context)
.then((res) {
service.checkPaymentStatus(transID, AppGlobal.context).then((res) {
print("Printing Payment Status Reponse!!!!");
print(res);
String paymentInfo = res['Response_Message'];
if (paymentInfo == 'Success') {
createAdvancePayment(res, appo);
} else {
GifLoaderDialogUtils.hideDialog(AppGlobal.context);
AppToast.showErrorToast(message: res['Response_Message']);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(AppGlobal.context);
AppToast.showErrorToast(message: err);
print(err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
});
}
createAdvancePayment(res, AppoitmentAllHistoryResultList appo) {
DoctorsListService service = new DoctorsListService();
String paymentReference = res['Fort_id'].toString();
service
.createAdvancePayment(appo, res['Amount'], res['Fort_id'],
res['PaymentMethod'], AppGlobal.context)
service.HIS_createAdvancePayment(
appo,
advanceModel.hospitalsModel.iD.toString(),
res['Amount'],
res['Fort_id'],
res['PaymentMethod'],
AppGlobal.context)
.then((res) {
print(res['OnlineCheckInAppointments'][0]['AdvanceNumber']);
addAdvancedNumberRequest(
res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(),
paymentReference,
appo.appointmentNo.toString(),
0,
appo);
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(AppGlobal.context);
AppToast.showErrorToast(message: err);
print(err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
});
}
addAdvancedNumberRequest(String advanceNumber, String paymentReference,
String appointmentID, AppoitmentAllHistoryResultList appo) {
dynamic appointmentID, AppoitmentAllHistoryResultList appo) {
DoctorsListService service = new DoctorsListService();
service
.addAdvancedNumberRequest(
advanceNumber, paymentReference, appointmentID, AppGlobal.context)
.then((res) {
print(res);
GifLoaderDialogUtils.hideDialog(AppGlobal.context);
navigateToHome(AppGlobal.context);
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(AppGlobal.context);
AppToast.showErrorToast(message: err);
print(err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
});
}
Future navigateToHome(context) async {

@ -7,12 +7,12 @@ import 'package:diplomaticquarterapp/core/model/my_balance/AdvanceModel.dart';
import 'package:diplomaticquarterapp/core/model/my_balance/patient_info_and_mobile_number.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:smart_progress_bar/smart_progress_bar.dart';
class ConfirmSMSDialog extends StatefulWidget {
final String phoneNumber;
@ -332,12 +332,11 @@ class _ConfirmSMSDialogState extends State<ConfirmSMSDialog> {
if (verifyAccountForm.currentState.validate()) {
final activationCode =
digit1.text + digit2.text + digit3.text + digit4.text;
GifLoaderDialogUtils.showMyDialog(AppGlobal.context);
model
.checkActivationCodeForAdvancePayment(activationCode: activationCode)
.then((value) {})
.showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6))
.then((value) {
GifLoaderDialogUtils.hideDialog(AppGlobal.context);
Navigator.pop(context, true);
});
}

@ -6,7 +6,6 @@ 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/LiveCare/insertVIDARequest.dart';
import 'package:diplomaticquarterapp/models/Request.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
@ -813,7 +812,7 @@ class DoctorsListService extends BaseService {
Future<Map> addAdvancedNumberRequest(
String advanceNumber,
String paymentReference,
String appointmentID,
dynamic appointmentID,
BuildContext context) async {
Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
@ -1109,6 +1108,7 @@ class DoctorsListService extends BaseService {
Future<Map> createAdvancePayment(
AppoitmentAllHistoryResultList appo,
String projectID,
double payedAmount,
String paymentReference,
String paymentMethodName,
@ -1122,9 +1122,9 @@ class DoctorsListService extends BaseService {
var languageID = await sharedPref.getString(APP_LANGUAGE);
Request req = appGlobal.getPublicRequest();
request = {
"ProjectID": appo.projectID.toString(),
"ProjectID": projectID,
"OnlineCheckInAppointment": {
"AppointmentNo": appo.appointmentNo.toString(),
"AppointmentNo": appo != null ? appo.appointmentNo.toString() : "0",
"PaymentMethodName": paymentMethodName,
"PaymentAmount": payedAmount == 0 ? "0" : payedAmount.toString(),
"PaymentDate": payedAmount == 0
@ -1133,9 +1133,9 @@ class DoctorsListService extends BaseService {
DateTime.now().millisecondsSinceEpoch.toString() +
")/",
"PaymentReferenceNumber": payedAmount == 0 ? "" : paymentReference,
"ProjectID": appo.projectID.toString(),
"ProjectID": appo != null ? appo.projectID.toString() : projectID,
"PatientID": authUser.patientID,
"ClinicID": appo.clinicID,
"ClinicID": appo != null ? appo.clinicID : "0",
"UserID": authUser.patientID,
"Status": authUser.patientType
},
@ -1161,4 +1161,56 @@ class DoctorsListService extends BaseService {
}, body: request);
return Future.value(localRes);
}
Future<Map> HIS_createAdvancePayment(
AppoitmentAllHistoryResultList appo,
String projectID,
double payedAmount,
String paymentReference,
String paymentMethodName,
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 = {
"CustName": authUser.firstName + " " + authUser.lastName,
"CustID": authUser.patientID,
"SetupID": "010266",
"ProjectID": projectID,
"PatientID": authUser.patientID,
"AccountID": authUser.patientID,
"PaymentAmount": payedAmount,
"NationalityID": null,
"DepositorName": authUser.firstName + " " + authUser.lastName,
"CreatedBy": 3,
"PaymentMethodName": paymentMethodName,
"PaymentReference": paymentReference,
"PaymentMethod": paymentMethodName,
"VersionID": req.VersionID,
"Channel": req.Channel,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress,
"generalid": req.generalid,
"PatientOutSA": authUser.outSA,
"SessionID": "YckwoXhUmWBsnHKEKig",
"isDentalAllowedBackend": false,
"TokenID": "@dm!n",
"PatientTypeID": authUser.patientType,
"PatientType": authUser.patientType
};
dynamic localRes;
await baseAppClient.post(HIS_CREATE_ADVANCE_PAYMENT,
onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
return Future.value(localRes);
}
}

@ -58,6 +58,8 @@ class ClinicListService extends BaseService {
"TokenID": "",
"IsActiveAppointment": true,
"DeviceTypeID": req.DeviceTypeID,
"PatientType": user.patientType,
"PatientTypeID": user.patientType,
"SessionID": null
};

@ -42,7 +42,7 @@ class FamilyFilesProvider with ChangeNotifier {
bool isLogin = false;
bool isLoading = true;
dynamic authenticatedUser;
GetAllSharedRecordsByStatusResponse allSharedRecordsByStatusResponse;
Future<GetAllSharedRecordsByStatusResponse> getSharedRecordByStatus() async {
try {
dynamic localRes;
@ -64,7 +64,7 @@ class FamilyFilesProvider with ChangeNotifier {
}
}
Future getUserViewRequest(responseID) async {
Future<GetAllSharedRecordsByStatusResponse> getUserViewRequest(responseID) async {
try {
dynamic localRes;
Map<String, dynamic> request = {};
@ -73,14 +73,17 @@ class FamilyFilesProvider with ChangeNotifier {
onSuccess: (dynamic response, int statusCode) {
localRes = response;
}, onFailure: (String error, int statusCode) {
return Future.value(error);
return Future.error(error);
}, body: request);
if(localRes!=null){
sharedPref.setObject(FAMILY_FILE, localRes);
return Future.value(
GetAllSharedRecordsByStatusResponse.fromJson(localRes));
allSharedRecordsByStatusResponse = GetAllSharedRecordsByStatusResponse.fromJson(localRes);
return Future.value(allSharedRecordsByStatusResponse);}
else
return Future.error("No Data");
} catch (error) {
print(error);
throw error;
return Future.error(error);
}
}

@ -1,4 +1,6 @@
import 'package:badges/badges.dart';
import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart';
import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
@ -14,7 +16,7 @@ class BottomNavigationItem extends StatelessWidget {
final int currentIndex;
final String name;
var authProvider = new AuthProvider();
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
BottomNavigationItem(
{this.icon,
@ -64,7 +66,7 @@ class BottomNavigationItem extends StatelessWidget {
),
],
)
: authProvider.isLogin
: authenticatedUserObject.isLogin
? Stack(
alignment: AlignmentDirectional.center,
children: [

@ -1,6 +1,8 @@
import 'dart:convert';
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/my_balance/AdvanceModel.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
@ -38,6 +40,8 @@ class MyInAppBrowser extends InAppBrowser {
AuthenticatedUser authUser;
AppoitmentAllHistoryResultList appo;
String deviceToken;
static bool isPaymentDone = false;
MyInAppBrowser({this.onExitCallback, this.appo, this.onLoadStartCallback});
@ -83,9 +87,9 @@ class MyInAppBrowser extends InAppBrowser {
return await sharedPref.getString(APP_LANGUAGE);
}
Future<String> getDeviceToken() async {
getDeviceToken() async {
String deviceToken = await sharedPref.getString(PUSH_TOKEN);
return deviceToken;
this.deviceToken = deviceToken;
}
getPatientData() async {
@ -97,15 +101,15 @@ class MyInAppBrowser extends InAppBrowser {
}
openPaymentBrowser(
double amount,
String orderDesc,
String transactionID,
String projId,
String emailId,
String paymentMethod,
AuthenticatedUser authenticatedUser,
InAppBrowser browser,
) {
double amount,
String orderDesc,
String transactionID,
String projId,
String emailId,
String paymentMethod,
AuthenticatedUser authenticatedUser,
InAppBrowser browser) {
getDeviceToken();
this.browser = browser;
this.browser.openUrl(
url: generateURL(amount, orderDesc, transactionID, projId, emailId,
@ -131,12 +135,6 @@ class MyInAppBrowser extends InAppBrowser {
getPatientData();
String currentLanguageID = getLanguageID() == 'ar' ? 'AR' : 'EN';
String form = getForm();
String deviceToken;
getDeviceToken().then((value) {
print(value);
deviceToken = value;
});
if (authUser != null) {
form = form.replaceFirst("EMAIL_VALUE", authUser.emailAddress);
@ -153,21 +151,13 @@ class MyInAppBrowser extends InAppBrowser {
form = form.replaceFirst('LANG_VALUE', currentLanguageID);
form = form.replaceFirst('PATIENT_OUT_SA',
authUser.outSA == 0 ? false.toString() : true.toString());
form = form.replaceFirst(
'PATIENT_TYPE_ID',
patientData == null
? authUser.patientType.toString()
: patientData.PatientType);
form = form.replaceFirst('PATIENT_TYPE_ID',
patientData == null ? authUser.patientType.toString() : "1");
// form = form.replaceFirst('DEVICE_TOKEN', this.cs.sharedService.getSharedData(AuthenticationService.DEVICE_TOKEN, false) + "," + this.cs.sharedService.getSharedData(AuthenticationService.APNS_TOKEN, false));
// form = form.replaceFirst('LATITUDE_VALUE', this.cs.sharedService.getSharedData('userLat', false));
// form = form.replaceFirst('LONGITUDE_VALUE', this.cs.sharedService.getSharedData('userLong', false));
form = form.replaceFirst('LATITUDE_VALUE', "24.708488");
form = form.replaceFirst('LONGITUDE_VALUE', "46.665925");
form = form.replaceFirst('DEVICE_TOKEN',
"e8wKxa4EGK8:APA91bGtygxh5E22pSARVKlngyi0iQbyRUvvUWiCIsaAcbE0hiffhUR094WVx22O5bsvwc706LspzIuJthUyK_748jzuaedD-ZwDm9BX_yyYV2K2YnuFBlHQ9pOKy65RfoprtvqyTN1O");
if (servID == "4")
form = form.replaceFirst(
'SERVICE_URL_VALUE', MyInAppBrowser.PREAUTH_SERVICE_URL);
@ -186,10 +176,14 @@ class MyInAppBrowser extends InAppBrowser {
form = form.replaceFirst('CUSTNAME_VALUE', authUser.firstName);
form = form.replaceFirst('CUSTID_VALUE', authUser.patientID.toString());
} else {
form = form.replaceFirst('CUSTNAME_VALUE', patientData.FirstName);
form = form.replaceFirst('CUSTID_VALUE', patientData.PatientID);
form = form.replaceFirst('CUSTNAME_VALUE', patientData.depositorName);
form = form.replaceFirst('CUSTID_VALUE', patientData.fileNumber);
}
form = form.replaceFirst('LATITUDE_VALUE', "24.708488");
form = form.replaceFirst('LONGITUDE_VALUE', "46.665925");
form = form.replaceFirst('DEVICE_TOKEN', DEVICE_TOKEN);
var bytes = utf8.encode(form);
var base64Str = base64.encode(bytes);
print(form);
@ -229,3 +223,22 @@ class MyInAppBrowser extends InAppBrowser {
'</html>';
}
}
class MyChromeSafariBrowser extends ChromeSafariBrowser {
MyChromeSafariBrowser(browserFallback) : super(bFallback: browserFallback);
@override
void onOpened() {
print("ChromeSafari browser opened");
}
@override
void onCompletedInitialLoad() {
print("ChromeSafari browser initial load completed");
}
@override
void onClosed() {
print("ChromeSafari browser closed");
}
}

Loading…
Cancel
Save