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

merge-update-with-lab-changes
Sultan Khan 5 years ago
commit cced69502a

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

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

@ -2,10 +2,13 @@ import 'dart:convert';
import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.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_advance_balance_amount.dart';
import 'package:diplomaticquarterapp/core/model/my_balance/patient_info.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/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/core/service/base_service.dart';
import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart';
import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordsByStatusReq.dart'; import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordsByStatusReq.dart';
import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart'; import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart';
@ -21,6 +24,8 @@ class MyBalanceService extends BaseService {
String logInTokenID; String logInTokenID;
String verificationCode; String verificationCode;
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
getPatientAdvanceBalanceAmount() async { getPatientAdvanceBalanceAmount() async {
hasError = false; hasError = false;
super.error = ""; super.error = "";
@ -61,8 +66,8 @@ class MyBalanceService extends BaseService {
super.error = ""; super.error = "";
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['isDentalAllowedBackend'] = false; body['isDentalAllowedBackend'] = false;
body['MobileNo'] = user.mobileNumber; body['MobileNo'] = authenticatedUserObject.user.mobileNumber;
body['ProjectID'] = user.projectID; body['ProjectID'] = authenticatedUserObject.user.projectID;
await baseAppClient.post(GET_PATIENT_INFO_BY_ID_AND_MOBILE_NUMBER, await baseAppClient.post(GET_PATIENT_INFO_BY_ID_AND_MOBILE_NUMBER,
onSuccess: (response, statusCode) async { 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/blood_groub_details.dart';
import 'package:diplomaticquarterapp/core/model/blooddonation/get_all_cities.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/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_advance_balance_amount.dart';
import 'package:diplomaticquarterapp/core/model/my_balance/patient_info.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/model/my_balance/patient_info_and_mobile_number.dart';
@ -25,11 +26,15 @@ class MyBalanceViewModel extends BaseViewModel {
_myBalanceService.patientAdvanceBalanceAmountList; _myBalanceService.patientAdvanceBalanceAmountList;
//======================== //========================
BloodDonationService _bloodDonationService =locator<BloodDonationService>(); BloodDonationService _bloodDonationService = locator<BloodDonationService>();
List<CitiesModel> get CitiesModelList => _bloodDonationService.CitiesModelList;
BloodDetailsService _bloodDetailsService =locator<BloodDetailsService>();
List<List_BloodGroupDetailsModel> get BloodDetailsModelList => _bloodDetailsService.BloodModelList;//_bloodDonationService.CitiesModelList;
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 => PatientInfoAndMobileNumber get patientInfoAndMobileNumber =>
_myBalanceService.patientInfoAndMobileNumber; _myBalanceService.patientInfoAndMobileNumber;
String get logInTokenID => _myBalanceService.logInTokenID; String get logInTokenID => _myBalanceService.logInTokenID;
String get verificationCode => _myBalanceService.verificationCode; String get verificationCode => _myBalanceService.verificationCode;
getPatientAdvanceBalanceAmount() async { getPatientAdvanceBalanceAmount() async {
@ -68,6 +73,7 @@ class MyBalanceViewModel extends BaseViewModel {
} else } else
setState(ViewState.Idle); setState(ViewState.Idle);
} }
//============== //==============
Future getCities() async { Future getCities() async {
setState(ViewState.Busy); setState(ViewState.Busy);
@ -79,9 +85,11 @@ class MyBalanceViewModel extends BaseViewModel {
} else } else
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future getBlood() async { Future getBlood() async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _bloodDetailsService .getAllBloodOrders();; await _bloodDetailsService.getAllBloodOrders();
;
if (_bloodDetailsService.hasError) { if (_bloodDetailsService.hasError) {
error = _bloodDetailsService.error; error = _bloodDetailsService.error;
@ -89,6 +97,7 @@ class MyBalanceViewModel extends BaseViewModel {
} else } else
setState(ViewState.Idle); setState(ViewState.Idle);
} }
//=============== //===============
Future getPatientInfoByPatientID({String id}) async { Future getPatientInfoByPatientID({String id}) async {
@ -105,7 +114,8 @@ class MyBalanceViewModel extends BaseViewModel {
Future getPatientInfoByPatientIDAndMobileNumber() async { Future getPatientInfoByPatientIDAndMobileNumber() async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _myBalanceService.getPatientInfoByPatientIDAndMobileNumber(); await _myBalanceService
.getPatientInfoByPatientIDAndMobileNumber();
if (_myBalanceService.hasError) { if (_myBalanceService.hasError) {
error = _myBalanceService.error; error = _myBalanceService.error;
setState(ViewState.ErrorLocal); 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); setState(ViewState.Busy);
await _myBalanceService.sendActivationCodeForAdvancePayment(patientID: patientID,projectID: projectID); await _myBalanceService.sendActivationCodeForAdvancePayment(
patientID: patientID, projectID: projectID);
if (_myBalanceService.hasError) { if (_myBalanceService.hasError) {
error = _myBalanceService.error; error = _myBalanceService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
@ -126,9 +138,12 @@ class MyBalanceViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
} }
Future checkActivationCodeForAdvancePayment({String activationCode}) async {
Future checkActivationCodeForAdvancePayment(
{String activationCode, String patientMobileNumber}) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _myBalanceService.checkActivationCodeForAdvancePayment(activationCode: activationCode); await _myBalanceService.checkActivationCodeForAdvancePayment(
activationCode: activationCode);
if (_myBalanceService.hasError) { if (_myBalanceService.hasError) {
error = _myBalanceService.error; error = _myBalanceService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);

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

@ -1,68 +1,68 @@
class GetAllSharedRecordsByStatusResponse { class GetAllSharedRecordsByStatusResponse {
Null date; dynamic date;
int languageID; int languageID;
int serviceName; int serviceName;
Null time; dynamic time;
Null androidLink; dynamic androidLink;
Null authenticationTokenID; dynamic authenticationTokenID;
Null data; dynamic data;
bool dataw; bool dataw;
int dietType; int dietType;
Null errorCode; dynamic errorCode;
Null errorEndUserMessage; dynamic errorEndUserMessage;
Null errorEndUserMessageN; dynamic errorEndUserMessageN;
Null errorMessage; dynamic errorMessage;
int errorType; int errorType;
int foodCategory; int foodCategory;
Null iOSLink; dynamic iOSLink;
bool isAuthenticated; bool isAuthenticated;
int mealOrderStatus; int mealOrderStatus;
int mealType; int mealType;
int messageStatus; int messageStatus;
int numberOfResultRecords; int numberOfResultRecords;
Null patientBlodType; dynamic patientBlodType;
Null successMsg; dynamic successMsg;
Null successMsgN; dynamic successMsgN;
Null doctorInformationList; dynamic doctorInformationList;
Null getAllPendingRecordsList; List<GetAllSharedRecordsByStatusList> getAllPendingRecordsList;
List<GetAllSharedRecordsByStatusList> getAllSharedRecordsByStatusList; List<GetAllSharedRecordsByStatusList> getAllSharedRecordsByStatusList;
Null getResponseFileList; List<GetAllSharedRecordsByStatusList> getResponseFileList;
bool isHMGPatient; bool isHMGPatient;
bool isLoginSuccessfully; bool isLoginSuccessfully;
bool isNeedUpdateIdintificationNo; bool isNeedUpdateIdintificationNo;
bool kioskSendSMS; bool kioskSendSMS;
Null list; dynamic list;
Null listAskHabibMobileLoginInfo; dynamic listAskHabibMobileLoginInfo;
Null listAskHabibPatientFile; dynamic listAskHabibPatientFile;
Null listMergeFiles; dynamic listMergeFiles;
Null listMobileLoginInfo; dynamic listMobileLoginInfo;
Null listPatientCount; dynamic listPatientCount;
Null logInTokenID; dynamic logInTokenID;
Null mohemmPrivilegeList; dynamic mohemmPrivilegeList;
int pateintID; int pateintID;
Null patientBloodType; dynamic patientBloodType;
Null patientERDriverFile; dynamic patientERDriverFile;
Null patientERDriverFileList; dynamic patientERDriverFileList;
bool patientHasFile; bool patientHasFile;
Null patientMergedIDs; dynamic patientMergedIDs;
bool patientOutSA; bool patientOutSA;
int patientShareRequestID; int patientShareRequestID;
int patientType; int patientType;
int projectIDOut; int projectIDOut;
Null returnMessage; dynamic returnMessage;
bool sMSLoginRequired; bool sMSLoginRequired;
Null servicePrivilegeList; dynamic servicePrivilegeList;
Null sharePatientName; dynamic sharePatientName;
Null verificationCode; dynamic verificationCode;
Null email; dynamic email;
Null errorList; dynamic errorList;
bool hasFile; bool hasFile;
bool isActiveCode; bool isActiveCode;
bool isMerged; bool isMerged;
bool isNeedUserAgreement; bool isNeedUserAgreement;
bool isSMSSent; bool isSMSSent;
Null memberList; dynamic memberList;
Null message; dynamic message;
int statusCode; int statusCode;
GetAllSharedRecordsByStatusResponse( GetAllSharedRecordsByStatusResponse(
@ -133,78 +133,92 @@ class GetAllSharedRecordsByStatusResponse {
this.statusCode}); this.statusCode});
GetAllSharedRecordsByStatusResponse.fromJson(Map<String, dynamic> json) { GetAllSharedRecordsByStatusResponse.fromJson(Map<String, dynamic> json) {
date = json['Date']; try {
languageID = json['LanguageID']; date = json['Date'];
serviceName = json['ServiceName']; languageID = json['LanguageID'];
time = json['Time']; serviceName = json['ServiceName'];
androidLink = json['AndroidLink']; time = json['Time'];
authenticationTokenID = json['AuthenticationTokenID']; androidLink = json['AndroidLink'];
data = json['Data']; authenticationTokenID = json['AuthenticationTokenID'];
dataw = json['Dataw']; data = json['Data'];
dietType = json['DietType']; dataw = json['Dataw'];
errorCode = json['ErrorCode']; dietType = json['DietType'];
errorEndUserMessage = json['ErrorEndUserMessage']; errorCode = json['ErrorCode'];
errorEndUserMessageN = json['ErrorEndUserMessageN']; errorEndUserMessage = json['ErrorEndUserMessage'];
errorMessage = json['ErrorMessage']; errorEndUserMessageN = json['ErrorEndUserMessageN'];
errorType = json['ErrorType']; errorMessage = json['ErrorMessage'];
foodCategory = json['FoodCategory']; errorType = json['ErrorType'];
iOSLink = json['IOSLink']; foodCategory = json['FoodCategory'];
isAuthenticated = json['IsAuthenticated']; iOSLink = json['IOSLink'];
mealOrderStatus = json['MealOrderStatus']; isAuthenticated = json['IsAuthenticated'];
mealType = json['MealType']; mealOrderStatus = json['MealOrderStatus'];
messageStatus = json['MessageStatus']; mealType = json['MealType'];
numberOfResultRecords = json['NumberOfResultRecords']; messageStatus = json['MessageStatus'];
patientBlodType = json['PatientBlodType']; numberOfResultRecords = json['NumberOfResultRecords'];
successMsg = json['SuccessMsg']; patientBlodType = json['PatientBlodType'];
successMsgN = json['SuccessMsgN']; successMsg = json['SuccessMsg'];
doctorInformationList = json['DoctorInformation_List']; successMsgN = json['SuccessMsgN'];
getAllPendingRecordsList = json['GetAllPendingRecordsList']; doctorInformationList = json['DoctorInformation_List'];
if (json['GetAllSharedRecordsByStatusList'] != null) { // getAllPendingRecordsList = json['GetAllPendingRecordsList'];
getAllSharedRecordsByStatusList =
new List<GetAllSharedRecordsByStatusList>(); if (json['GetAllPendingRecordsList'] != null) {
json['GetAllSharedRecordsByStatusList'].forEach((v) { getAllSharedRecordsByStatusList = new List<GetAllSharedRecordsByStatusList>();
getAllSharedRecordsByStatusList json['GetAllPendingRecordsList'].forEach((v) {
.add(new GetAllSharedRecordsByStatusList.fromJson(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() { Map<String, dynamic> toJson() {
@ -287,7 +301,7 @@ class GetAllSharedRecordsByStatusList {
int responseID; int responseID;
int regionID; int regionID;
int status; int status;
Null isActive; dynamic isActive;
String editedOn; String editedOn;
String createdOn; String createdOn;
String emaiLAddress; String emaiLAddress;

@ -269,7 +269,7 @@ class ConfirmPaymentPage extends StatelessWidget {
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
String paymentReference = res['Fort_id'].toString(); String paymentReference = res['Fort_id'].toString();
service service
.createAdvancePayment(appo, res['Amount'], res['Fort_id'], .createAdvancePayment(appo, appo.projectID.toString(), res['Amount'], res['Fort_id'],
res['PaymentMethod'], AppGlobal.context) res['PaymentMethod'], AppGlobal.context)
.then((res) { .then((res) {
print(res['OnlineCheckInAppointments'][0]['AdvanceNumber']); 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/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart'; import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.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/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
@ -101,7 +102,7 @@ class _BookConfirmState extends State<BookConfirm> {
fit: BoxFit.fill, height: 70.0, width: 70.0), fit: BoxFit.fill, height: 70.0, width: 70.0),
), ),
Container( 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), margin: EdgeInsets.fromLTRB(20.0, 5.0, 10.0, 5.0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -303,7 +304,7 @@ class _BookConfirmState extends State<BookConfirm> {
width: 60.0), width: 60.0),
), ),
Container( 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), margin: EdgeInsets.fromLTRB(10.0, 5.0, 10.0, 5.0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -513,6 +514,9 @@ class _BookConfirmState extends State<BookConfirm> {
widget.patientShareResponse = new PatientShareResponse.fromJson(res); widget.patientShareResponse = new PatientShareResponse.fromJson(res);
navigateToBookSuccess(context, docObject, widget.patientShareResponse); navigateToBookSuccess(context, docObject, widget.patientShareResponse);
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err);
navigateToHome(context);
print(err); print(err);
}); });
} }
@ -528,6 +532,9 @@ class _BookConfirmState extends State<BookConfirm> {
widget.patientShareResponse = new PatientShareResponse.fromJson(res); widget.patientShareResponse = new PatientShareResponse.fromJson(res);
navigateToBookSuccess(context, docObject, widget.patientShareResponse); navigateToBookSuccess(context, docObject, widget.patientShareResponse);
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err);
navigateToHome(context);
print(err); 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, Future navigateToBookSuccess(context, DoctorList docObject,
PatientShareResponse patientShareResponse) async { PatientShareResponse patientShareResponse) async {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);

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

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

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

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

@ -220,20 +220,171 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
Widget myFamilyRequest(context) { Widget myFamilyRequest(context) {
return Padding( return Padding(
padding: const EdgeInsets.symmetric(horizontal: 10.0), padding: const EdgeInsets.symmetric(horizontal: 10.0),
child: Column( child: SingleChildScrollView(
children: <Widget>[ child: Column(
// SizedBox(height: 20.0), children: <Widget>[
RoundedContainer( // SizedBox(height: 20.0),
child: ExpansionTile( 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( title: Text(
TranslationBase.of(context).userViewRequest, TranslationBase.of(context).sentRequest,
style: TextStyle(fontSize: 18.0, fontWeight: FontWeight.bold), style: TextStyle(fontSize: 18.0, fontWeight: FontWeight.bold),
), ),
children: <Widget>[ children: <Widget>[
FutureBuilder( FutureBuilder(
future: getUserViewRequest(), // async work future: getSentRequest(), // async work
builder: (BuildContext context, 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) { switch (snapshot.connectionState) {
case ConnectionState.waiting: case ConnectionState.waiting:
return Padding( return Padding(
@ -253,31 +404,27 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
flex: 3, flex: 3,
child: Text(TranslationBase.of(context) child: Text(
.request)), TranslationBase.of(context).request)),
Expanded( Expanded(
flex: 2, flex: 2,
child: Text( child: Text(
TranslationBase.of(context) TranslationBase.of(context).switchUser,
.switchUser,
)), )),
Expanded( Expanded(
flex: 1, flex: 1,
child: Text( child: Text(
TranslationBase.of(context) TranslationBase.of(context).deleteView,
.deleteView,
)), )),
], ],
), ),
Column(children: [ Column(children: [
Row(children: [ Row(children: [
Expanded(flex: 3, child: AppText('Name')), Expanded(flex: 3, child: AppText('Name')),
Expanded(flex: 1, child: AppText('Allow')), Expanded(flex: 1, child: AppText('Delete')),
Expanded(flex: 1, child: AppText('Reject')),
]), ]),
Column( Column(
children: snapshot children: familyFileProvider.allSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList
.data['GetAllPendingRecordsList']
.map<Widget>((result) { .map<Widget>((result) {
return Padding( return Padding(
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
@ -285,20 +432,7 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
flex: 3, flex: 3,
child: child: Text(result.patientName)),
Text(result.patientName)),
Expanded(
flex: 1,
child: IconButton(
icon: Icon(
Icons.check_circle,
color: Colors.black,
),
onPressed: () {
acceptRequest(
result, context);
},
)),
Expanded( Expanded(
flex: 1, flex: 1,
child: IconButton( child: IconButton(
@ -310,7 +444,7 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
deleteRequest( deleteRequest(
result, context); result, context);
}, },
)) )),
], ],
)); ));
}).toList()) }).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/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/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/models/AppointmentType.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/models/AppointmentType.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/AppointmentCardView.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/AppointmentCardView.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.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_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
@ -33,12 +36,14 @@ class _MyAppointmentsState extends State<MyAppointments>
bool isDataLoaded = false; bool isDataLoaded = false;
var sharedPref = new AppSharedPreferences(); var sharedPref = new AppSharedPreferences();
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
@override @override
void initState() { void initState() {
_tabController = new TabController(length: 3, vsync: this); _tabController = new TabController(length: 3, vsync: this);
WidgetsBinding.instance WidgetsBinding.instance.addPostFrameCallback((_) {
.addPostFrameCallback((_) => getPatientAppointmentHistory()); if (authenticatedUserObject.isLogin) getPatientAppointmentHistory();
});
super.initState(); super.initState();
} }
@ -84,6 +89,11 @@ class _MyAppointmentsState extends State<MyAppointments>
widget.bookedAppoList.clear(); widget.bookedAppoList.clear();
widget.confirmedAppoList.clear(); widget.confirmedAppoList.clear();
widget.arrivedAppoList.clear(); widget.arrivedAppoList.clear();
widget._patientBookedAppointmentListHospital.clear();
widget._patientConfirmedAppointmentListHospital.clear();
widget._patientArrivedAppointmentListHospital.clear();
service.getPatientAppointmentHistory(false, context).then((res) { service.getPatientAppointmentHistory(false, context).then((res) {
print(res['AppoimentAllHistoryResultList'].length); print(res['AppoimentAllHistoryResultList'].length);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {

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

@ -1,6 +1,7 @@
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
class PaymentMethod extends StatefulWidget { class PaymentMethod extends StatefulWidget {
@override @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), margin: EdgeInsets.only(top: 25.0),
child: Flex( child: Flex(
direction: Axis.horizontal, 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/ToDoList/ToDo.dart';
import 'package:diplomaticquarterapp/pages/livecare/incoming_call.dart'; import 'package:diplomaticquarterapp/pages/livecare/incoming_call.dart';
import 'package:diplomaticquarterapp/pages/medical/medical_profile_page.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/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart'; import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart';
import 'package:diplomaticquarterapp/uitl/CalendarUtils.dart'; import 'package:diplomaticquarterapp/uitl/CalendarUtils.dart';
import 'package:diplomaticquarterapp/uitl/LocalNotification.dart'; import 'package:diplomaticquarterapp/uitl/LocalNotification.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/bottom_navigation/bottom_nav_bar.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/buttons/floatingActionButton.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/drawer/app_drawer_widget.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:firebase_messaging/firebase_messaging.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_local_notifications/flutter_local_notifications.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:permission_handler/permission_handler.dart';
import 'package:provider/provider.dart';
import 'package:rxdart/rxdart.dart';
import '../../locator.dart'; import '../../locator.dart';
import 'home_page.dart'; import 'home_page.dart';
@ -144,6 +138,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
_firebaseMessaging.getToken().then((String token) { _firebaseMessaging.getToken().then((String token) {
sharedPref.setString(PUSH_TOKEN, token); sharedPref.setString(PUSH_TOKEN, token);
if (token != null) { if (token != null) {
DEVICE_TOKEN = token;
checkUserStatus(token); checkUserStatus(token);
} }
requestPermissions(); requestPermissions();

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

@ -10,6 +10,7 @@ import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
@ -30,6 +31,7 @@ class ConfirmPaymentPage extends StatelessWidget {
MyInAppBrowser browser; MyInAppBrowser browser;
AuthenticatedUser authenticatedUser; AuthenticatedUser authenticatedUser;
AppSharedPreferences sharedPref = AppSharedPreferences(); AppSharedPreferences sharedPref = AppSharedPreferences();
String transID = "";
ConfirmPaymentPage( ConfirmPaymentPage(
{this.advanceModel, {this.advanceModel,
@ -54,7 +56,7 @@ class ConfirmPaymentPage extends StatelessWidget {
new AppoitmentAllHistoryResultList(); new AppoitmentAllHistoryResultList();
appo.projectID = patientInfoAndMobileNumber.projectID; appo.projectID = patientInfoAndMobileNumber.projectID;
openPayment(selectedPaymentMethod, authenticatedUser, openPayment(selectedPaymentMethod, authenticatedUser,
double.parse(advanceModel.amount), appo); double.parse(advanceModel.amount), null);
} }
}); });
} }
@ -205,13 +207,15 @@ class ConfirmPaymentPage extends StatelessWidget {
appo: appo, appo: appo,
onLoadStartCallback: onBrowserLoadStart); onLoadStartCallback: onBrowserLoadStart);
transID = Utils.getAdvancePaymentTransID(
advanceModel.hospitalsModel.iD, int.parse(advanceModel.fileNumber));
browser.openPaymentBrowser( browser.openPaymentBrowser(
amount, amount,
"Advance Payment", "Advance Payment",
Utils.getAdvancePaymentTransID( transID,
authenticatedUser.projectID, authenticatedUser.patientID), advanceModel.hospitalsModel.iD.toString(),
appo.projectID.toString(), advanceModel.email,
authenticatedUser.emailAddress,
paymentMethod, paymentMethod,
authenticatedUser, authenticatedUser,
browser); browser);
@ -244,59 +248,64 @@ class ConfirmPaymentPage extends StatelessWidget {
} }
checkPaymentStatus(AppoitmentAllHistoryResultList appo) { checkPaymentStatus(AppoitmentAllHistoryResultList appo) {
GifLoaderDialogUtils.showMyDialog(AppGlobal.context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service service.checkPaymentStatus(transID, AppGlobal.context).then((res) {
.checkPaymentStatus(
Utils.getAdvancePaymentTransID(
appo.projectID, authenticatedUser.patientID),
AppGlobal.context)
.then((res) {
print("Printing Payment Status Reponse!!!!"); print("Printing Payment Status Reponse!!!!");
print(res); print(res);
String paymentInfo = res['Response_Message']; String paymentInfo = res['Response_Message'];
if (paymentInfo == 'Success') { if (paymentInfo == 'Success') {
createAdvancePayment(res, appo); createAdvancePayment(res, appo);
} else { } else {
GifLoaderDialogUtils.hideDialog(AppGlobal.context);
AppToast.showErrorToast(message: res['Response_Message']); AppToast.showErrorToast(message: res['Response_Message']);
} }
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(AppGlobal.context);
AppToast.showErrorToast(message: err);
print(err); print(err);
}).showProgressBar( });
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
} }
createAdvancePayment(res, AppoitmentAllHistoryResultList appo) { createAdvancePayment(res, AppoitmentAllHistoryResultList appo) {
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
String paymentReference = res['Fort_id'].toString(); String paymentReference = res['Fort_id'].toString();
service service.HIS_createAdvancePayment(
.createAdvancePayment(appo, res['Amount'], res['Fort_id'], appo,
res['PaymentMethod'], AppGlobal.context) advanceModel.hospitalsModel.iD.toString(),
res['Amount'],
res['Fort_id'],
res['PaymentMethod'],
AppGlobal.context)
.then((res) { .then((res) {
print(res['OnlineCheckInAppointments'][0]['AdvanceNumber']); print(res['OnlineCheckInAppointments'][0]['AdvanceNumber']);
addAdvancedNumberRequest( addAdvancedNumberRequest(
res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(),
paymentReference, paymentReference,
appo.appointmentNo.toString(), 0,
appo); appo);
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(AppGlobal.context);
AppToast.showErrorToast(message: err);
print(err); print(err);
}).showProgressBar( });
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
} }
addAdvancedNumberRequest(String advanceNumber, String paymentReference, addAdvancedNumberRequest(String advanceNumber, String paymentReference,
String appointmentID, AppoitmentAllHistoryResultList appo) { dynamic appointmentID, AppoitmentAllHistoryResultList appo) {
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service service
.addAdvancedNumberRequest( .addAdvancedNumberRequest(
advanceNumber, paymentReference, appointmentID, AppGlobal.context) advanceNumber, paymentReference, appointmentID, AppGlobal.context)
.then((res) { .then((res) {
print(res); print(res);
GifLoaderDialogUtils.hideDialog(AppGlobal.context);
navigateToHome(AppGlobal.context); navigateToHome(AppGlobal.context);
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(AppGlobal.context);
AppToast.showErrorToast(message: err);
print(err); print(err);
}).showProgressBar( });
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
} }
Future navigateToHome(context) async { 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/model/my_balance/patient_info_and_mobile_number.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.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/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:smart_progress_bar/smart_progress_bar.dart';
class ConfirmSMSDialog extends StatefulWidget { class ConfirmSMSDialog extends StatefulWidget {
final String phoneNumber; final String phoneNumber;
@ -332,12 +332,11 @@ class _ConfirmSMSDialogState extends State<ConfirmSMSDialog> {
if (verifyAccountForm.currentState.validate()) { if (verifyAccountForm.currentState.validate()) {
final activationCode = final activationCode =
digit1.text + digit2.text + digit3.text + digit4.text; digit1.text + digit2.text + digit3.text + digit4.text;
GifLoaderDialogUtils.showMyDialog(AppGlobal.context);
model model
.checkActivationCodeForAdvancePayment(activationCode: activationCode) .checkActivationCodeForAdvancePayment(activationCode: activationCode)
.then((value) {})
.showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6))
.then((value) { .then((value) {
GifLoaderDialogUtils.hideDialog(AppGlobal.context);
Navigator.pop(context, true); 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/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart'; import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.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/models/Request.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
@ -813,7 +812,7 @@ class DoctorsListService extends BaseService {
Future<Map> addAdvancedNumberRequest( Future<Map> addAdvancedNumberRequest(
String advanceNumber, String advanceNumber,
String paymentReference, String paymentReference,
String appointmentID, dynamic appointmentID,
BuildContext context) async { BuildContext context) async {
Map<String, dynamic> request; Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) { if (await this.sharedPref.getObject(USER_PROFILE) != null) {
@ -1109,6 +1108,7 @@ class DoctorsListService extends BaseService {
Future<Map> createAdvancePayment( Future<Map> createAdvancePayment(
AppoitmentAllHistoryResultList appo, AppoitmentAllHistoryResultList appo,
String projectID,
double payedAmount, double payedAmount,
String paymentReference, String paymentReference,
String paymentMethodName, String paymentMethodName,
@ -1122,9 +1122,9 @@ class DoctorsListService extends BaseService {
var languageID = await sharedPref.getString(APP_LANGUAGE); var languageID = await sharedPref.getString(APP_LANGUAGE);
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
request = { request = {
"ProjectID": appo.projectID.toString(), "ProjectID": projectID,
"OnlineCheckInAppointment": { "OnlineCheckInAppointment": {
"AppointmentNo": appo.appointmentNo.toString(), "AppointmentNo": appo != null ? appo.appointmentNo.toString() : "0",
"PaymentMethodName": paymentMethodName, "PaymentMethodName": paymentMethodName,
"PaymentAmount": payedAmount == 0 ? "0" : payedAmount.toString(), "PaymentAmount": payedAmount == 0 ? "0" : payedAmount.toString(),
"PaymentDate": payedAmount == 0 "PaymentDate": payedAmount == 0
@ -1133,9 +1133,9 @@ class DoctorsListService extends BaseService {
DateTime.now().millisecondsSinceEpoch.toString() + DateTime.now().millisecondsSinceEpoch.toString() +
")/", ")/",
"PaymentReferenceNumber": payedAmount == 0 ? "" : paymentReference, "PaymentReferenceNumber": payedAmount == 0 ? "" : paymentReference,
"ProjectID": appo.projectID.toString(), "ProjectID": appo != null ? appo.projectID.toString() : projectID,
"PatientID": authUser.patientID, "PatientID": authUser.patientID,
"ClinicID": appo.clinicID, "ClinicID": appo != null ? appo.clinicID : "0",
"UserID": authUser.patientID, "UserID": authUser.patientID,
"Status": authUser.patientType "Status": authUser.patientType
}, },
@ -1161,4 +1161,56 @@ class DoctorsListService extends BaseService {
}, body: request); }, body: request);
return Future.value(localRes); 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": "", "TokenID": "",
"IsActiveAppointment": true, "IsActiveAppointment": true,
"DeviceTypeID": req.DeviceTypeID, "DeviceTypeID": req.DeviceTypeID,
"PatientType": user.patientType,
"PatientTypeID": user.patientType,
"SessionID": null "SessionID": null
}; };

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

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

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