Merge branch 'development_new_design_2.0' of https://gitlab.com/Cloud_Solution/diplomatic-quarter into development_new_design_2.0

merge-requests/390/head
Sultan Khan 5 years ago
commit 2019e804f0

@ -99,7 +99,7 @@
<!-- Geofencing --> <!-- Geofencing -->
<meta-data android:name="com.google.android.geo.API_KEY" <meta-data android:name="com.google.android.geo.API_KEY"
android:value="AIzaSyCmevVlr2Bh-c8W1VUzo8gt8JRY7n5PANw"/> android:value="AIzaSyCyDbWUM9d_sBUGIE8PcuShzPaqO08NSC8"/>
<!-- Don't delete the meta-data below. <!-- Don't delete the meta-data below.

@ -13,8 +13,8 @@ const PACKAGES_CUSTOMER = '/api/customers';
const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items'; const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items';
const PACKAGES_ORDERS = '/api/orders'; const PACKAGES_ORDERS = '/api/orders';
const BASE_URL = 'https://uat.hmgwebservices.com/'; // const BASE_URL = 'https://uat.hmgwebservices.com/';
// const BASE_URL = 'https://hmgwebservices.com/'; const BASE_URL = 'https://hmgwebservices.com/';
// Pharmacy UAT URLs // Pharmacy UAT URLs
const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/';
@ -257,6 +257,8 @@ const GET_LIVECARE_HISTORY = 'Services/ER_VirtualCall.svc/REST/GetPatientErVirtu
const CANCEL_LIVECARE_REQUEST = 'Services/ER_VirtualCall.svc/REST/DeleteErRequest'; const CANCEL_LIVECARE_REQUEST = 'Services/ER_VirtualCall.svc/REST/DeleteErRequest';
const SEND_LIVECARE_INVOICE_EMAIL = 'Services/Notifications.svc/REST/SendInvoiceForLiveCare'; const SEND_LIVECARE_INVOICE_EMAIL = 'Services/Notifications.svc/REST/SendInvoiceForLiveCare';
const APPLE_PAY_INSERT_REQUEST = 'Services/PayFort_Serv.svc/REST/PayFort_ApplePayRequestData_Insert';
const GET_USER_TERMS = 'Services/Patients.svc/REST/GetUserTermsAndConditions'; const GET_USER_TERMS = 'Services/Patients.svc/REST/GetUserTermsAndConditions';
const UPDATE_HEALTH_TERMS = 'services/Patients.svc/REST/UpdatePateintHealthSummaryReport'; const UPDATE_HEALTH_TERMS = 'services/Patients.svc/REST/UpdatePateintHealthSummaryReport';
@ -294,7 +296,8 @@ const UPLOAD_INSURANCE_CARD = 'Services/Patients.svc/REST/PatientER_PatientInfoF
const GET_VACCINES = "Services/Patients.svc/REST/GetDoneVaccinesByPatientID"; const GET_VACCINES = "Services/Patients.svc/REST/GetDoneVaccinesByPatientID";
const GET_VACCINES_EMAIL = "Services/Notifications.svc/REST/SendVaccinesEmail"; const GET_VACCINES_EMAIL = "Services/Notifications.svc/REST/SendVaccinesEmail";
const GET_PAtIENTS_INSURANCE_APPROVALS = "Services/Patients.svc/REST/GetApprovalStatus_DWH"; // const GET_PAtIENTS_INSURANCE_APPROVALS = "Services/Patients.svc/REST/GetApprovalStatus_DWH";
const GET_PAtIENTS_INSURANCE_APPROVALS = "Services/Patients.svc/REST/GetApprovalStatus";
const SEARCH_BOT = 'HabibiChatBotApi/BotInterface/GetVoiceCommandResponse'; const SEARCH_BOT = 'HabibiChatBotApi/BotInterface/GetVoiceCommandResponse';
const GET_VACCINATIONS_ITEMS = "/Services/ERP.svc/REST/GET_VACCINATIONS_ITEMS"; const GET_VACCINATIONS_ITEMS = "/Services/ERP.svc/REST/GET_VACCINATIONS_ITEMS";

@ -418,7 +418,7 @@ const Map localizedValues = {
"PleaseEnterTheVerificationCode": {"en": "Please enter the verification code send to", "ar": "الرجاء إدخال رمز التحقق المرسل إلى"}, "PleaseEnterTheVerificationCode": {"en": "Please enter the verification code send to", "ar": "الرجاء إدخال رمز التحقق المرسل إلى"},
"EyeMeasurements": {"en": "Eye Measurements", "ar": "قياسات النظر"}, "EyeMeasurements": {"en": "Eye Measurements", "ar": "قياسات النظر"},
"Measurements": {"en": "Measurements", "ar": "قياسات"}, "Measurements": {"en": "Measurements", "ar": "قياسات"},
"Classes": {"en": "Classes", "ar": "نظارات"}, "Classes": {"en": "Glasses", "ar": "نظارات"},
"ContactLens": {"en": "Contact Lens", "ar": "العدسات اللاصقة"}, "ContactLens": {"en": "Contact Lens", "ar": "العدسات اللاصقة"},
"RightEye": {"en": "Right Eye", "ar": "العين اليمين"}, "RightEye": {"en": "Right Eye", "ar": "العين اليمين"},
"Sphere": {"en": "Sphere", "ar": "القوة"}, "Sphere": {"en": "Sphere", "ar": "القوة"},
@ -1462,4 +1462,8 @@ const Map localizedValues = {
"arm": {"en": "Arm", "ar": "الذراع"}, "arm": {"en": "Arm", "ar": "الذراع"},
"remove-measure": {"en": "Remove this measure", "ar": "إزالة هذا القياس؟"}, "remove-measure": {"en": "Remove this measure", "ar": "إزالة هذا القياس؟"},
"select-arm": {"en": "Select the Arm", "ar": "إختر الذراع"}, "select-arm": {"en": "Select the Arm", "ar": "إختر الذراع"},
"ask-doc-empty": {"en": "This service is available to doctors visited during the past 15 days", "ar": "هذه الخدمة متاحة للاطباء الذين تمت زيارتهم خلال ال 15 يوم الماضية"},
"online-clinics": {"en": "Online Clinics: ", "ar": "​العيادات المفتوحة: "},
"offline-clinics": {"en": "Offline Clinics: ", "ar": "العيادات المغلقة: "},
"clinic-schedule": {"en": "Clinic Schedule", "ar": "جدول العيادة"},
}; };

@ -14,6 +14,7 @@ class RequestInsuranceApprovalModel {
int patientType; int patientType;
int eXuldAPPNO; int eXuldAPPNO;
int projectID; int projectID;
int appointmentNo;
RequestInsuranceApprovalModel( RequestInsuranceApprovalModel(
{this.versionID, {this.versionID,
@ -30,7 +31,8 @@ class RequestInsuranceApprovalModel {
this.patientTypeID, this.patientTypeID,
this.patientType, this.patientType,
this.eXuldAPPNO, this.eXuldAPPNO,
this.projectID}); this.projectID,
this.appointmentNo});
RequestInsuranceApprovalModel.fromJson(Map<String, dynamic> json) { RequestInsuranceApprovalModel.fromJson(Map<String, dynamic> json) {
versionID = json['VersionID']; versionID = json['VersionID'];
@ -48,6 +50,7 @@ class RequestInsuranceApprovalModel {
patientType = json['PatientType']; patientType = json['PatientType'];
eXuldAPPNO = json['EXuldAPPNO']; eXuldAPPNO = json['EXuldAPPNO'];
projectID = json['ProjectID']; projectID = json['ProjectID'];
appointmentNo = json['AppointmentNo'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -67,6 +70,7 @@ class RequestInsuranceApprovalModel {
data['PatientType'] = this.patientType; data['PatientType'] = this.patientType;
data['EXuldAPPNO'] = this.eXuldAPPNO; data['EXuldAPPNO'] = this.eXuldAPPNO;
data['ProjectID'] = this.projectID; data['ProjectID'] = this.projectID;
data['AppointmentNo'] = this.appointmentNo;
return data; return data;
} }
} }

@ -216,7 +216,7 @@ class InsuranceApprovalModel {
eApprovalRemarks = json['EApprovalRemarks']; eApprovalRemarks = json['EApprovalRemarks'];
isEmailSentOnDelayApproval = json['IsEmailSentOnDelayApproval']; isEmailSentOnDelayApproval = json['IsEmailSentOnDelayApproval'];
eAuthorizationID = json['EAuthorizationID']; eAuthorizationID = json['EAuthorizationID'];
if (json['ApporvalDetails'] != null) { if (json['ApporvalDetails'] != null && json['ApporvalDetails'].length != 0) {
apporvalDetails = InsuranceApprovalDetails.fromJson(json['ApporvalDetails'][0]); apporvalDetails = InsuranceApprovalDetails.fromJson(json['ApporvalDetails'][0]);
} }
approvalStatusDescption = json['ApprovalStatusDescption']; approvalStatusDescption = json['ApprovalStatusDescption'];
@ -239,7 +239,7 @@ class InsuranceApprovalModel {
projectName = json['ProjectName']; projectName = json['ProjectName'];
projectNameN = json['ProjectNameN']; projectNameN = json['ProjectNameN'];
qR = json['QR']; qR = json['QR'];
speciality = json['Speciality'].cast<String>(); if (json['Speciality'] != null) speciality = json['Speciality'].cast<String>();
strApprovalDate = json['StrApprovalDate']; strApprovalDate = json['StrApprovalDate'];
strExpiryDate = json['StrExpiryDate']; strExpiryDate = json['StrExpiryDate'];
strSubmitDate = json['StrSubmitDate']; strSubmitDate = json['StrSubmitDate'];

@ -67,21 +67,19 @@ class InsuranceCardService extends BaseService {
Future getInsuranceApproval({int appointmentNo}) async { Future getInsuranceApproval({int appointmentNo}) async {
hasError = false; hasError = false;
// _cardList.clear();
if (appointmentNo != null) { if (appointmentNo != null) {
// _requestInsuranceApprovalModel.appointmentNo = appointmentNo; _requestInsuranceApprovalModel.appointmentNo = appointmentNo;
_requestInsuranceApprovalModel.eXuldAPPNO = null; _requestInsuranceApprovalModel.eXuldAPPNO = 0;
_requestInsuranceApprovalModel.projectID = null; _requestInsuranceApprovalModel.projectID = 0;
} else { } else {
// _requestInsuranceApprovalModel.appointmentNo = null; _requestInsuranceApprovalModel.appointmentNo = 0;
_requestInsuranceApprovalModel.eXuldAPPNO = 0; _requestInsuranceApprovalModel.eXuldAPPNO = 0;
_requestInsuranceApprovalModel.projectID = 0; _requestInsuranceApprovalModel.projectID = 0;
} }
_insuranceApproval.clear();
_insuranceApproval.length = 0;
await baseAppClient.post(GET_PAtIENTS_INSURANCE_APPROVALS, onSuccess: (dynamic response, int statusCode) { await baseAppClient.post(GET_PAtIENTS_INSURANCE_APPROVALS, onSuccess: (dynamic response, int statusCode) {
print(response['HIS_Approval_List'].length);
_insuranceApproval.clear();
_insuranceApproval.length = 0;
response['HIS_Approval_List'].forEach((item) { response['HIS_Approval_List'].forEach((item) {
_insuranceApproval.add(InsuranceApprovalModel.fromJson(item)); _insuranceApproval.add(InsuranceApprovalModel.fromJson(item));
}); });

@ -16,14 +16,16 @@ class AskDoctorService extends BaseService {
body['DoctorID'] = doctorId; body['DoctorID'] = doctorId;
body['ProjectID'] = projectId; body['ProjectID'] = projectId;
dynamic localRes;
await baseAppClient.post(GET_CALL_INFO_HOURS_RESULT, await baseAppClient.post(GET_CALL_INFO_HOURS_RESULT,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
///OKAY localRes = response;
var asd="";
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: body); }, body: body);
return Future.value(localRes);
} }
Future getCallRequestTypeLOV() async { Future getCallRequestTypeLOV() async {

@ -12,11 +12,10 @@ class DashboardViewModel extends BaseViewModel {
String get heightCm => _vitalSignService.heightCm; String get heightCm => _vitalSignService.heightCm;
String booldType = "-"; String booldType = "-";
DashboardViewModel() { DashboardViewModel() {
this.getPatientRadOrders(); // this.getPatientRadOrders();
} }
// ToDoCountProviderModel toDoProvider =
// Provider.of<ToDoCountProviderModel>(AppGlobal.context);
getPatientRadOrders() async { getPatientRadOrders() async {
if (isLogin && _vitalSignService.weightKg.isEmpty) { if (isLogin && _vitalSignService.weightKg.isEmpty) {
@ -31,17 +30,4 @@ class DashboardViewModel extends BaseViewModel {
} }
} }
} }
// getToDoCount() {
// toDoProvider.setState(0);
// ClinicListService service = new ClinicListService();
// service.getActiveAppointmentNo(AppGlobal.context).then((res) {
// print(res['AppointmentActiveNumber']);
// if (res['MessageStatus'] == 1) {
// toDoProvider.setState(res['AppointmentActiveNumber']);
// } else {}
// }).catchError((err) {
// print(err);
// });
// }
} }

@ -1,3 +1,4 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/ask_doctor/AskDoctorReqTypes.dart'; import 'package:diplomaticquarterapp/core/model/ask_doctor/AskDoctorReqTypes.dart';
import 'package:diplomaticquarterapp/core/model/ask_doctor/DoctorResponse.dart'; import 'package:diplomaticquarterapp/core/model/ask_doctor/DoctorResponse.dart';
@ -6,51 +7,40 @@ import 'package:diplomaticquarterapp/core/service/medical/my_doctor_service.dart
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
class AskDoctorViewModel extends BaseViewModel { class AskDoctorViewModel extends BaseViewModel {
AskDoctorService _askDoctorService = locator<AskDoctorService>(); AskDoctorService _askDoctorService = locator<AskDoctorService>();
MyDoctorService _myDoctorService = locator<MyDoctorService>(); MyDoctorService _myDoctorService = locator<MyDoctorService>();
List<PatientDoctorAppointmentList> patientDoctorAppointmentListHospital = List<PatientDoctorAppointmentList> patientDoctorAppointmentListHospital = List();
List();
List<AskDoctorReqTypes> get askDoctorReqTypes => List<AskDoctorReqTypes> get askDoctorReqTypes => _askDoctorService.askDoctorReqTypes;
_askDoctorService.askDoctorReqTypes;
List<DoctorResponse> get doctorResponseList => List<DoctorResponse> get doctorResponseList => _askDoctorService.doctorResponseList;
_askDoctorService.doctorResponseList;
Future getMyDoctor() async { Future getMyDoctor() async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _myDoctorService.getPatientDoctorAppointmentList( await _myDoctorService.getPatientDoctorAppointmentList(top: 25, beforeDays: 15);
top: 25, beforeDays: 15);
if (_myDoctorService.hasError) { if (_myDoctorService.hasError) {
error = _myDoctorService.error; error = _myDoctorService.error;
setState(ViewState.Error); setState(ViewState.Error);
} else } else if (_myDoctorService.patientDoctorAppointmentList.length != 0) {
var asd = ""; _myDoctorService.patientDoctorAppointmentList.forEach((element) {
_myDoctorService.patientDoctorAppointmentList.forEach((element) { List<PatientDoctorAppointmentList> doctorByClinic = patientDoctorAppointmentListHospital.where((elementClinic) => elementClinic.filterName == element.projectName).toList();
List<PatientDoctorAppointmentList> doctorByClinic =
patientDoctorAppointmentListHospital
.where((elementClinic) =>
elementClinic.filterName == element.projectName)
.toList();
if (doctorByClinic.length != 0) {
patientDoctorAppointmentListHospital[
patientDoctorAppointmentListHospital.indexOf(doctorByClinic[0])]
.patientDoctorAppointmentList
.add(element);
} else {
patientDoctorAppointmentListHospital.add(PatientDoctorAppointmentList(
filterName: element.projectName,
patientDoctorAppointment: element));
}
if (doctorByClinic.length != 0) {
patientDoctorAppointmentListHospital[patientDoctorAppointmentListHospital.indexOf(doctorByClinic[0])].patientDoctorAppointmentList.add(element);
} else {
patientDoctorAppointmentListHospital.add(PatientDoctorAppointmentList(filterName: element.projectName, patientDoctorAppointment: element));
}
setState(ViewState.Idle);
});
} else {
setState(ViewState.Idle); setState(ViewState.Idle);
}); AppToast.showErrorToast(message: TranslationBase.of(AppGlobal.context).askDocEmpty);
}
} }
Future getCallRequestTypeLOVs() async { Future getCallRequestTypeLOVs() async {
@ -66,8 +56,7 @@ class AskDoctorViewModel extends BaseViewModel {
Future getCallInfoHoursResult({int projectId, int doctorId}) async { Future getCallInfoHoursResult({int projectId, int doctorId}) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _askDoctorService.getCallInfoHoursResult( await _askDoctorService.getCallInfoHoursResult(projectId: projectId, doctorId: doctorId);
projectId: projectId, doctorId: doctorId);
if (_askDoctorService.hasError) { if (_askDoctorService.hasError) {
error = _askDoctorService.error; error = _askDoctorService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
@ -95,11 +84,9 @@ class AskDoctorViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future sendRequestLOV( Future sendRequestLOV({DoctorList doctorList, String requestType, String remark}) async {
{DoctorList doctorList, String requestType, String remark}) async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
await _askDoctorService.sendRequestLOV( await _askDoctorService.sendRequestLOV(doctorList: doctorList, requestType: requestType, remark: remark);
doctorList: doctorList, requestType: requestType, remark: remark);
if (_askDoctorService.hasError) { if (_askDoctorService.hasError) {
error = _askDoctorService.error; error = _askDoctorService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);

@ -0,0 +1,152 @@
class ApplePayInsertRequest {
String clientRequestID;
int clinicID;
String currency;
String customerEmail;
int customerID;
String customerName;
String deviceToken;
int doctorID;
String projectID;
String serviceID;
int channelID;
int patientID;
int patientTypeID;
int patientOutSA;
dynamic appointmentDate;
int appointmentNo;
String orderDescription;
String liveServiceID;
String latitude;
String longitude;
String amount;
String isSchedule;
String language;
int userName;
String responseContinueURL;
String backClickUrl;
String paymentOption;
double versionID;
int channel;
int languageID;
String iPAdress;
String generalid;
String sessionID;
bool isDentalAllowedBackend;
int deviceTypeID;
ApplePayInsertRequest(
{this.clientRequestID,
this.clinicID,
this.currency,
this.customerEmail,
this.customerID,
this.customerName,
this.deviceToken,
this.doctorID,
this.projectID,
this.serviceID,
this.channelID,
this.patientID,
this.patientTypeID,
this.patientOutSA,
this.appointmentDate,
this.appointmentNo,
this.orderDescription,
this.liveServiceID,
this.latitude,
this.longitude,
this.amount,
this.isSchedule,
this.language,
this.userName,
this.responseContinueURL,
this.backClickUrl,
this.paymentOption,
this.versionID,
this.channel,
this.languageID,
this.iPAdress,
this.generalid,
this.sessionID,
this.isDentalAllowedBackend,
this.deviceTypeID});
ApplePayInsertRequest.fromJson(Map<String, dynamic> json) {
clientRequestID = json['ClientRequestID'];
clinicID = json['ClinicID'];
currency = json['Currency'];
customerEmail = json['CustomerEmail'];
customerID = json['CustomerID'];
customerName = json['CustomerName'];
deviceToken = json['DeviceToken'];
doctorID = json['DoctorID'];
projectID = json['ProjectID'];
serviceID = json['Service_ID'];
channelID = json['Channel_ID'];
patientID = json['PatientID'];
patientTypeID = json['PatientTypeID'];
patientOutSA = json['PatientOutSA'];
appointmentDate = json['AppointmentDate'];
appointmentNo = json['AppointmentNo'];
orderDescription = json['OrderDescription'];
liveServiceID = json['Live_ServiceID'];
latitude = json['Latitude'];
longitude = json['Longitude'];
amount = json['Amount'];
isSchedule = json['IsSchedule'];
language = json['Language'];
userName = json['userName'];
responseContinueURL = json['ResponseContinueURL'];
backClickUrl = json['BackClickUrl'];
paymentOption = json['PaymentOption'];
versionID = json['VersionID'];
channel = json['Channel'];
languageID = json['LanguageID'];
iPAdress = json['IPAdress'];
generalid = json['generalid'];
sessionID = json['SessionID'];
isDentalAllowedBackend = json['isDentalAllowedBackend'];
deviceTypeID = json['DeviceTypeID'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['ClientRequestID'] = this.clientRequestID;
data['ClinicID'] = this.clinicID;
data['Currency'] = this.currency;
data['CustomerEmail'] = this.customerEmail;
data['CustomerID'] = this.customerID;
data['CustomerName'] = this.customerName;
data['DeviceToken'] = this.deviceToken;
data['DoctorID'] = this.doctorID;
data['ProjectID'] = this.projectID;
data['Service_ID'] = this.serviceID;
data['Channel_ID'] = this.channelID;
data['PatientID'] = this.patientID;
data['PatientTypeID'] = this.patientTypeID;
data['PatientOutSA'] = this.patientOutSA;
data['AppointmentDate'] = this.appointmentDate;
data['AppointmentNo'] = this.appointmentNo;
data['OrderDescription'] = this.orderDescription;
data['Live_ServiceID'] = this.liveServiceID;
data['Latitude'] = this.latitude;
data['Longitude'] = this.longitude;
data['Amount'] = this.amount;
data['IsSchedule'] = this.isSchedule;
data['Language'] = this.language;
data['userName'] = this.userName;
data['ResponseContinueURL'] = this.responseContinueURL;
data['BackClickUrl'] = this.backClickUrl;
data['PaymentOption'] = this.paymentOption;
data['VersionID'] = this.versionID;
data['Channel'] = this.channel;
data['LanguageID'] = this.languageID;
data['IPAdress'] = this.iPAdress;
data['generalid'] = this.generalid;
data['SessionID'] = this.sessionID;
data['isDentalAllowedBackend'] = this.isDentalAllowedBackend;
data['DeviceTypeID'] = this.deviceTypeID;
return data;
}
}

@ -19,6 +19,7 @@ import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'dialogs/ConfirmSMSDialog.dart'; import 'dialogs/ConfirmSMSDialog.dart';
import 'new_text_Field.dart'; import 'new_text_Field.dart';
@ -86,7 +87,7 @@ class ConfirmPaymentPage extends StatelessWidget {
height: 100.0, height: 100.0,
padding: EdgeInsets.all(7.0), padding: EdgeInsets.all(7.0),
width: MediaQuery.of(context).size.width * 0.45, width: MediaQuery.of(context).size.width * 0.45,
child: Image.asset(getImagePath(selectedPaymentMethod)), child: selectedPaymentMethod == "ApplePay" ? SvgPicture.asset(getImagePath(selectedPaymentMethod)) : Image.asset(getImagePath(selectedPaymentMethod)),
), ),
Texts( Texts(
'${advanceModel.amount} SAR', '${advanceModel.amount} SAR',
@ -193,6 +194,9 @@ class ConfirmPaymentPage extends StatelessWidget {
case "Installment": case "Installment":
return 'assets/images/new-design/installment.png'; return 'assets/images/new-design/installment.png';
break; break;
case "ApplePay":
return 'assets/images/new-design/applepay.svg';
break;
} }
return 'assets/images/new-design/mada.png'; return 'assets/images/new-design/mada.png';
@ -219,7 +223,7 @@ class ConfirmPaymentPage extends StatelessWidget {
authenticatedUser, authenticatedUser,
browser, browser,
false, false,
null, "3",
null); null);
} }

@ -20,7 +20,6 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_inappwebview/flutter_inappwebview.dart'; import 'package:flutter_inappwebview/flutter_inappwebview.dart';
import 'package:intl/intl.dart';
import 'QRCode.dart'; import 'QRCode.dart';
@ -489,33 +488,28 @@ class _BookSuccessState extends State<BookSuccess> {
} }
openPayment(String paymentMethod, AuthenticatedUser authenticatedUser, double amount, PatientShareResponse patientShareResponse, AppoitmentAllHistoryResultList appo) async { openPayment(String paymentMethod, AuthenticatedUser authenticatedUser, double amount, PatientShareResponse patientShareResponse, AppoitmentAllHistoryResultList appo) async {
if (paymentMethod == "ApplePay") { widget.browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart, context: context);
await widget.chromeBrowser.open(
url: "https://applepay-datatrans-sample.herokuapp.com/", widget.browser.openPaymentBrowser(
options: ChromeSafariBrowserClassOptions(android: AndroidChromeCustomTabsOptions(addDefaultShareMenuItem: false), ios: IOSSafariOptions(barCollapsingEnabled: true))); amount,
} else { "Appointment check in",
widget.browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart); Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo),
appo.projectID.toString(),
widget.browser.openPaymentBrowser( authenticatedUser.emailAddress,
amount, paymentMethod,
"Appointment check in", authenticatedUser.patientType,
Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), authenticatedUser.firstName,
appo.projectID.toString(), authenticatedUser.patientID,
authenticatedUser.emailAddress, authenticatedUser,
paymentMethod, widget.browser,
authenticatedUser.patientType, widget.patientShareResponse.isLiveCareAppointment,
authenticatedUser.firstName, "2",
authenticatedUser.patientID, null,
authenticatedUser, widget.patientShareResponse.appointmentDate,
widget.browser, widget.patientShareResponse.appointmentNo,
widget.patientShareResponse.isLiveCareAppointment, widget.patientShareResponse.clinicID,
null, widget.patientShareResponse.doctorID);
null, // }
widget.patientShareResponse.appointmentDate,
widget.patientShareResponse.appointmentNo,
widget.patientShareResponse.clinicID,
widget.patientShareResponse.doctorID);
}
} }
onBrowserLoadStart(String url) { onBrowserLoadStart(String url) {
@ -546,7 +540,6 @@ class _BookSuccessState extends State<BookSuccess> {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.checkPaymentStatus(Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), context).then((res) { service.checkPaymentStatus(Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), context).then((res) {
String paymentInfo = res['Response_Message']; String paymentInfo = res['Response_Message'];
if (paymentInfo == 'Success') { if (paymentInfo == 'Success') {
createAdvancePayment(res, appo); createAdvancePayment(res, appo);

@ -115,6 +115,7 @@ class _DoctorProfileState extends State<DoctorProfile> with TickerProviderStateM
widget.doctor.noOfPatientsRate, widget.doctor.noOfPatientsRate,
"", "",
), ),
buttonIcon: 'assets/images/new/Boo_ Appointment.svg',
showConfirmMessageDialog: false, showConfirmMessageDialog: false,
onTap: () { onTap: () {
Navigator.push( Navigator.push(

@ -32,36 +32,40 @@ class _SearchState extends State<Search> with TickerProviderStateMixin {
Widget build(BuildContext context) { Widget build(BuildContext context) {
AppGlobal.context = context; AppGlobal.context = context;
return AppScaffold( return AppScaffold(
isShowAppBar: false, isShowAppBar: false,
isShowDecPage: false, isShowDecPage: false,
appBarTitle: TranslationBase.of(context).bookAppo, appBarTitle: TranslationBase.of(context).bookAppo,
backgroundColor: Color(0xFFF7F7F7), backgroundColor: Color(0xFFF7F7F7),
body: Container( body: Column(
child: Column( children: [
children: [ TabBar(
TabBar( controller: _tabController,
tabs: [ indicatorWeight: 3.0,
Tab(child: Text(TranslationBase.of(context).clinicName, style: TextStyle(color: Colors.black))), indicatorSize: TabBarIndicatorSize.tab,
Tab( labelColor: Color(0xff2B353E),
child: Text(TranslationBase.of(context).doctorName, style: TextStyle(color: Colors.black)), unselectedLabelColor: Color(0xff575757),
) labelPadding: EdgeInsets.only(top: 15, bottom: 13, left: 20, right: 20),
], labelStyle: TextStyle(
controller: _tabController, fontSize: 16,
), fontWeight: FontWeight.w600,
Expanded( letterSpacing: -0.48,
child: new TabBarView( ),
physics: NeverScrollableScrollPhysics(), unselectedLabelStyle: TextStyle(
children: [ fontSize: 16,
SearchByClinic( fontWeight: FontWeight.w600,
clnicIds: widget.clnicIds, letterSpacing: -0.48,
), ),
SearchByDoctor() tabs: [Text(TranslationBase.of(context).clinicName), Text(TranslationBase.of(context).doctorName)],
],
controller: _tabController,
),
)
],
), ),
)); Expanded(
child: TabBarView(
physics: NeverScrollableScrollPhysics(),
children: [SearchByClinic(clnicIds: widget.clnicIds), SearchByDoctor()],
controller: _tabController,
),
)
],
),
);
} }
} }

@ -31,45 +31,36 @@ class _SearchResultsState extends State<SearchResults> {
isShowAppBar: true, isShowAppBar: true,
showNewAppBarTitle: true, showNewAppBarTitle: true,
showNewAppBar: true, showNewAppBar: true,
backgroundColor: CustomColors.appBackgroudGreyColor, backgroundColor: CustomColors.appBackgroudGrey2Color,
body: SingleChildScrollView( body: ListView.separated(
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
child: Column( separatorBuilder: (context, index) {
children: <Widget>[ return Container(
ListView.separated( height: 1,
physics: NeverScrollableScrollPhysics(), margin: EdgeInsets.only(left: 21, right: 21),
shrinkWrap: true, color: Color(0xffD9D9D9),
// padding: EdgeInsets.only(left: 21, right: 21), );
separatorBuilder: (context, index) { },
return Container( itemBuilder: (context, index) {
height: 1, return AppExpandableNotifier(
margin: EdgeInsets.only(left: 21, right: 21), title: widget.patientDoctorAppointmentListHospital[index].filterName + " - " + widget.patientDoctorAppointmentListHospital[index].distanceInKMs + " " + TranslationBase.of(context).km,
color: Color(0xffD9D9D9), isTitleSingleLine: false,
); bodyWidget: ListView.separated(
}, shrinkWrap: true,
itemBuilder: (context, index) { physics: NeverScrollableScrollPhysics(),
return AppExpandableNotifier( padding: EdgeInsets.only(bottom: 14, top: 14, left: 21, right: 21),
title: itemBuilder: (context, _index) {
widget.patientDoctorAppointmentListHospital[index].filterName + " - " + widget.patientDoctorAppointmentListHospital[index].distanceInKMs + " " + TranslationBase.of(context).km, //widget.patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList[_index].speciality = null;
bodyWidget: ListView.separated( return DoctorView(
shrinkWrap: true, doctor: widget.patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList[_index],
physics: NeverScrollableScrollPhysics(), isLiveCareAppointment: widget.isLiveCareAppointment,
padding: EdgeInsets.only(bottom: 14, top: 14, left: 21, right: 21), );
itemBuilder: (context, _index) { },
//widget.patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList[_index].speciality = null; separatorBuilder: (context, index) => SizedBox(height: 14),
return DoctorView( itemCount: widget.patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList.length),
doctor: widget.patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList[_index], );
isLiveCareAppointment: widget.isLiveCareAppointment, },
); itemCount: widget.patientDoctorAppointmentListHospital.length,
},
separatorBuilder: (context, index) => SizedBox(height: 14),
itemCount: widget.patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList.length),
);
},
itemCount: widget.patientDoctorAppointmentListHospital.length,
),
],
),
), ),
); );
} }

@ -52,6 +52,7 @@ class _SearchByClinicState extends State<SearchByClinic> {
final GlobalKey clinicDropdownKey = GlobalKey(); final GlobalKey clinicDropdownKey = GlobalKey();
final GlobalKey projectDropdownKey = GlobalKey(); final GlobalKey projectDropdownKey = GlobalKey();
TextEditingController ageController = new TextEditingController();
ProjectViewModel projectViewModel; ProjectViewModel projectViewModel;
String radioValue = null; String radioValue = null;
@ -65,124 +66,158 @@ class _SearchByClinicState extends State<SearchByClinic> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectViewModel = Provider.of(context); projectViewModel = Provider.of(context);
if (radioValue == null) radioValue = TranslationBase.of(context).female; if (projectViewModel.isLogin) {
if (radioValue == null) {
if (projectViewModel.user.gender == 1) {
radioValue = TranslationBase.of(context).male;
} else {
radioValue = TranslationBase.of(context).female;
}
}
} else if (radioValue == null) {
radioValue = TranslationBase.of(context).female;
}
if (ageController.text.isEmpty) {
ageController.text = projectViewModel.isLogin ? projectViewModel.user.age.toString() : "";
ageController.selection = TextSelection.fromPosition(TextPosition(offset: ageController.text.length));
}
return Container( return Container(
child: SingleChildScrollView( child: SingleChildScrollView(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Padding( if (projectViewModel.isLogin)
padding: const EdgeInsets.only( Column(
left: 20, children: [
right: 20, Padding(
top: 20, padding: const EdgeInsets.only(
), left: 20,
child: Text( right: 20,
TranslationBase.of(context).doctorFilter, top: 20,
style: TextStyle( ),
fontSize: 16, child: Text(
fontWeight: FontWeight.w600, TranslationBase.of(context).doctorFilter,
letterSpacing: -0.64, style: TextStyle(
), fontSize: 16,
), fontWeight: FontWeight.w600,
), letterSpacing: -0.64,
mHeight(30), ),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.only(left: 20, right: 20),
child: Text(
TranslationBase.of(context).gender,
style: TextStyle(
fontSize: 12,
letterSpacing: -0.48,
color: Colors.black,
fontWeight: FontWeight.w600,
), ),
), ),
), mHeight(30),
Container( Column(
padding: EdgeInsets.only(left: 6, right: 6), crossAxisAlignment: CrossAxisAlignment.start,
child: Row(
children: [ children: [
Flexible( Padding(
child: Row( padding: const EdgeInsets.only(left: 20, right: 20),
children: [ child: Text(
Radio( TranslationBase.of(context).gender,
value: TranslationBase.of(context).female, style: TextStyle(
groupValue: radioValue, fontSize: 12,
onChanged: (v) { letterSpacing: -0.48,
setState(() { color: Colors.black,
radioValue = v; fontWeight: FontWeight.w600,
});
},
), ),
Text( ),
TranslationBase.of(context).female, ),
style: TextStyle( Container(
fontSize: 12, padding: EdgeInsets.only(left: 6, right: 6),
letterSpacing: -0.48, child: Row(
fontWeight: FontWeight.w600, children: [
), Flexible(
child: Row(
children: [
Radio(
value: TranslationBase.of(context).female,
groupValue: radioValue,
onChanged: (v) {
setState(() {
radioValue = v;
});
},
),
Text(
TranslationBase.of(context).female,
style: TextStyle(
fontSize: 12,
letterSpacing: -0.48,
fontWeight: FontWeight.w600,
),
),
],
)),
Flexible(
child: Row(
children: [
Radio(
value: TranslationBase.of(context).male,
groupValue: radioValue,
onChanged: (v) {
setState(() {
radioValue = v;
});
},
),
Text(
TranslationBase.of(context).male,
style: TextStyle(
fontSize: 12,
letterSpacing: -0.48,
fontWeight: FontWeight.w600,
),
),
],
)),
],
),
),
],
),
Container(
width: double.infinity,
decoration: containerRadius(Colors.white, 12),
margin: EdgeInsets.only(left: 20, right: 20),
padding: EdgeInsets.only(left: 10, right: 10, top: 12, bottom: 2),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Age",
style: TextStyle(
fontSize: 12,
letterSpacing: -0.48,
color: Colors.black,
fontWeight: FontWeight.w600,
), ),
], ),
)), TextField(
Flexible( controller: ageController,
child: Row( style: TextStyle(
children: [ fontSize: 15,
Radio( letterSpacing: -0.59,
value: TranslationBase.of(context).male, color: Colors.black,
groupValue: radioValue,
onChanged: (v) {
setState(() {
radioValue = v;
});
},
), ),
Text( decoration: InputDecoration(
TranslationBase.of(context).male, contentPadding: EdgeInsets.zero,
style: TextStyle( border: OutlineInputBorder(
fontSize: 12, borderSide: BorderSide.none,
letterSpacing: -0.48,
fontWeight: FontWeight.w600,
), ),
), ),
], ),
)), // Text(
], // projectViewModel.isLogin ? projectViewModel.user.age.toString() : "",
), // style: TextStyle(
), // fontSize: 15,
], // letterSpacing: -0.59,
), // color: Colors.black,
Container( // ),
width: double.infinity, // ),
decoration: containerRadius(Colors.white, 12), ],
margin: EdgeInsets.only(left: 20, right: 20),
padding: EdgeInsets.only(left: 10, right: 10, top: 12, bottom: 12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Age",
style: TextStyle(
fontSize: 12,
letterSpacing: -0.48,
color: Colors.black,
fontWeight: FontWeight.w600,
),
),
Text(
projectViewModel.isLogin ? projectViewModel.user.age.toString() : "",
style: TextStyle(
fontSize: 15,
letterSpacing: -0.59,
color: Colors.black,
), ),
), ),
], ],
), ),
),
Padding( Padding(
padding: const EdgeInsets.only(left: 6, right: 6, top: 16), padding: const EdgeInsets.only(left: 6, right: 6, top: 16),
child: Row( child: Row(

@ -1,3 +1,4 @@
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorProfile.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorProfile.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
@ -9,6 +10,7 @@ import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart';
import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:rating_bar/rating_bar.dart'; import 'package:rating_bar/rating_bar.dart';
import '../DoctorProfile.dart'; import '../DoctorProfile.dart';
@ -21,8 +23,11 @@ class DoctorView extends StatelessWidget {
DoctorView({@required this.doctor, @required this.isLiveCareAppointment, this.isShowFlag = true, this.onTap}); DoctorView({@required this.doctor, @required this.isLiveCareAppointment, this.isShowFlag = true, this.onTap});
ProjectViewModel projectViewModel;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
return InkWell( return InkWell(
onTap: onTap ?? onTap: onTap ??
() { () {
@ -69,8 +74,8 @@ class DoctorView extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: <Widget>[ children: <Widget>[
if (doctor.clinicName != null) myRichText(TranslationBase.of(context).clinic + ":", doctor.clinicName), if (doctor.clinicName != null) myRichText(TranslationBase.of(context).clinic + ":", doctor.clinicName, projectViewModel.isArabic),
if (doctor.projectName != null) myRichText(TranslationBase.of(context).hospital + ":", doctor.projectName), if (doctor.projectName != null) myRichText(TranslationBase.of(context).hospital + ":", doctor.projectName, projectViewModel.isArabic),
if (doctor.speciality != null) if (doctor.speciality != null)
Text( Text(
getDoctorSpeciality(this.doctor.speciality).trim(), getDoctorSpeciality(this.doctor.speciality).trim(),
@ -135,6 +140,8 @@ class DoctorView extends StatelessWidget {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']); AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
} }
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err);
print(err); print(err);
}); });
} }

@ -16,6 +16,7 @@ import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class CovidPaymentSummary extends StatefulWidget { class CovidPaymentSummary extends StatefulWidget {
@ -27,8 +28,7 @@ class CovidPaymentSummary extends StatefulWidget {
AppSharedPreferences sharedPref = AppSharedPreferences(); AppSharedPreferences sharedPref = AppSharedPreferences();
String transID = ""; String transID = "";
CovidPaymentSummary( CovidPaymentSummary({@required this.patientShareResponse, this.selectedPaymentMethod});
{@required this.patientShareResponse, this.selectedPaymentMethod});
@override @override
_CovidPaymentSummaryState createState() => _CovidPaymentSummaryState(); _CovidPaymentSummaryState createState() => _CovidPaymentSummaryState();
@ -64,12 +64,10 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
height: 100.0, height: 100.0,
padding: EdgeInsets.all(7.0), padding: EdgeInsets.all(7.0),
width: MediaQuery.of(context).size.width * 0.45, width: MediaQuery.of(context).size.width * 0.45,
child: child: widget.selectedPaymentMethod == "ApplePay" ? SvgPicture.asset(getImagePath(widget.selectedPaymentMethod)) : Image.asset(getImagePath(widget.selectedPaymentMethod)),
Image.asset(getImagePath(widget.selectedPaymentMethod)),
), ),
Texts( Texts(
'${widget.patientShareResponse.patientShareWithTax} ' + '${widget.patientShareResponse.patientShareWithTax} ' + TranslationBase.of(context).sar,
TranslationBase.of(context).sar,
fontSize: 26, fontSize: 26,
bold: true, bold: true,
) )
@ -85,8 +83,7 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
margin: EdgeInsets.all(3), margin: EdgeInsets.all(3),
child: NewTextFields( child: NewTextFields(
hintText: TranslationBase.of(context).fileNumber, hintText: TranslationBase.of(context).fileNumber,
initialValue: initialValue: projectViewModel.user.patientID.toString(),
projectViewModel.user.patientID.toString(),
isEnabled: false, isEnabled: false,
), ),
), ),
@ -116,11 +113,7 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
), ),
NewTextFields( NewTextFields(
hintText: TranslationBase.of(context).depositorName, hintText: TranslationBase.of(context).depositorName,
initialValue: projectViewModel.user.firstName + initialValue: projectViewModel.user.firstName + " " + projectViewModel.user.middleName + " " + projectViewModel.user.lastName,
" " +
projectViewModel.user.middleName +
" " +
projectViewModel.user.lastName,
isEnabled: false, isEnabled: false,
), ),
], ],
@ -149,55 +142,31 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
appo.clinicID = widget.patientShareResponse.clinicID; appo.clinicID = widget.patientShareResponse.clinicID;
appo.appointmentNo = widget.patientShareResponse.appointmentNo; appo.appointmentNo = widget.patientShareResponse.appointmentNo;
openPayment( openPayment(widget.selectedPaymentMethod, authenticatedUser, double.parse(widget.patientShareResponse.patientShareWithTax.toString()), widget.patientShareResponse, appo);
widget.selectedPaymentMethod,
authenticatedUser,
double.parse(
widget.patientShareResponse.patientShareWithTax.toString()),
widget.patientShareResponse,
appo);
} }
openPayment( openPayment(String paymentMethod, AuthenticatedUser authenticatedUser, double amount, PatientShareResponse patientShareResponse, AppoitmentAllHistoryResultList appo) async {
String paymentMethod, widget.browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart, context: context);
AuthenticatedUser authenticatedUser,
double amount,
PatientShareResponse patientShareResponse,
AppoitmentAllHistoryResultList appo) async {
if (paymentMethod == "ApplePay") {
// await widget.chromeBrowser.open(
// url: "https://applepay-datatrans-sample.herokuapp.com/",
// options: ChromeSafariBrowserClassOptions(
// android: AndroidChromeCustomTabsOptions(
// addDefaultShareMenuItem: false),
// ios: IOSSafariOptions(barCollapsingEnabled: true)));
} else {
widget.browser = new MyInAppBrowser(
onExitCallback: onBrowserExit,
appo: appo,
onLoadStartCallback: onBrowserLoadStart);
widget.browser.openPaymentBrowser( widget.browser.openPaymentBrowser(
amount, amount,
"Appointment check in", "Appointment check in",
Utils.getAppointmentTransID( Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo),
appo.projectID, appo.clinicID, appo.appointmentNo), appo.projectID.toString(),
appo.projectID.toString(), authenticatedUser.emailAddress,
authenticatedUser.emailAddress, paymentMethod,
paymentMethod, authenticatedUser.patientType,
authenticatedUser.patientType, authenticatedUser.firstName,
authenticatedUser.firstName, authenticatedUser.patientID,
authenticatedUser.patientID, authenticatedUser,
authenticatedUser, widget.browser,
widget.browser, widget.patientShareResponse.isLiveCareAppointment,
widget.patientShareResponse.isLiveCareAppointment, "2",
null, null,
null, widget.patientShareResponse.appointmentDate,
widget.patientShareResponse.appointmentDate, widget.patientShareResponse.appointmentNo,
widget.patientShareResponse.appointmentNo, widget.patientShareResponse.clinicID,
widget.patientShareResponse.clinicID, widget.patientShareResponse.doctorID);
widget.patientShareResponse.doctorID);
}
} }
onBrowserLoadStart(String url) { onBrowserLoadStart(String url) {
@ -229,12 +198,7 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
checkPaymentStatus(AppoitmentAllHistoryResultList appo) { checkPaymentStatus(AppoitmentAllHistoryResultList appo) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service service.checkPaymentStatus(Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), context).then((res) {
.checkPaymentStatus(
Utils.getAppointmentTransID(
appo.projectID, appo.clinicID, appo.appointmentNo),
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'];
@ -254,15 +218,9 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
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(appo, appo.projectID.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], context).then((res) {
.createAdvancePayment(appo, appo.projectID.toString(), res['Amount'],
res['Fort_id'], res['PaymentMethod'], context)
.then((res) {
print(res['OnlineCheckInAppointments'][0]['AdvanceNumber']); print(res['OnlineCheckInAppointments'][0]['AdvanceNumber']);
addAdvancedNumberRequest( addAdvancedNumberRequest(res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), paymentReference, appo.appointmentNo.toString());
res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(),
paymentReference,
appo.appointmentNo.toString());
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err); AppToast.showErrorToast(message: err);
@ -270,13 +228,9 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
}); });
} }
addAdvancedNumberRequest( addAdvancedNumberRequest(String advanceNumber, String paymentReference, String appointmentID) {
String advanceNumber, String paymentReference, String appointmentID) {
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service service.addAdvancedNumberRequest(advanceNumber, paymentReference, appointmentID, context).then((res) {
.addAdvancedNumberRequest(
advanceNumber, paymentReference, appointmentID, context)
.then((res) {
print(res); print(res);
getAppoQR(context); getAppoQR(context);
}).catchError((err) { }).catchError((err) {
@ -288,9 +242,7 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
getAppoQR(context) { getAppoQR(context) {
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service service.generateAppointmentQR(widget.patientShareResponse, context).then((res) {
.generateAppointmentQR(widget.patientShareResponse, context)
.then((res) {
print(res); print(res);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
navigateToQR(context, res['AppointmentQR']); navigateToQR(context, res['AppointmentQR']);
@ -328,6 +280,9 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
case "Installment": case "Installment":
return 'assets/images/new-design/installment.png'; return 'assets/images/new-design/installment.png';
break; break;
case "ApplePay":
return 'assets/images/new-design/applepay.svg';
break;
} }
return 'assets/images/new-design/mada.png'; return 'assets/images/new-design/mada.png';

@ -45,6 +45,7 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
List<DoctorRateDetails> doctorDetailsList = List(); List<DoctorRateDetails> doctorDetailsList = List();
ToDoCountProviderModel toDoProvider; ToDoCountProviderModel toDoProvider;
ProjectViewModel projectViewModel;
DoctorList doctorList = new DoctorList(); DoctorList doctorList = new DoctorList();
@ -73,7 +74,7 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); projectViewModel = Provider.of(context);
toDoProvider = Provider.of<ToDoCountProviderModel>(context); toDoProvider = Provider.of<ToDoCountProviderModel>(context);
@ -158,7 +159,7 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
child: TabBarView( child: TabBarView(
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
children: [ children: [
AppointmentActions(appo: widget.appo, tabController: _tabController, enableFooterButton: enableFooterButton), AppointmentActions(appo: widget.appo, tabController: _tabController, enableFooterButton: enableFooterButton, projectViewModel: projectViewModel),
DocAvailableAppointments(doctor: getDoctorObject(), doctorSchedule: widget.doctorSchedule, isLiveCareAppointment: widget.appo.isLiveCareAppointment) DocAvailableAppointments(doctor: getDoctorObject(), doctorSchedule: widget.doctorSchedule, isLiveCareAppointment: widget.appo.isLiveCareAppointment)
], ],
controller: _tabController, controller: _tabController,

@ -35,13 +35,13 @@ class ArrivedButtons {
}, },
{ {
"title": TranslationBase.of(AppGlobal.context).insuranceApproval, "title": TranslationBase.of(AppGlobal.context).insuranceApproval,
"subtitle": TranslationBase.of(AppGlobal.context).insuranceSubtitle, "subtitle": TranslationBase.of(AppGlobal.context).insuranceApprovalSubtitle,
"icon": 'insurance_approval.svg', "icon": 'insurance_approval.svg',
"caller": "Insurance", "caller": "Insurance",
}, },
{ {
"title": TranslationBase.of(AppGlobal.context).askDoctor, "title": TranslationBase.of(AppGlobal.context).askDoctor,
"subtitle": TranslationBase.of(AppGlobal.context).askYourSubtitle, "subtitle": TranslationBase.of(AppGlobal.context).service,
"icon": 'ask_doctor.svg', "icon": 'ask_doctor.svg',
"caller": "askDoc", "caller": "askDoc",
}, },

@ -37,8 +37,9 @@ class AppointmentActions extends StatefulWidget {
TabController tabController; TabController tabController;
final Function enableFooterButton; final Function enableFooterButton;
MyInAppBrowser browser; MyInAppBrowser browser;
final ProjectViewModel projectViewModel;
AppointmentActions({@required this.appo, @required this.tabController, @required this.enableFooterButton}); AppointmentActions({@required this.appo, @required this.tabController, @required this.enableFooterButton, this.projectViewModel});
@override @override
_AppointmentActionsState createState() => _AppointmentActionsState(); _AppointmentActionsState createState() => _AppointmentActionsState();
@ -104,7 +105,7 @@ class _AppointmentActionsState extends State<AppointmentActions> {
DateUtil.convertStringToDate(widget.appo.appointmentDate), DateUtil.convertStringToDate(widget.appo.appointmentDate),
widget.appo.doctorNameObj, widget.appo.doctorNameObj,
"", "",
DateUtil.formatDateToDate(DateUtil.convertStringToDate(widget.appo.appointmentDate)), DateUtil.formatDateToDate(DateUtil.convertStringToDate(widget.appo.appointmentDate), widget.projectViewModel.isArabic),
DateUtil.formatDateToTime(DateUtil.convertStringToDate(widget.appo.appointmentDate)), DateUtil.formatDateToTime(DateUtil.convertStringToDate(widget.appo.appointmentDate)),
onSuccess: () { onSuccess: () {
AppToast.showSuccessToast(message: TranslationBase.of(context).reminderSuccess); AppToast.showSuccessToast(message: TranslationBase.of(context).reminderSuccess);
@ -540,7 +541,7 @@ class _AppointmentActionsState extends State<AppointmentActions> {
page: VitalSignDetailsScreen( page: VitalSignDetailsScreen(
appointmentNo: appoNo, appointmentNo: appoNo,
projectID: projectID, projectID: projectID,
isNotOneAppointment: false, isNotOneAppointment: true,
))); )));
} }

@ -597,7 +597,7 @@ class _ToDoState extends State<ToDo> {
} }
openPayment(String paymentMethod, AuthenticatedUser authenticatedUser, double amount, PatientShareResponse patientShareResponse, AppoitmentAllHistoryResultList appo) { openPayment(String paymentMethod, AuthenticatedUser authenticatedUser, double amount, PatientShareResponse patientShareResponse, AppoitmentAllHistoryResultList appo) {
widget.browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart); widget.browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart, context: context);
widget.browser.openPaymentBrowser( widget.browser.openPaymentBrowser(
amount, amount,
@ -612,7 +612,7 @@ class _ToDoState extends State<ToDo> {
authenticatedUser, authenticatedUser,
widget.browser, widget.browser,
appo.isLiveCareAppointment, appo.isLiveCareAppointment,
null, "2",
null, null,
appo.appointmentDate, appo.appointmentDate,
appo.appointmentNo, appo.appointmentNo,

@ -1,3 +1,6 @@
import 'dart:io';
import 'package:diplomaticquarterapp/theme/colors.dart';
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';
@ -16,6 +19,9 @@ class _PaymentMethodState extends State<PaymentMethod> {
return AppScaffold( return AppScaffold(
appBarTitle: TranslationBase.of(context).paymentMethod, appBarTitle: TranslationBase.of(context).paymentMethod,
isShowAppBar: true, isShowAppBar: true,
showNewAppBar: true,
showNewAppBarTitle: true,
backgroundColor: CustomColors.appBackgroudGreyColor,
body: Container( body: Container(
margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0), margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0),
child: SingleChildScrollView( child: SingleChildScrollView(
@ -27,9 +33,7 @@ class _PaymentMethodState extends State<PaymentMethod> {
Container( Container(
margin: EdgeInsets.fromLTRB(0.0, 15.0, 0.0, 0.0), margin: EdgeInsets.fromLTRB(0.0, 15.0, 0.0, 0.0),
alignment: Alignment.center, alignment: Alignment.center,
child: Text(TranslationBase.of(context).selectPaymentOption, child: Text(TranslationBase.of(context).selectPaymentOption, style: TextStyle(fontSize: 26.0, fontWeight: FontWeight.bold)),
style: TextStyle(
fontSize: 26.0, fontWeight: FontWeight.bold)),
), ),
Container( Container(
margin: EdgeInsets.only(top: 25.0), margin: EdgeInsets.only(top: 25.0),
@ -48,18 +52,13 @@ class _PaymentMethodState extends State<PaymentMethod> {
color: Colors.white, color: Colors.white,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
side: selectedPaymentMethod == "MADA" side: selectedPaymentMethod == "MADA" ? BorderSide(color: Colors.green, width: 5.0) : BorderSide(color: Colors.transparent, width: 0.0),
? BorderSide(
color: Colors.green, width: 5.0)
: BorderSide(
color: Colors.transparent, width: 0.0),
), ),
child: Container( child: Container(
height: 120.0, height: 120.0,
padding: EdgeInsets.all(7.0), padding: EdgeInsets.all(7.0),
width: MediaQuery.of(context).size.width * 0.45, width: MediaQuery.of(context).size.width * 0.45,
child: Image.asset( child: Image.asset("assets/images/new-design/mada.png"),
"assets/images/new-design/mada.png"),
), ),
), ),
), ),
@ -77,18 +76,13 @@ class _PaymentMethodState extends State<PaymentMethod> {
color: Colors.white, color: Colors.white,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
side: selectedPaymentMethod == "VISA" side: selectedPaymentMethod == "VISA" ? BorderSide(color: Colors.green, width: 5.0) : BorderSide(color: Colors.transparent, width: 0.0),
? BorderSide(
color: Colors.green, width: 5.0)
: BorderSide(
color: Colors.transparent, width: 0.0),
), ),
child: Container( child: Container(
height: 120.0, height: 120.0,
padding: EdgeInsets.all(7.0), padding: EdgeInsets.all(7.0),
width: MediaQuery.of(context).size.width * 0.45, width: MediaQuery.of(context).size.width * 0.45,
child: Image.asset( child: Image.asset("assets/images/new-design/visa.png"),
"assets/images/new-design/visa.png"),
), ),
), ),
), ),
@ -114,18 +108,13 @@ class _PaymentMethodState extends State<PaymentMethod> {
color: Colors.white, color: Colors.white,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
side: selectedPaymentMethod == "MASTERCARD" side: selectedPaymentMethod == "MASTERCARD" ? BorderSide(color: Colors.green, width: 5.0) : BorderSide(color: Colors.transparent, width: 0.0),
? BorderSide(
color: Colors.green, width: 5.0)
: BorderSide(
color: Colors.transparent, width: 0.0),
), ),
child: Container( child: Container(
height: 120.0, height: 120.0,
padding: EdgeInsets.all(7.0), padding: EdgeInsets.all(7.0),
width: MediaQuery.of(context).size.width * 0.45, width: MediaQuery.of(context).size.width * 0.45,
child: Image.asset( child: Image.asset("assets/images/new-design/mastercard.png"),
"assets/images/new-design/mastercard.png"),
), ),
), ),
), ),
@ -143,18 +132,13 @@ class _PaymentMethodState extends State<PaymentMethod> {
color: Colors.white, color: Colors.white,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
side: selectedPaymentMethod == "Installment" side: selectedPaymentMethod == "Installment" ? BorderSide(color: Colors.green, width: 5.0) : BorderSide(color: Colors.transparent, width: 0.0),
? BorderSide(
color: Colors.green, width: 5.0)
: BorderSide(
color: Colors.transparent, width: 0.0),
), ),
child: Container( child: Container(
height: 120.0, height: 120.0,
padding: EdgeInsets.all(7.0), padding: EdgeInsets.all(7.0),
width: MediaQuery.of(context).size.width * 0.45, width: MediaQuery.of(context).size.width * 0.45,
child: Image.asset( child: Image.asset("assets/images/new-design/installment.png"),
"assets/images/new-design/installment.png"),
), ),
), ),
), ),
@ -163,7 +147,7 @@ class _PaymentMethodState extends State<PaymentMethod> {
], ],
), ),
), ),
Container( Platform.isIOS ? Container(
margin: EdgeInsets.only(top: 25.0), margin: EdgeInsets.only(top: 25.0),
child: Flex( child: Flex(
direction: Axis.horizontal, direction: Axis.horizontal,
@ -180,17 +164,12 @@ class _PaymentMethodState extends State<PaymentMethod> {
color: Colors.white, color: Colors.white,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
side: selectedPaymentMethod == "ApplePay" side: selectedPaymentMethod == "ApplePay" ? BorderSide(color: Colors.green, width: 5.0) : BorderSide(color: Colors.transparent, width: 0.0),
? BorderSide(
color: Colors.green, width: 5.0)
: BorderSide(
color: Colors.transparent, width: 0.0),
), ),
child: Container( child: Container(
height: 120.0, height: 120.0,
padding: EdgeInsets.all(20.0), padding: EdgeInsets.all(20.0),
child: SvgPicture.asset( child: SvgPicture.asset("assets/images/new-design/applepay.svg"),
"assets/images/new-design/applepay.svg"),
), ),
), ),
), ),
@ -201,7 +180,7 @@ class _PaymentMethodState extends State<PaymentMethod> {
), ),
], ],
), ),
), ) : Container(),
SizedBox( SizedBox(
height: 150.0, height: 150.0,
), ),
@ -211,25 +190,33 @@ class _PaymentMethodState extends State<PaymentMethod> {
), ),
), ),
bottomSheet: Container( bottomSheet: Container(
width: MediaQuery.of(context).size.width, padding: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 20.0),
height: 50.0, color: Colors.white,
margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 20.0), child: Container(
child: ButtonTheme( width: MediaQuery.of(context).size.width,
shape: RoundedRectangleBorder( height: 50.0,
borderRadius: BorderRadius.circular(10.0), color: Colors.white,
), // margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 20.0),
minWidth: MediaQuery.of(context).size.height * 0.1, child: ButtonTheme(
height: 45.0, shape: RoundedRectangleBorder(
child: RaisedButton( borderRadius: BorderRadius.circular(10.0),
color: new Color(0xFF60686b), ),
textColor: Colors.white, minWidth: MediaQuery.of(context).size.height * 0.1,
disabledTextColor: Colors.white, height: 45.0,
disabledColor: new Color(0xFFbcc2c4), child: RaisedButton(
onPressed: () { color: CustomColors.accentColor,
Navigator.pop(context, selectedPaymentMethod); textColor: Colors.white,
}, disabledTextColor: Colors.white,
child: Text(TranslationBase.of(context).confirm, disabledColor: new Color(0xFFbcc2c4),
style: TextStyle(fontSize: 18.0)), onPressed: () {
Navigator.pop(context, selectedPaymentMethod);
},
child: Text(TranslationBase.of(context).confirm.toUpperCase(),
style: TextStyle(
fontSize: 14.0,
fontWeight: FontWeight.w600,
)),
),
), ),
), ),
), ),

@ -10,17 +10,13 @@ class AttachInsuranceCardImageDialog extends StatefulWidget {
final String fileNo; final String fileNo;
final Function(File file, String image) image; final Function(File file, String image) image;
const AttachInsuranceCardImageDialog( const AttachInsuranceCardImageDialog({Key key, this.name, this.fileNo, this.image}) : super(key: key);
{Key key, this.name, this.fileNo, this.image})
: super(key: key);
@override @override
_AttachInsuranceCardImageDialogState createState() => _AttachInsuranceCardImageDialogState createState() => _AttachInsuranceCardImageDialogState();
_AttachInsuranceCardImageDialogState();
} }
class _AttachInsuranceCardImageDialogState class _AttachInsuranceCardImageDialogState extends State<AttachInsuranceCardImageDialog> {
extends State<AttachInsuranceCardImageDialog> {
@override @override
void initState() { void initState() {
super.initState(); super.initState();
@ -36,19 +32,41 @@ class _AttachInsuranceCardImageDialogState
Column( Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Texts(TranslationBase.of(context).attachInsuraceImage), Text(
TranslationBase.of(context).attachInsuraceImage,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
letterSpacing: -0.48,
),
),
Divider(), Divider(),
Texts(widget.name), Padding(
padding: const EdgeInsets.only(left: 8, right: 8),
child: Text(
widget.name,
style: TextStyle(
fontSize: 14,
letterSpacing: -0.48,
),
),
),
SizedBox( SizedBox(
height: 3, height: 3,
), ),
Texts(TranslationBase.of(context).fileNo + " " + widget.fileNo), Text(
TranslationBase.of(context).fileNo + " " + widget.fileNo,
style: TextStyle(
fontSize: 14,
letterSpacing: -0.48,
),
),
SizedBox( SizedBox(
height: 5.0, height: 5.0,
), ),
InkWell( InkWell(
onTap: () { onTap: () {
ImageOptions.showImageOptions(context, (String image,File file) { ImageOptions.showImageOptions(context, (String image, File file) {
setState(() { setState(() {
this.image = image; this.image = image;
this.file = file; this.file = file;
@ -57,18 +75,18 @@ class _AttachInsuranceCardImageDialogState
}, },
child: image == null child: image == null
? Padding( ? Padding(
padding: const EdgeInsets.all(18.0), padding: const EdgeInsets.all(18.0),
child: Container( child: Container(
width: double.maxFinite, width: double.maxFinite,
height: 250, height: 250,
decoration: BoxDecoration( decoration: BoxDecoration(borderRadius: BorderRadius.circular(2), border: Border.all(color: Colors.grey, width: 1.5)),
borderRadius: BorderRadius.circular(2),
border: Border.all(color: Colors.grey, width: 1.5)),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
// mainAxisAlignment: MainAxisAlignment., // mainAxisAlignment: MainAxisAlignment.,
children: [ children: [
SizedBox(height: 25,), SizedBox(
height: 25,
),
Icon( Icon(
Icons.camera_enhance_rounded, Icons.camera_enhance_rounded,
size: 85, size: 85,
@ -77,17 +95,24 @@ class _AttachInsuranceCardImageDialogState
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Icon(Icons.attach_file), Icon(Icons.attach_file),
Texts(TranslationBase.of(context).selectAttachment.toUpperCase()) Text(
TranslationBase.of(context).selectAttachment.toUpperCase(),
style: TextStyle(
fontSize: 12,
letterSpacing: -0.48,
fontWeight: FontWeight.w600,
),
)
], ],
), ),
], ],
), ),
), ),
) )
: Image.file( : Image.file(
file, file,
fit: BoxFit.fill, fit: BoxFit.fill,
height: 250, height: 250,
), ),
), ),
SizedBox( SizedBox(
@ -106,9 +131,14 @@ class _AttachInsuranceCardImageDialogState
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Container( child: Container(
child: Center( child: Center(
child: Texts( child: Text(
TranslationBase.of(context).cancel.toUpperCase(), TranslationBase.of(context).cancel.toUpperCase(),
color: Colors.red, style: TextStyle(
fontSize: 12,
letterSpacing: -0.48,
fontWeight: FontWeight.w600,
color: Colors.red,
),
), ),
), ),
), ),
@ -130,9 +160,13 @@ class _AttachInsuranceCardImageDialogState
child: Padding( child: Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Center( child: Center(
child: Texts( child: Text(
TranslationBase.of(context).ok, TranslationBase.of(context).ok.toUpperCase(),
fontWeight: FontWeight.w400, style: TextStyle(
fontSize: 12,
letterSpacing: -0.48,
fontWeight: FontWeight.w600,
),
)), )),
), ),
), ),

@ -32,7 +32,9 @@ class _InsuranceApprovalState extends State<InsuranceApproval> {
onModelReady: widget.appointmentNo != null ? (model) => model.getInsuranceApproval(appointmentNo: widget.appointmentNo) : (model) => model.getInsuranceApproval(), onModelReady: widget.appointmentNo != null ? (model) => model.getInsuranceApproval(appointmentNo: widget.appointmentNo) : (model) => model.getInsuranceApproval(),
builder: (BuildContext context, InsuranceViewModel model, Widget child) => AppScaffold( builder: (BuildContext context, InsuranceViewModel model, Widget child) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
showNewAppBar: true,
baseViewModel: model, baseViewModel: model,
showNewAppBarTitle: true,
appBarTitle: TranslationBase.of(context).approvals, appBarTitle: TranslationBase.of(context).approvals,
description: TranslationBase.of(context).infoApprovals, description: TranslationBase.of(context).infoApprovals,
infoList: TranslationBase.of(context).infoApprovalPoints, infoList: TranslationBase.of(context).infoApprovalPoints,

@ -4,9 +4,11 @@ import 'package:diplomaticquarterapp/core/service/insurance_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/insurance_card_View_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/insurance_card_View_model.dart';
import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/pages/insurance/insurance_details.dart'; import 'package:diplomaticquarterapp/pages/insurance/insurance_details.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.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/pages/insurance/insurance_update_screen.dart'; import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.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:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -45,142 +47,162 @@ class _InsuranceCardState extends State<InsuranceCard> {
description: TranslationBase.of(context).infoInsuranceCards, description: TranslationBase.of(context).infoInsuranceCards,
infoList: TranslationBase.of(context).infoInsuranceCardsPoints, infoList: TranslationBase.of(context).infoInsuranceCardsPoints,
imagesInfo: imagesInfo, imagesInfo: imagesInfo,
appBarIcons: [ showNewAppBar: true,
model.isLogin ? IconButton( showNewAppBarTitle: true,
padding: EdgeInsets.zero, backgroundColor: CustomColors.appBackgroudGreyColor,
icon: Container( floatingActionButton: FloatingActionButton(
decoration: BoxDecoration( onPressed: () {
color: Colors.white, Navigator.push(context, FadePage(page: InsuranceUpdate()));
borderRadius: BorderRadius.circular(8), },
), backgroundColor: CustomColors.accentColor,
margin: EdgeInsets.only(right: 8), child: Padding(
padding: EdgeInsets.only(right: 4, left: 4), padding: const EdgeInsets.all(12.0),
child: Image.asset( child: Image.asset(
'assets/images/medical/insurance_update_icon_.png', 'assets/images/medical/insurance_update_icon_.png',
height: SizeConfig.heightMultiplier * 5, color: Colors.white,
width: SizeConfig.heightMultiplier * 5,
),
), ),
onPressed: () { ),
Navigator.push(context, FadePage(page: InsuranceUpdate())); ),
},
) : Container(),
],
body: Container( body: Container(
margin: EdgeInsets.only(left: SizeConfig.screenWidth * 0.004, right: SizeConfig.screenWidth * 0.004, top: SizeConfig.screenWidth * 0.04), child: ListView.separated(
child: ListView.builder( itemCount: model.insurance == null ? 0 : model.insurance.length,
itemCount: model.insurance == null ? 0 : model.insurance.length, itemBuilder: (BuildContext context, int index) {
itemBuilder: (BuildContext context, int index) { return Container(
return RoundedContainer( width: double.infinity,
backgroundColor: Colors.white, padding: EdgeInsets.only(
left: 10,
right: 10,
top: index == 0 ? 10 : 0,
bottom: index == model.insurance.length - 1 ? 100 : 0,
),
child: Card(
shape: cardRadius(12),
elevation: 2,
child: Padding( child: Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(12.0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: [
ExpansionTile( Text(
title: Container( model.insurance[index].groupName,
height: 65.0, style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, letterSpacing: -0.64),
child: Column( ),
crossAxisAlignment: CrossAxisAlignment.start, mHeight(8),
children: <Widget>[ Text(
Padding( TranslationBase.of(context).companyName + model.insurance[index].companyName,
padding: EdgeInsets.symmetric(vertical: 15.0), style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, letterSpacing: -0.48),
child: Texts( ),
model.insurance[index].groupName, Divider(
), thickness: 2,
color: Colors.black,
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
TranslationBase.of(context).category,
style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xFF575757)),
),
Text(
model.insurance[index].subCategoryDesc,
style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xFF575757)),
), ),
], ],
), ),
), Row(
children: <Widget>[ mainAxisAlignment: MainAxisAlignment.spaceBetween,
Container( children: [
padding: EdgeInsets.all(14), Text(
width: double.infinity, TranslationBase.of(context).expirationDate,
decoration: BoxDecoration(shape: BoxShape.rectangle, border: Border.all(color: Colors.grey, width: 0.2), borderRadius: BorderRadius.all(Radius.circular(2)), boxShadow: [ style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xFF575757)),
BoxShadow(
color: Colors.white70,
), ),
]), Text(
child: Column( convertDateFormat(
crossAxisAlignment: CrossAxisAlignment.start, model.insurance[index].cardValidTo,
children: [
Texts(
TranslationBase.of(context).companyName + model.insurance[index].companyName,
fontSize: 20.0,
fontWeight: FontWeight.w700,
), ),
Divider( style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xFF575757)),
color: Colors.black, ),
height: 25.0, ],
thickness: 0.5, ),
), Row(
Column( mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start, children: [
children: <Widget>[ Text(
Row( TranslationBase.of(context).status + ": ",
mainAxisAlignment: MainAxisAlignment.spaceBetween, style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xFF575757)),
children: [Texts(TranslationBase.of(context).category, fontSize: 18.5), Texts(model.insurance[index].subCategoryDesc, fontSize: 18.5)], ),
), model.insurance[index].isActive == true
Row( ? Text(
mainAxisAlignment: MainAxisAlignment.spaceBetween, TranslationBase.of(context).activeInsurence,
children: [ style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Colors.green),
Texts(TranslationBase.of(context).expirationDate, fontSize: 18.5), )
Texts( : Text(
convertDateFormat( TranslationBase.of(context).notActive,
model.insurance[index].cardValidTo, style: TextStyle(
), fontSize: 10,
fontSize: 18.5), fontWeight: FontWeight.w600,
], color: Colors.red,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(TranslationBase.of(context).status + ": ", fontSize: 18.5),
model.insurance[index].isActive == true
? Texts(TranslationBase.of(context).activeInsurence, color: Colors.green, fontWeight: FontWeight.w900, fontSize: 17.9)
: Texts(TranslationBase.of(context).notActive, color: Colors.red, fontWeight: FontWeight.w900, fontSize: 17.9)
],
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [Texts(TranslationBase.of(context).patientCard, fontSize: 18.5), Texts(model.insurance[index].patientCardID, fontSize: 18.5)],
),
Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
Texts(
TranslationBase.of(context).policyNumber,
fontSize: 18.5,
), ),
Texts( )
model.insurance[index].insurancePolicyNumber, ],
fontSize: 18.5, ),
) Row(
]), mainAxisAlignment: MainAxisAlignment.spaceBetween,
], children: [
), Text(
SizedBox( TranslationBase.of(context).patientCard,
height: 14.5, style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xFF575757)),
), ),
if (model.insurance[index].isActive == true) Text(
Container( model.insurance[index].patientCardID,
color: Colors.transparent, style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xFF575757)),
child: SecondaryButton( ),
onTap: () => {getDetails(model.insurance[index])}, ],
label: TranslationBase.of(context).seeDetails, ),
textColor: Colors.white, Row(
), mainAxisAlignment: MainAxisAlignment.spaceBetween,
width: double.infinity, children: [
), Text(
], TranslationBase.of(context).policyNumber,
), style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xFF575757)),
),
Text(
model.insurance[index].insurancePolicyNumber,
style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xFF575757)),
)
],
), ),
], ],
), ),
if (model.insurance[index].isActive == true)
SizedBox(
height: 8.5,
),
if (model.insurance[index].isActive == true)
Container(
color: Colors.transparent,
child: SecondaryButton(
onTap: () => {
getDetails(model.insurance[index]),
},
label: TranslationBase.of(context).seeDetails,
textColor: Colors.white,
),
width: double.infinity,
),
], ],
), ),
), ),
); ),
}), );
},
separatorBuilder: (BuildContext context, int index) {
return mHeight(8);
},
),
), ),
), ),
); );

@ -3,9 +3,11 @@ import 'package:diplomaticquarterapp/core/model/insurance/Insurance_card_details
import 'package:diplomaticquarterapp/core/viewModels/insurance_card_View_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/insurance_card_View_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/theme/colors.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';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.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:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -20,13 +22,7 @@ class InsuranceCardUpdateDetails extends StatelessWidget {
final int patientID; final int patientID;
final String name; final String name;
const InsuranceCardUpdateDetails( const InsuranceCardUpdateDetails({Key key, this.insuranceCardDetailsModel, this.patientIdentificationID, this.patientID, this.name}) : super(key: key);
{Key key,
this.insuranceCardDetailsModel,
this.patientIdentificationID,
this.patientID,
this.name})
: super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -36,290 +32,375 @@ class InsuranceCardUpdateDetails extends StatelessWidget {
isShowAppBar: true, isShowAppBar: true,
isShowDecPage: false, isShowDecPage: false,
appBarTitle: TranslationBase.of(context).cardDetail, appBarTitle: TranslationBase.of(context).cardDetail,
body: SingleChildScrollView( showNewAppBar: true,
child: Column( showNewAppBarTitle: true,
children: [ backgroundColor: CustomColors.appBackgroudGreyColor,
...List.generate( body: Column(
insuranceCardDetailsModel.length, children: [
(index) => Padding( Expanded(
padding: const EdgeInsets.all(8.0), child: SingleChildScrollView(
child: Container( child: Padding(
width: double.maxFinite, padding: const EdgeInsets.all(12.0),
margin: EdgeInsets.only(left: 8, right: 8, top: 8), child: Column(
height: projectViewModel.isArabic ? 320 : 240, children: [
decoration: BoxDecoration( ListView.separated(
borderRadius: BorderRadius.circular(25), physics: NeverScrollableScrollPhysics(),
color: Color(0xff515B5D), shrinkWrap: true,
), itemBuilder: (context, index) {
child: Padding( return Container(
padding: const EdgeInsets.all(12.0), width: double.maxFinite,
child: Column( // height: projectViewModel.isArabic ? 320 : 240,
crossAxisAlignment: CrossAxisAlignment.start, // decoration: containerRadius(CustomColors.accentColor, 12),
children: [ child: Card(
Text( shape: cardRadius(12),
insuranceCardDetailsModel[index].memberID, color: CustomColors.accentColor,
textScaleFactor: 2.1, elevation: 4,
style: TextStyle( child: Padding(
color: Colors.white, padding: const EdgeInsets.all(12.0),
letterSpacing: 8.0,
fontWeight: FontWeight.w400,
fontSize: 15),
),
SizedBox(
height: 5,
),
Texts(
insuranceCardDetailsModel[index].companyName,
fontSize: 14,
color: Colors.white,
),
SizedBox(
height: 25,
),
Row(
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(
TranslationBase.of(context).policyHolder,
color: Colors.white,
fontSize: 14,
),
Texts(
insuranceCardDetailsModel[index]
.memberName,
color: Colors.white,
fontSize: 14,
),
],
),
),
Expanded(
child: Column(
children: [
Texts(TranslationBase.of(context).policyNo,
color: Colors.white),
Texts(
insuranceCardDetailsModel[index]
.policyNumber,
color: Colors.white),
],
),
),
],
),
SizedBox(
height: 25,
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Expanded(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Texts( Text(
TranslationBase.of(context) insuranceCardDetailsModel[index].memberID,
.expiryDateTitle, style: TextStyle(
color: Colors.white, color: Colors.white,
fontSize: 12, letterSpacing: -0.48,
fontWeight: FontWeight.w600,
fontSize: 16,
),
), ),
Texts( SizedBox(
insuranceCardDetailsModel[index].dOB, height: 2,
color: Colors.white,
fontSize: 12,
), ),
], Text(
), insuranceCardDetailsModel[index].companyName,
), style: TextStyle(
Expanded( color: Colors.white,
child: Column( letterSpacing: -0.48,
children: [ fontWeight: FontWeight.w600,
Texts( fontSize: 14,
TranslationBase.of(context).classTitle, ),
color: Colors.white,
fontSize: 12,
), ),
Texts( SizedBox(
insuranceCardDetailsModel[index] height: 14,
.subCategory,
color: Colors.white,
fontSize: 12,
), ),
], Row(
), children: [
), Expanded(
Expanded( child: Column(
child: Column( crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Texts( Text(
TranslationBase.of(context).approval, TranslationBase.of(context).policyHolder,
color: Colors.white, style: TextStyle(
fontSize: 12, color: Colors.white,
letterSpacing: -0.48,
fontWeight: FontWeight.w600,
fontSize: 12,
),
),
Text(
insuranceCardDetailsModel[index].memberName,
style: TextStyle(
color: Colors.white,
letterSpacing: -0.48,
fontSize: 12,
),
),
],
),
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
TranslationBase.of(context).policyNo,
style: TextStyle(
color: Colors.white,
letterSpacing: -0.48,
fontWeight: FontWeight.w600,
fontSize: 12,
),
),
Text(
insuranceCardDetailsModel[index].policyNumber,
style: TextStyle(
color: Colors.white,
letterSpacing: -0.48,
fontSize: 12,
),
),
],
),
],
), ),
Texts( SizedBox(
insuranceCardDetailsModel[index] height: 14,
.approvalLimit
.toString(),
color: Colors.white,
fontSize: 12,
), ),
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
TranslationBase.of(context).expiryDateTitle,
style: TextStyle(
color: Colors.white,
letterSpacing: -0.48,
fontWeight: FontWeight.w600,
fontSize: 12,
),
),
Text(
insuranceCardDetailsModel[index].effectiveTo,
style: TextStyle(
color: Colors.white,
letterSpacing: -0.48,
fontSize: 12,
),
),
],
),
),
Expanded(
child: Column(
children: [
Text(
TranslationBase.of(context).classTitle,
style: TextStyle(
color: Colors.white,
letterSpacing: -0.48,
fontWeight: FontWeight.w600,
fontSize: 12,
),
),
Text(
insuranceCardDetailsModel[index].subCategory,
style: TextStyle(
color: Colors.white,
letterSpacing: -0.48,
fontSize: 12,
),
),
],
),
),
Expanded(
child: Column(
children: [
Text(
TranslationBase.of(context).approval,
style: TextStyle(
color: Colors.white,
letterSpacing: -0.48,
fontWeight: FontWeight.w600,
fontSize: 12,
),
),
Text(
insuranceCardDetailsModel[index].approvalLimit.toString(),
style: TextStyle(
color: Colors.white,
letterSpacing: -0.48,
fontSize: 12,
),
),
],
),
),
],
)
], ],
), ),
), ),
], ),
) );
], },
separatorBuilder: (context, index) {
return mHeight(12);
},
itemCount: insuranceCardDetailsModel.length,
), ),
), if (insuranceCardDetailsModel.isEmpty)
), Column(
), crossAxisAlignment: CrossAxisAlignment.center,
), children: [
if(insuranceCardDetailsModel.isEmpty) Container(
Column( child: Card(
crossAxisAlignment: CrossAxisAlignment.center, color: Colors.white,
children: [ shape: cardRadius(12),
Container(
margin: EdgeInsets.all(10.0),
child: Card(
margin: EdgeInsets.fromLTRB(
8.0, 16.0, 8.0, 8.0),
color: Colors.white,
shape: RoundedRectangleBorder(
borderRadius:
BorderRadius.circular(10),
),
child: Container(
width: MediaQuery.of(context).size.width,
padding: EdgeInsets.all(10.0),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Expanded(
flex: 3,
child: Container( child: Container(
margin: EdgeInsets.only( width: MediaQuery.of(context).size.width,
top: 2.0, padding: EdgeInsets.all(10.0),
left: 10.0, child: Row(
right: 20.0), crossAxisAlignment: CrossAxisAlignment.start,
child: Column( mainAxisSize: MainAxisSize.max,
crossAxisAlignment:
CrossAxisAlignment
.start,
children: <Widget>[ children: <Widget>[
Texts( Expanded(
name, child: Container(
fontSize: 14, margin: EdgeInsets.only(top: 2.0, left: 10.0, right: 20.0),
color: Colors.black, child: Column(
fontWeight: crossAxisAlignment: CrossAxisAlignment.start,
FontWeight.w500, children: <Widget>[
), Text(
SizedBox( name,
height: 8, style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
letterSpacing: -0.46,
),
),
Text(
TranslationBase.of(context).fileno + ": " + patientID.toString(),
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w600,
letterSpacing: -0.46,
),
)
],
),
),
), ),
Texts(
TranslationBase.of(
context)
.fileno +
": " +patientID.toString(),
fontSize: 14,
color: Colors.black,
fontWeight:
FontWeight.w500,
)
], ],
), ),
), ),
), ),
], ),
), SizedBox(
), height: 150,
), ),
), Image.asset(
SizedBox(height: 150,), 'assets/images/no-data-found.png',
Image.asset('assets/images/no-data-found.png',width: 80,height: 80,), width: 80,
SizedBox(height: 8,), height: 80,
Texts(TranslationBase.of(context).noDataAvailable) ),
], SizedBox(
) height: 8,
], ),
), Text(
), TranslationBase.of(context).noDataAvailable,
bottomSheet: Container( style: TextStyle(
width: double.infinity, fontSize: 14,
height:insuranceCardDetailsModel.isEmpty? MediaQuery.of(context).size.height * 0.14:MediaQuery.of(context).size.height * 0.21, fontWeight: FontWeight.w600,
child: Container( letterSpacing: -0.48,
margin: EdgeInsets.only(left: 8, right: 8), ),
child: Column( )
children: [ ],
SizedBox( )
height: 8, ],
),
if(insuranceCardDetailsModel.isEmpty)
SecondaryButton(
textColor: Colors.white,
label: TranslationBase.of(context).scanNow.toUpperCase(),
color: Theme.of(context).primaryColor,
small: true,
onTap: () async {
confirmAttachInsuranceCardImageDialogDialog(
context: context,
name: name,
fileNo: patientID.toString(),
model: model);
},
), ),
if(insuranceCardDetailsModel.isNotEmpty) ),
SecondaryButton( ),
textColor: Colors.white, ),
label: TranslationBase.of(context).agree.toUpperCase(), Padding(
color: Theme.of(context).primaryColor, padding: const EdgeInsets.all(12.0),
onTap: () async { child: Column(
GifLoaderDialogUtils.showMyDialog(context); children: [
await model.uploadInsuranceCard( if (insuranceCardDetailsModel.isEmpty)
patientIdentificationID: patientIdentificationID, SecondaryButton(
patientID: patientID); textColor: Colors.white,
GifLoaderDialogUtils.hideDialog(context); label: TranslationBase.of(context).scanNow.toUpperCase(),
if (model.state == ViewState.ErrorLocal) { color: CustomColors.accentColor,
AppToast.showErrorToast(message: model.error); small: true,
} else { onTap: () async {
AppToast.showSuccessToast( confirmAttachInsuranceCardImageDialogDialog(context: context, name: name, fileNo: patientID.toString(), model: model);
message: TranslationBase.of(context).requestSent); },
} ),
}, if (insuranceCardDetailsModel.isNotEmpty)
),if(insuranceCardDetailsModel.isNotEmpty) SecondaryButton(
SizedBox( textColor: Colors.white,
height: 12, label: TranslationBase.of(context).agree.toUpperCase(),
),if(insuranceCardDetailsModel.isNotEmpty) color: CustomColors.accentColor,
SecondaryButton( onTap: () async {
textColor: Colors.white, GifLoaderDialogUtils.showMyDialog(context);
label: TranslationBase.of(context).disagree.toUpperCase(), await model.uploadInsuranceCard(patientIdentificationID: patientIdentificationID, patientID: patientID);
color: Colors.grey[800], GifLoaderDialogUtils.hideDialog(context);
onTap: () async { if (model.state == ViewState.ErrorLocal) {
confirmAttachInsuranceCardImageDialogDialog( AppToast.showErrorToast(message: model.error);
context: context, } else {
name: name, AppToast.showSuccessToast(message: TranslationBase.of(context).requestSent);
fileNo: patientID.toString(), }
model: model); },
}, ),
) if (insuranceCardDetailsModel.isNotEmpty)
], SizedBox(
height: 12,
),
if (insuranceCardDetailsModel.isNotEmpty)
SecondaryButton(
textColor: Colors.white,
label: TranslationBase.of(context).disagree.toUpperCase(),
color: Colors.grey[800],
onTap: () async {
confirmAttachInsuranceCardImageDialogDialog(context: context, name: name, fileNo: patientID.toString(), model: model);
},
)
],
),
), ),
), ],
), ),
// bottomSheet: Container(
// width: double.infinity,
// height: insuranceCardDetailsModel.isEmpty ? MediaQuery.of(context).size.height * 0.14 : MediaQuery.of(context).size.height * 0.21,
// child: Container(
// margin: EdgeInsets.only(left: 8, right: 8),
// child: Column(
// children: [
// SizedBox(
// height: 8,
// ),
// if (insuranceCardDetailsModel.isEmpty)
// SecondaryButton(
// textColor: Colors.white,
// label: TranslationBase.of(context).scanNow.toUpperCase(),
// color: Theme.of(context).primaryColor,
// small: true,
// onTap: () async {
// confirmAttachInsuranceCardImageDialogDialog(context: context, name: name, fileNo: patientID.toString(), model: model);
// },
// ),
// if (insuranceCardDetailsModel.isNotEmpty)
// SecondaryButton(
// textColor: Colors.white,
// label: TranslationBase.of(context).agree.toUpperCase(),
// color: Theme.of(context).primaryColor,
// onTap: () async {
// GifLoaderDialogUtils.showMyDialog(context);
// await model.uploadInsuranceCard(patientIdentificationID: patientIdentificationID, patientID: patientID);
// GifLoaderDialogUtils.hideDialog(context);
// if (model.state == ViewState.ErrorLocal) {
// AppToast.showErrorToast(message: model.error);
// } else {
// AppToast.showSuccessToast(message: TranslationBase.of(context).requestSent);
// }
// },
// ),
// if (insuranceCardDetailsModel.isNotEmpty)
// SizedBox(
// height: 12,
// ),
// if (insuranceCardDetailsModel.isNotEmpty)
// SecondaryButton(
// textColor: Colors.white,
// label: TranslationBase.of(context).disagree.toUpperCase(),
// color: Colors.grey[800],
// onTap: () async {
// confirmAttachInsuranceCardImageDialogDialog(context: context, name: name, fileNo: patientID.toString(), model: model);
// },
// )
// ],
// ),
// ),
// ),
), ),
); );
} }
void confirmAttachInsuranceCardImageDialogDialog( void confirmAttachInsuranceCardImageDialogDialog({BuildContext context, String name, String fileNo, InsuranceViewModel model}) {
{BuildContext context,
String name,
String fileNo,
InsuranceViewModel model}) {
showDialog( showDialog(
context: context, context: context,
child: AttachInsuranceCardImageDialog( child: AttachInsuranceCardImageDialog(
@ -327,17 +408,12 @@ class InsuranceCardUpdateDetails extends StatelessWidget {
name: name, name: name,
image: (file, image) async { image: (file, image) async {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await model.uploadInsuranceCard( await model.uploadInsuranceCard(patientIdentificationID: patientIdentificationID, patientID: patientID, image: image);
patientIdentificationID: patientIdentificationID,
patientID: patientID,
image: image);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (model.state == ViewState.ErrorLocal || if (model.state == ViewState.ErrorLocal || model.state == ViewState.Error) {
model.state == ViewState.Error) {
AppToast.showErrorToast(message: model.error); AppToast.showErrorToast(message: model.error);
} else { } else {
AppToast.showSuccessToast( AppToast.showSuccessToast(message: TranslationBase.of(context).requestSent);
message: TranslationBase.of(context).requestSent);
} }
Navigator.pop(context); Navigator.pop(context);
}, },

@ -1,5 +1,6 @@
import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
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_html/flutter_html.dart'; import 'package:flutter_html/flutter_html.dart';
@ -17,6 +18,9 @@ class InsuranceCardDetails extends StatelessWidget {
return AppScaffold( return AppScaffold(
isShowAppBar: true, isShowAppBar: true,
appBarTitle: TranslationBase.of(context).cardDetail, appBarTitle: TranslationBase.of(context).cardDetail,
showNewAppBarTitle: true,
showNewAppBar: true,
backgroundColor: CustomColors.appBackgroudGreyColor,
body: Center( body: Center(
child: SingleChildScrollView( child: SingleChildScrollView(
child: Html( child: Html(

@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/core/viewModels/insurance_card_View_model.d
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';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.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:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
@ -17,223 +18,137 @@ class InsurancePage extends StatelessWidget {
InsuranceCardService _insuranceCardService = locator<InsuranceCardService>(); InsuranceCardService _insuranceCardService = locator<InsuranceCardService>();
InsurancePage({Key key, this.model}) : super(key: key); InsurancePage({Key key, this.model}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return SingleChildScrollView( return SingleChildScrollView(
child: Column( child: Padding(
children: [ padding: const EdgeInsets.all(12.0),
SizedBox( child: Column(
height: 65, children: [
), Container(
Container( width: double.infinity,
margin: EdgeInsets.all(10.0), child: Card(
color: Colors.white, shape: cardRadius(12),
width: MediaQuery.of(context).size.width, child: Padding(
padding: EdgeInsets.all(10.0), padding: const EdgeInsets.all(12.0),
child: Row( child: InkWell(
crossAxisAlignment: CrossAxisAlignment.start, onTap: () {
mainAxisSize: MainAxisSize.max, getDetails(
children: <Widget>[ setupID: '010266',
if (model.user != null) projectID: 15,
Expanded( patientIdentificationID: model.user.patientIdentificationNo,
flex: 3, patientID: model.user.patientID,
child: Container( name: model.user.firstName + " " + model.user.lastName,
margin: context: context,
EdgeInsets.only(top: 2.0, left: 10.0, right: 20.0), );
child: Column( },
crossAxisAlignment: CrossAxisAlignment.start, child: Row(
children: <Widget>[ crossAxisAlignment: CrossAxisAlignment.end,
Texts( mainAxisSize: MainAxisSize.max,
model.user.firstName + " " + model.user.lastName,
fontSize: 14,
color: Colors.black,
fontWeight: FontWeight.w500,
),
SizedBox(
height: 8,
),
Texts(
TranslationBase.of(context).fileno +
": " +
model.user.patientID.toString(),
fontSize: 14,
color: Colors.black,
fontWeight: FontWeight.w500,
)
],
),
),
),
Expanded(
flex: 2,
child: Container(
margin: EdgeInsets.only(top: 2.0),
child: Column(
children: <Widget>[ children: <Widget>[
Container( if (model.user != null)
child: SecondaryButton( Expanded(
label: TranslationBase.of(context).fetchData, child: Column(
small: true, crossAxisAlignment: CrossAxisAlignment.start,
textColor: Colors.white, children: <Widget>[
onTap: () { Text(
getDetails( model.user.firstName + " " + model.user.lastName,
setupID: '010266', style: TextStyle(
projectID: 15, fontSize: 14,
patientIdentificationID: fontWeight: FontWeight.w600,
model.user.patientIdentificationNo, letterSpacing: -0.46,
patientID: model.user.patientID, ),
name: model.user.firstName + ),
" " + Text(
model.user.lastName, TranslationBase.of(context).fileno + ": " + model.user.patientID.toString(),
context: context); style: TextStyle(
}, fontSize: 12,
fontWeight: FontWeight.w600,
letterSpacing: -0.46,
),
)
],
),
), ),
), Icon(Icons.arrow_forward),
], ],
), ),
), ),
) ),
], ),
), ),
), if (model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList != null ?? false)
if (model.getAllSharedRecordsByStatusResponse ListView.separated(
.getAllSharedRecordsByStatusList != physics: NeverScrollableScrollPhysics(),
null ?? shrinkWrap: true,
false) itemBuilder: (context, index) {
...List.generate( return model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].status == 3
model.getAllSharedRecordsByStatusResponse ? InkWell(
.getAllSharedRecordsByStatusList.length, onTap: () {
(index) => model.getAllSharedRecordsByStatusResponse getDetails(
.getAllSharedRecordsByStatusList[index].status == projectID: 15,
3 patientIdentificationID: model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].patientIdenficationNumber,
? Container( setupID: '010266',
margin: EdgeInsets.all(10.0), patientID: model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].responseID,
child: Card( name: model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].patientName,
margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0), context: context);
color: Colors.white, },
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
),
child: Container( child: Container(
width: MediaQuery.of(context).size.width, width: double.infinity,
padding: EdgeInsets.all(10.0), child: Card(
child: Row( shape: cardRadius(12),
crossAxisAlignment: CrossAxisAlignment.start, child: Padding(
mainAxisSize: MainAxisSize.max, padding: const EdgeInsets.all(12.0),
children: <Widget>[ child: Row(
Expanded( crossAxisAlignment: CrossAxisAlignment.end,
flex: 3, mainAxisSize: MainAxisSize.max,
child: Container( children: [
margin: EdgeInsets.only( Expanded(
top: 2.0, left: 10.0, right: 20.0), child: Column(
child: Column( crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: children: [
CrossAxisAlignment.start, Text(
children: <Widget>[ model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].patientName,
Texts( style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, letterSpacing: -0.46),
model ),
.getAllSharedRecordsByStatusResponse Text(
.getAllSharedRecordsByStatusList[ TranslationBase.of(context).fileno + ": " + model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].responseID.toString(),
index] style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, letterSpacing: -0.46),
.patientName,
fontSize: 14,
color: Colors.black,
fontWeight: FontWeight.w500,
),
SizedBox(
height: 8,
),
Texts(
TranslationBase.of(context).fileno +
": " +
model
.getAllSharedRecordsByStatusResponse
.getAllSharedRecordsByStatusList[
index]
.patientID
.toString(),
fontSize: 14,
color: Colors.black,
fontWeight: FontWeight.w500,
)
],
),
),
),
Expanded(
flex: 2,
child: Container(
margin: EdgeInsets.only(top: 2.0),
child: Column(
children: <Widget>[
Container(
child: SecondaryButton(
label: TranslationBase.of(context)
.fetchData,
small: true,
textColor: Colors.white,
onTap: () {
getDetails(
projectID: 15,
patientIdentificationID: model
.getAllSharedRecordsByStatusResponse
.getAllSharedRecordsByStatusList[
index]
.patientIdenficationNumber,
setupID: '010266',
patientID: model
.getAllSharedRecordsByStatusResponse
.getAllSharedRecordsByStatusList[
index]
.responseID,
name: model
.getAllSharedRecordsByStatusResponse
.getAllSharedRecordsByStatusList[
index]
.patientName,
context: context);
},
), ),
), ],
], ),
), ),
), Icon(Icons.arrow_forward),
) ],
], ),
),
), ),
), ),
), )
) : Container();
: Container()), },
], separatorBuilder: (context, index) {
return mHeight(model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].status == 3 ? 8 : 0);
},
itemCount: model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList.length,
),
],
),
), ),
); );
} }
getDetails( getDetails({String setupID, int projectID, String patientIdentificationID, int patientID, String name, BuildContext context}) {
{String setupID,
int projectID,
String patientIdentificationID,
int patientID,
String name,
BuildContext context}) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
_insuranceCardService _insuranceCardService.getPatientInsuranceDetails(setupID: setupID, projectID: projectID, patientID: patientID, patientIdentificationID: patientIdentificationID).then((value) {
.getPatientInsuranceDetails(
setupID: setupID,
projectID: projectID,
patientID: patientID,
patientIdentificationID: patientIdentificationID)
.then((value) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (!_insuranceCardService.hasError && if (!_insuranceCardService.hasError && _insuranceCardService.isHaveInsuranceCard) {
_insuranceCardService.isHaveInsuranceCard) {
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
page: InsuranceCardUpdateDetails( page: InsuranceCardUpdateDetails(
insuranceCardDetailsModel: insuranceCardDetailsModel: _insuranceCardService.insuranceCardDetailsList,
_insuranceCardService.insuranceCardDetailsList,
patientID: patientID, patientID: patientID,
patientIdentificationID: patientIdentificationID, patientIdentificationID: patientIdentificationID,
name: name, name: name,

@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/service/insurance_service.dart'; import 'package:diplomaticquarterapp/core/service/insurance_service.dart';
import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/pages/insurance/insurance_details.dart'; import 'package:diplomaticquarterapp/pages/insurance/insurance_details.dart';
import 'package:diplomaticquarterapp/theme/colors.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';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
@ -23,20 +24,17 @@ class InsuranceUpdate extends StatefulWidget {
_InsuranceUpdateState createState() => _InsuranceUpdateState(); _InsuranceUpdateState createState() => _InsuranceUpdateState();
} }
class _InsuranceUpdateState extends State<InsuranceUpdate> class _InsuranceUpdateState extends State<InsuranceUpdate> with SingleTickerProviderStateMixin {
with SingleTickerProviderStateMixin {
TabController _tabController; TabController _tabController;
List<ImagesInfo> imagesInfo = List(); List<ImagesInfo> imagesInfo = List();
@override @override
void initState() { void initState() {
super.initState(); super.initState();
_tabController = TabController(length: 2, vsync: this); _tabController = TabController(length: 2, vsync: this);
imagesInfo.add(ImagesInfo( imagesInfo.add(ImagesInfo(
imageEn: imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/insurance-card/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/insurance-card/ar/0.png'));
'https://hmgwebservices.com/Images/MobileApp/imges-info/insurance-card/en/0.png',
imageAr:
'https://hmgwebservices.com/Images/MobileApp/imges-info/insurance-card/ar/0.png'));
} }
void dispose() { void dispose() {
@ -47,8 +45,7 @@ class _InsuranceUpdateState extends State<InsuranceUpdate>
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<InsuranceViewModel>( return BaseView<InsuranceViewModel>(
onModelReady: (model) => model.getInsuranceUpdated(), onModelReady: (model) => model.getInsuranceUpdated(),
builder: (BuildContext context, InsuranceViewModel model, Widget child) => builder: (BuildContext context, InsuranceViewModel model, Widget child) => AppScaffold(
AppScaffold(
appBarTitle: TranslationBase.of(context).insurCards, appBarTitle: TranslationBase.of(context).insurCards,
description: TranslationBase.of(context).infoInsurCards, description: TranslationBase.of(context).infoInsurCards,
infoList: TranslationBase.of(context).infoPrescriptionsPoints, infoList: TranslationBase.of(context).infoPrescriptionsPoints,
@ -56,79 +53,67 @@ class _InsuranceUpdateState extends State<InsuranceUpdate>
isShowAppBar: true, isShowAppBar: true,
isShowDecPage: true, isShowDecPage: true,
baseViewModel: model, baseViewModel: model,
body: Scaffold( showNewAppBarTitle: true,
extendBodyBehindAppBar: true, showNewAppBar: true,
appBar: PreferredSize( backgroundColor: CustomColors.appBackgroudGreyColor,
preferredSize: Size.fromHeight(70.0), body: Column(
child: Stack( children: <Widget>[
children: <Widget>[ Container(
Center( height: 45,
child: Container( child: TabBar(
height: 60.0, controller: _tabController,
margin: EdgeInsets.only(top: 10.0), isScrollable: false,
width: MediaQuery.of(context).size.width * 1.9, indicatorWeight: 3.0,
decoration: BoxDecoration( indicatorColor: CustomColors.accentColor,
border: Border( labelColor: Theme.of(context).primaryColor,
bottom: BorderSide( labelPadding: EdgeInsets.symmetric(horizontal: 13.0, vertical: 2.0),
color: Theme.of(context).dividerColor, unselectedLabelColor: Colors.grey,
width: 5.7, tabs: <Widget>[
Container(
child: Center(
child: Text(
TranslationBase.of(context).updateInsuranceSubtitle,
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
letterSpacing: -0.48,
), ),
), ),
color: Colors.white,
), ),
),
Container(
child: Center( child: Center(
child: TabBar( child: Text(
controller: _tabController, TranslationBase.of(context).history,
isScrollable: true, style: TextStyle(
indicatorWeight: 4.0, fontSize: 16,
indicatorColor: Theme.of(context).primaryColor, fontWeight: FontWeight.w600,
labelColor: Theme.of(context).primaryColor, letterSpacing: -0.48,
labelPadding: EdgeInsets.symmetric( ),
horizontal: 13.0, vertical: 2.0),
unselectedLabelColor: Colors.grey,
tabs: <Widget>[
Container(
width: MediaQuery.of(context).size.width * 0.35,
child: Center(
child: Texts(TranslationBase.of(context)
.updateInsuranceSubtitle),
),
),
Container(
width: MediaQuery.of(context).size.width * 0.35,
child: Center(
child: Texts(TranslationBase.of(context).history),
),
),
],
), ),
), ),
), ),
) ],
], ),
), ),
), Expanded(
body: Column( child: TabBarView(
children: <Widget>[ physics: BouncingScrollPhysics(),
Expanded( controller: _tabController,
child: TabBarView( children: <Widget>[
physics: BouncingScrollPhysics(), InsurancePage(model: model),
controller: _tabController, Container(
children: <Widget>[ child: Padding(
InsurancePage(model: model), padding: const EdgeInsets.all(12.0),
Container(
child: ListView.builder( child: ListView.builder(
itemCount: model.insuranceUpdate == null itemCount: model.insuranceUpdate == null ? 0 : model.insuranceUpdate.length,
? 0
: model.insuranceUpdate.length,
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
return Container( return Container(
margin: EdgeInsets.all(10.0),
child: Card( child: Card(
margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0),
color: Colors.white, color: Colors.white,
elevation: 2,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(12),
), ),
child: Container( child: Container(
width: MediaQuery.of(context).size.width, width: MediaQuery.of(context).size.width,
@ -143,47 +128,37 @@ class _InsuranceUpdateState extends State<InsuranceUpdate>
Expanded( Expanded(
flex: 3, flex: 3,
child: Container( child: Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(top: 2.0, left: 10.0, right: 20.0),
top: 2.0,
left: 10.0,
right: 20.0),
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Texts( Text(
model.user.firstName + model.user.firstName + " " + model.user.lastName,
" " + style: TextStyle(
model.user.lastName, fontSize: 14,
fontSize: 14, fontWeight: FontWeight.w600,
fontWeight: FontWeight.w500, letterSpacing: -0.46,
color: Colors.black, ),
), ),
SizedBox( SizedBox(
height: 8, height: 4,
),
Texts(
TranslationBase.of(context)
.fileno +
": " +
model
.insuranceUpdate[
index]
.patientID
.toString(),
fontSize: 14,
fontWeight: FontWeight.w500,
color: Colors.black,
), ),
SizedBox( Text(
height: 8, TranslationBase.of(context).fileno + ": " + model.insuranceUpdate[index].patientID.toString(),
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
letterSpacing: -0.46,
),
), ),
Texts(
model.insuranceUpdate[index] Text(
.createdOn, model.insuranceUpdate[index].createdOn,
fontSize: 14, style: TextStyle(
fontWeight: FontWeight.w500, fontSize: 14,
color: Colors.black, fontWeight: FontWeight.w600,
letterSpacing: -0.46,
),
), ),
], ],
), ),
@ -195,19 +170,16 @@ class _InsuranceUpdateState extends State<InsuranceUpdate>
margin: EdgeInsets.only(top: 20.0), margin: EdgeInsets.only(top: 20.0),
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
Image.asset( Image.asset("assets/images/new-design/confirm_button.png", width: 30.0, height: 30.0),
"assets/images/new-design/confirm_button.png",
width: 30.0,
height: 30.0),
Container( Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(top: 6.5, left: 2.0),
top: 13.5, left: 2.0), child: Text(
child: Texts( model.insuranceUpdate[index].statusDescription,
model.insuranceUpdate[index] style: TextStyle(
.statusDescription, fontSize: 10,
textAlign: TextAlign.center, fontWeight: FontWeight.w600,
fontSize: 12, letterSpacing: -0.46,
color: Colors.black, ),
), ),
), ),
], ],
@ -223,10 +195,10 @@ class _InsuranceUpdateState extends State<InsuranceUpdate>
); );
}), }),
), ),
], ),
)) ],
], ))
), ],
), ),
), ),
); );

@ -509,7 +509,7 @@ class _HomePageFragment2State extends State<HomePageFragment2> {
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Text( Text(
TranslationBase.of(context).HMGPharmacy, TranslationBase.of(context).onlinePharmacy,
style: TextStyle( style: TextStyle(
color: Colors.black, color: Colors.black,
fontSize: 14, fontSize: 14,

@ -524,12 +524,6 @@ class _HomePageState extends State<HomePage> {
) )
: Column( : Column(
children: <Widget>[ children: <Widget>[
// if (projectViewModel.user != null && model.isLogin && model.user.outSA == 1)
// Image.asset(
// 'assets/images/lock_icon.png',
// width: 50,
// height: 50,
// ),
Image.asset( Image.asset(
'assets/images/pharmacy_logo.png', 'assets/images/pharmacy_logo.png',
width: 40, width: 40,

@ -232,7 +232,6 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
locationUtils = new LocationUtils(isShowConfirmDialog: false, context: context); locationUtils = new LocationUtils(isShowConfirmDialog: false, context: context);
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance.addPostFrameCallback((_) {
locationUtils.getCurrentLocation();
if (projectViewModel.isLogin) { if (projectViewModel.isLogin) {
familyFileProvider.getSharedRecordByStatus(); familyFileProvider.getSharedRecordByStatus();
} }
@ -249,6 +248,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
} }
requestPermissions().then((results) { requestPermissions().then((results) {
locationUtils.getCurrentLocation();
_firebaseMessaging.getToken().then((String token) { _firebaseMessaging.getToken().then((String token) {
print("Firebase Token: " + token); print("Firebase Token: " + token);
sharedPref.setString(PUSH_TOKEN, token); sharedPref.setString(PUSH_TOKEN, token);
@ -266,7 +266,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
// if (results[Permission.calendar].isGranted) ; // if (results[Permission.calendar].isGranted) ;
}); });
requestPermissions(); // requestPermissions();
// }); // });
// //

@ -148,16 +148,13 @@ class LoggedSliderView extends StatelessWidget {
), ),
mWidth(6), mWidth(6),
Texts( Texts(
"Height: ${model.heightCm} ${TranslationBase.of(context).cm}", "${TranslationBase.of(context).height}: ${model.heightCm} ${TranslationBase.of(context).cm}",
color: Colors.white, color: Colors.white,
fontSize: 10, fontSize: 10,
) )
], ],
), ),
), ),
SizedBox(
width: 3,
),
Expanded( Expanded(
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
@ -167,13 +164,10 @@ class LoggedSliderView extends StatelessWidget {
height: 12, height: 12,
), ),
mWidth(6), mWidth(6),
Texts('Weight: ${model.weightKg} ${TranslationBase.of(context).kg}', color: Colors.white, fontSize: 10) Texts('${TranslationBase.of(context).weight}: ${model.weightKg} ${TranslationBase.of(context).kg}', color: Colors.white, fontSize: 10)
], ],
), ),
), ),
SizedBox(
width: 3,
),
Expanded( Expanded(
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
@ -183,7 +177,7 @@ class LoggedSliderView extends StatelessWidget {
height: 12, height: 12,
), ),
mWidth(6), mWidth(6),
Texts('Blood: ${model.booldType}', color: Colors.white, fontSize: 10) Texts('${TranslationBase.of(context).bloodType}: ${model.booldType}', color: Colors.white, fontSize: 10)
], ],
), ),
), ),

@ -50,7 +50,7 @@ class _LiveCareHomeState extends State<LiveCareHome> with SingleTickerProviderSt
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return AppScaffold(
appBarTitle: "LiveCare", appBarTitle: TranslationBase.of(context).livecare,
isShowAppBar: true, isShowAppBar: true,
imagesInfo: imagesInfo, imagesInfo: imagesInfo,
description: TranslationBase.of(context).erConsultation, description: TranslationBase.of(context).erConsultation,

@ -1,4 +1,5 @@
import 'package:diplomaticquarterapp/models/LiveCare/ClinicsServiceTimingsResponse.dart'; import 'package:diplomaticquarterapp/models/LiveCare/ClinicsServiceTimingsResponse.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class ClinicTimingsDialog extends StatefulWidget { class ClinicTimingsDialog extends StatefulWidget {
@ -31,7 +32,7 @@ class _ClinicTimingsDialogState extends State<ClinicTimingsDialog> {
shape: shape:
RoundedRectangleBorder(borderRadius: BorderRadius.circular(12.0)), RoundedRectangleBorder(borderRadius: BorderRadius.circular(12.0)),
child: Container( child: Container(
height: MediaQuery.of(context).size.height * 0.68, height: 580.0,
margin: EdgeInsets.all(20.0), margin: EdgeInsets.all(20.0),
width: 450.0, width: 450.0,
child: Column( child: Column(
@ -41,7 +42,7 @@ class _ClinicTimingsDialogState extends State<ClinicTimingsDialog> {
Container( Container(
alignment: Alignment.center, alignment: Alignment.center,
margin: EdgeInsets.only(bottom: 10.0), margin: EdgeInsets.only(bottom: 10.0),
child: Text("Clinic Schedule", child: Text(TranslationBase.of(context).clinicSchedule,
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: style:
TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold)), TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold)),
@ -98,7 +99,7 @@ class _ClinicTimingsDialogState extends State<ClinicTimingsDialog> {
Navigator.pop(context); Navigator.pop(context);
}, },
child: Container( child: Container(
child: Text("OK", child: Text(TranslationBase.of(context).ok,
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
fontSize: 18.0, fontSize: 18.0,

@ -1,7 +1,9 @@
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/LiveCare/ERAppointmentFeesResponse.dart'; import 'package:diplomaticquarterapp/models/LiveCare/ERAppointmentFeesResponse.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class LiveCarePaymentDialog extends StatefulWidget { class LiveCarePaymentDialog extends StatefulWidget {
GetERAppointmentFeesList getERAppointmentFeesList; GetERAppointmentFeesList getERAppointmentFeesList;
@ -20,11 +22,14 @@ class LiveCarePaymentDialog extends StatefulWidget {
class _LiveCarePaymentDialogState extends State<LiveCarePaymentDialog> { class _LiveCarePaymentDialogState extends State<LiveCarePaymentDialog> {
int _selected = 0; int _selected = 0;
ProjectViewModel projectViewModel;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
var size = MediaQuery.of(context).size; var size = MediaQuery.of(context).size;
final double itemHeight = ((size.height - kToolbarHeight - 24) * 0.42) / 2; final double itemHeight = ((size.height - kToolbarHeight - 24) * 0.42) / 2;
final double itemWidth = size.width / 2; final double itemWidth = size.width / 2;
projectViewModel = Provider.of(context);
return Container( return Container(
child: Dialog( child: Dialog(
@ -66,7 +71,7 @@ class _LiveCarePaymentDialogState extends State<LiveCarePaymentDialog> {
), ),
), ),
Expanded( Expanded(
child: Text(widget.waitingTime.toString() + " Minutes", child: Text(widget.waitingTime.toString() + " " + TranslationBase.of(context).minute,
textAlign: TextAlign.start, textAlign: TextAlign.start,
style: TextStyle( style: TextStyle(
fontSize: 16.0, fontSize: 16.0,
@ -156,7 +161,7 @@ class _LiveCarePaymentDialogState extends State<LiveCarePaymentDialog> {
children: <Widget>[ children: <Widget>[
Image.asset("assets/images/new-design/alert-triangle.png"), Image.asset("assets/images/new-design/alert-triangle.png"),
Container( Container(
margin: EdgeInsets.only(left: 10.0), margin: EdgeInsets.only(left: 10.0, right: 10.0),
width: MediaQuery.of(context).size.width * 0.55, width: MediaQuery.of(context).size.width * 0.55,
child: Text(TranslationBase.of(context).insuredPatient, child: Text(TranslationBase.of(context).insuredPatient,
style: TextStyle(fontSize: 13.0)), style: TextStyle(fontSize: 13.0)),
@ -181,14 +186,6 @@ class _LiveCarePaymentDialogState extends State<LiveCarePaymentDialog> {
style: new TextStyle(fontSize: 14.0), style: new TextStyle(fontSize: 14.0),
), ),
), ),
// Container(
//// alignment: Alignment.centerRight,
// child: new Text(
// 'Click Here',
// textAlign: TextAlign.end,
// style: new TextStyle(fontSize: 16.0),
// ),
// ),
], ],
), ),
), ),
@ -228,7 +225,7 @@ class _LiveCarePaymentDialogState extends State<LiveCarePaymentDialog> {
Navigator.pop(context, false); Navigator.pop(context, false);
}, },
child: Container( child: Container(
child: Text("Cancel", child: Text(TranslationBase.of(context).cancel,
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
fontSize: 18.0, color: Colors.red[700])), fontSize: 18.0, color: Colors.red[700])),
@ -247,7 +244,7 @@ class _LiveCarePaymentDialogState extends State<LiveCarePaymentDialog> {
} }
}, },
child: Container( child: Container(
child: Text("Ok", child: Text(TranslationBase.of(context).ok,
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
fontSize: 18.0, fontSize: 18.0,
@ -278,7 +275,7 @@ class _LiveCarePaymentDialogState extends State<LiveCarePaymentDialog> {
textAlign: TextAlign.end, textAlign: TextAlign.end,
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
fontFamily: 'Open-Sans', // fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins',
letterSpacing: 0.5, letterSpacing: 0.5,
color: Colors.black)), color: Colors.black)),
); );
@ -291,7 +288,7 @@ class _LiveCarePaymentDialogState extends State<LiveCarePaymentDialog> {
textAlign: TextAlign.end, textAlign: TextAlign.end,
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
fontFamily: 'Open-Sans', // fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins',
letterSpacing: 0.5, letterSpacing: 0.5,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.black)), color: Colors.black)),

@ -157,7 +157,6 @@ class _clinic_listState extends State<ClinicList> {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
service.getERAppointmentTime(selectedClinicID, context).then((res) { service.getERAppointmentTime(selectedClinicID, context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
print(res);
showLiveCarePaymentDialog(getERAppointmentFeesList, res['WatingtimeInteger']); showLiveCarePaymentDialog(getERAppointmentFeesList, res['WatingtimeInteger']);
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
@ -236,6 +235,7 @@ class _clinic_listState extends State<ClinicList> {
appo.clinicID = selectedClinicID; appo.clinicID = selectedClinicID;
appo.appointmentNo = DateTime.now().millisecondsSinceEpoch; appo.appointmentNo = DateTime.now().millisecondsSinceEpoch;
appo.projectID = 12;
if (await this.sharedPref.getObject(USER_PROFILE) != null) { if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
@ -253,9 +253,9 @@ class _clinic_listState extends State<ClinicList> {
} }
openPayment(String paymentMethod, AuthenticatedUser authenticatedUser, double amount, AppoitmentAllHistoryResultList appo) { openPayment(String paymentMethod, AuthenticatedUser authenticatedUser, double amount, AppoitmentAllHistoryResultList appo) {
browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart); browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart, context: context);
browser.openPaymentBrowser(amount, "LiveCare Payment", Utils.getAppointmentTransID(12, appo.clinicID, appo.appointmentNo), "12", authenticatedUser.emailAddress, paymentMethod, browser.openPaymentBrowser(amount, "LiveCare Payment", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), "12", authenticatedUser.emailAddress, paymentMethod,
authenticatedUser.patientType, authenticatedUser.firstName, authenticatedUser.patientID, authenticatedUser, browser, false, "4", selectedClinicID.toString()); authenticatedUser.patientType, authenticatedUser.firstName, authenticatedUser.patientID, authenticatedUser, browser, false, "4", selectedClinicID.toString());
} }
@ -368,7 +368,6 @@ class _clinic_listState extends State<ClinicList> {
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
setState(() { setState(() {
liveCareScheduleClinicsListResponse = LiveCareScheduleClinicsListResponse.fromJson(res); liveCareScheduleClinicsListResponse = LiveCareScheduleClinicsListResponse.fromJson(res);
print(liveCareScheduleClinicsListResponse.clinicsHaveScheduleList.length);
selectedClinicID = liveCareScheduleClinicsListResponse.clinicsHaveScheduleList[0].serviceID; selectedClinicID = liveCareScheduleClinicsListResponse.clinicsHaveScheduleList[0].serviceID;
selectedClinicName = liveCareScheduleClinicsListResponse.clinicsHaveScheduleList[0].clinicDesc; selectedClinicName = liveCareScheduleClinicsListResponse.clinicsHaveScheduleList[0].clinicDesc;
isDataLoaded = true; isDataLoaded = true;
@ -432,12 +431,6 @@ class _clinic_listState extends State<ClinicList> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
// Container(
// margin: EdgeInsets.all(15.0),
// child: Text("Online Clinics: ",
// style: TextStyle(
// fontSize: 20.0, fontWeight: FontWeight.bold)),
// ),
ListView.builder( ListView.builder(
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
shrinkWrap: true, shrinkWrap: true,
@ -505,7 +498,7 @@ class _clinic_listState extends State<ClinicList> {
children: <Widget>[ children: <Widget>[
Container( Container(
margin: EdgeInsets.all(15.0), margin: EdgeInsets.all(15.0),
child: Text("Online Clinics: ", style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold)), child: Text(TranslationBase.of(context).onlineClinics, style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold)),
), ),
ListView.builder( ListView.builder(
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
@ -529,7 +522,7 @@ class _clinic_listState extends State<ClinicList> {
), ),
Container( Container(
margin: EdgeInsets.all(15.0), margin: EdgeInsets.all(15.0),
child: Text("Offline Clinics: ", style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold)), child: Text(TranslationBase.of(context).offlineClinics, style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold)),
), ),
ListView.builder( ListView.builder(
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
@ -581,7 +574,7 @@ class _clinic_listState extends State<ClinicList> {
disabledTextColor: Colors.white, disabledTextColor: Colors.white,
disabledColor: new Color(0xFFbcc2c4), disabledColor: new Color(0xFFbcc2c4),
onPressed: startLiveCare, onPressed: startLiveCare,
child: Text("Start", style: TextStyle(fontSize: 18.0)), child: Text(TranslationBase.of(context).start, style: TextStyle(fontSize: 18.0)),
), ),
), ),
), ),

@ -159,9 +159,9 @@ class _ConfirmLogin extends State<ConfirmLogin> {
), ),
Text( Text(
user.editedOn != null user.editedOn != null
? DateUtil.formatDateToDate(DateUtil.convertStringToDate(user.editedOn)) ? DateUtil.formatDateToDate(DateUtil.convertStringToDate(user.editedOn), projectViewModel.isArabic)
: user.createdOn != null : user.createdOn != null
? DateUtil.formatDateToDate(DateUtil.convertStringToDate(user.createdOn)) ? DateUtil.formatDateToDate(DateUtil.convertStringToDate(user.createdOn), projectViewModel.isArabic)
: '--', : '--',
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48), style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48),
), ),

@ -1,4 +1,4 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/service/medical/ask_doctor_services.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/ask_doctor_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/ask_doctor_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DoctorView.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DoctorView.dart';
@ -6,14 +6,16 @@ import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/medical/ask_doctor/request_type.dart'; import 'package:diplomaticquarterapp/pages/medical/ask_doctor/request_type.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:rating_bar/rating_bar.dart';
class AskDoctorPage extends StatelessWidget { class AskDoctorPage extends StatelessWidget {
AskDoctorService service = new AskDoctorService();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<AskDoctorViewModel>( return BaseView<AskDoctorViewModel>(
@ -65,9 +67,10 @@ class AskDoctorPage extends StatelessWidget {
doctor: doctorList, doctor: doctorList,
isLiveCareAppointment: false, isLiveCareAppointment: false,
onTap: () { onTap: () {
model.getCallInfoHoursResult(doctorId: _doctor.doctorID, projectId: _doctor.projectID).then((value) { GifLoaderDialogUtils.showMyDialog(context);
if (model.state != ViewState.ErrorLocal && model.state != ViewState.Error) { service.getCallInfoHoursResult(doctorId: _doctor.doctorID, projectId: _doctor.projectID).then((res) {
// Navigator.pop(context); GifLoaderDialogUtils.hideDialog(context);
if (res['ErrorEndUserMessage'] == null) {
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
@ -75,8 +78,12 @@ class AskDoctorPage extends StatelessWidget {
), ),
); );
} else { } else {
AppToast.showErrorToast(message: model.error); AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
} }
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
if (err != null) AppToast.showErrorToast(message: err);
print(err);
}); });
}, },
); );

@ -3,9 +3,8 @@ import 'package:diplomaticquarterapp/core/viewModels/medical/ask_doctor_view_mod
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/medical/balance/new_text_Field.dart'; import 'package:diplomaticquarterapp/pages/medical/balance/new_text_Field.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.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/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -32,6 +31,8 @@ class _RequestTypePageState extends State<RequestTypePage> {
isShowAppBar: true, isShowAppBar: true,
appBarTitle: TranslationBase.of(context).requestType, appBarTitle: TranslationBase.of(context).requestType,
baseViewModel: model, baseViewModel: model,
showNewAppBar: true,
showNewAppBarTitle: true,
body: SingleChildScrollView( body: SingleChildScrollView(
child: Container( child: Container(
margin: EdgeInsets.all(10), margin: EdgeInsets.all(10),
@ -99,22 +100,24 @@ class _RequestTypePageState extends State<RequestTypePage> {
), ),
bottomSheet: Container( bottomSheet: Container(
width: double.maxFinite, width: double.maxFinite,
// height: MediaQuery.of(context).size.height * 0.1,
height: 80.0, height: 80.0,
child: Padding( child: Padding(
padding: const EdgeInsets.all(12.0), padding: const EdgeInsets.all(12.0),
child: SecondaryButton( child: Container(
label: TranslationBase.of(context).submit, width: MediaQuery.of(context).size.width * 0.8,
loading: model.state == ViewState.BusyLocal, child: DefaultButton(
textColor: Colors.white, TranslationBase.of(context).submit,
onTap: () { () => {
model.sendRequestLOV(doctorList: widget.doctorList, requestType: parameterCode.toString(), remark: question).then((value) { model.sendRequestLOV(doctorList: widget.doctorList, requestType: parameterCode.toString(), remark: question).then((value) {
if (model.state != ViewState.ErrorLocal || model.state != ViewState.Error) { if (model.state != ViewState.ErrorLocal || model.state != ViewState.Error) {
Navigator.pop(context); Navigator.pop(context);
} }
}); })
}, },
color: Colors.grey[800], color: Color(0xffD02127),
textColor: Colors.white,
disabledColor: Color(0xffEAEAEA),
),
), ),
), ),
), ),

@ -9,6 +9,7 @@ import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStat
import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart'; import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/medical/balance/dialogs/SelectHospitalDialog.dart'; import 'package:diplomaticquarterapp/pages/medical/balance/dialogs/SelectHospitalDialog.dart';
import 'package:diplomaticquarterapp/theme/colors.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';
@ -57,10 +58,8 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
super.initState(); super.initState();
getAuthUser(); getAuthUser();
imagesInfo.add(ImagesInfo( imagesInfo.add(ImagesInfo(
imageEn: imageEn: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/advance-payment/en/0.png',
'https://hmgwebservices.com/Images/MobileApp/images-info-home/advance-payment/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/advance-payment/ar/0.png'));
imageAr:
'https://hmgwebservices.com/Images/MobileApp/images-info-home/advance-payment/ar/0.png'));
} }
@override @override
@ -72,7 +71,9 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
imagesInfo: imagesInfo, imagesInfo: imagesInfo,
appBarTitle: TranslationBase.of(context).advancePayment, appBarTitle: TranslationBase.of(context).advancePayment,
description: TranslationBase.of(context).infoAdvancePayment, description: TranslationBase.of(context).infoAdvancePayment,
isBottomBar: model.isLogin ? true : false, showNewAppBarTitle: true,
showNewAppBar: true,
backgroundColor: CustomColors.appBackgroudGreyColor,
body: SingleChildScrollView( body: SingleChildScrollView(
physics: ScrollPhysics(), physics: ScrollPhysics(),
child: Container( child: Container(
@ -80,9 +81,14 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Texts( Text(
TranslationBase.of(context).advancePaymentLabel, TranslationBase.of(context).advancePaymentLabel,
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
letterSpacing: -0.46,
),
), ),
SizedBox( SizedBox(
height: 12, height: 12,
@ -90,16 +96,21 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
InkWell( InkWell(
onTap: () => confirmSelectBeneficiaryDialog(model), onTap: () => confirmSelectBeneficiaryDialog(model),
child: Container( child: Container(
padding: EdgeInsets.all(12), padding: EdgeInsets.all(8),
width: double.infinity, width: double.infinity,
height: 65, height: 65,
decoration: BoxDecoration( decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Texts(getBeneficiaryType()), Text(
getBeneficiaryType(),
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
letterSpacing: -0.46,
),
),
Icon(Icons.arrow_drop_down) Icon(Icons.arrow_drop_down)
], ],
), ),
@ -115,23 +126,26 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
model.getFamilyFiles().then((value) { model.getFamilyFiles().then((value) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
confirmSelectFamilyDialog(model confirmSelectFamilyDialog(model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList);
.getAllSharedRecordsByStatusResponse
.getAllSharedRecordsByStatusList);
}); });
}, },
child: Container( child: Container(
padding: EdgeInsets.all(12), padding: EdgeInsets.all(12),
width: double.infinity, width: double.infinity,
height: 65, height: 65,
decoration: BoxDecoration( decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Texts(getFamilyMembersName()), Text(
Icon(Icons.arrow_drop_down) getFamilyMembersName(),
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
letterSpacing: -0.46,
),
),
Icon(Icons.arrow_drop_down),
], ],
), ),
), ),
@ -152,29 +166,30 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
onTap: () { onTap: () {
if (_fileTextController.text.isNotEmpty) { if (_fileTextController.text.isNotEmpty) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
model model.getPatientInfoByPatientID(id: _fileTextController.text).then((value) {
.getPatientInfoByPatientID(
id: _fileTextController.text)
.then((value) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
confirmSelectPatientDialog(model.patientInfoList); confirmSelectPatientDialog(model.patientInfoList);
}); });
} else } else
AppToast.showErrorToast( AppToast.showErrorToast(message: 'Please Enter The File Number');
message: 'Please Enter The File Number');
}, },
child: Container( child: Container(
padding: EdgeInsets.all(12), padding: EdgeInsets.all(12),
width: double.infinity, width: double.infinity,
height: 65, height: 65,
decoration: BoxDecoration( decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Texts(getPatientName()), Text(
Icon(Icons.arrow_drop_down) getPatientName(),
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
letterSpacing: -0.46,
),
),
Icon(Icons.arrow_drop_down),
], ],
), ),
), ),
@ -188,14 +203,19 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
padding: EdgeInsets.all(12), padding: EdgeInsets.all(12),
width: double.infinity, width: double.infinity,
height: 65, height: 65,
decoration: BoxDecoration( decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Texts(getHospitalName()), Text(
Icon(Icons.arrow_drop_down) getHospitalName(),
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
letterSpacing: -0.46,
),
),
Icon(Icons.arrow_drop_down),
], ],
), ),
), ),
@ -205,7 +225,7 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
), ),
NewTextFields( NewTextFields(
hintText: TranslationBase.of(context).amount, hintText: TranslationBase.of(context).amount,
keyboardType: TextInputType.number, keyboardType: TextInputType.numberWithOptions(signed: false, decimal: true),
onChanged: (value) { onChanged: (value) {
setState(() { setState(() {
amount = value; amount = value;
@ -238,15 +258,15 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
), ),
), ),
bottomSheet: Container( bottomSheet: Container(
height: 90, height: 70,
width: double.infinity, width: double.infinity,
padding: EdgeInsets.all(18), padding: EdgeInsets.all(12),
color: Colors.white,
child: SecondaryButton( child: SecondaryButton(
textColor: Colors.white, textColor: Colors.white,
label: TranslationBase.of(context).submit, label: TranslationBase.of(context).submit,
disabled: amount.isEmpty || color: CustomColors.accentColor,
_fileTextController.text.isEmpty || disabled: amount.isEmpty || _fileTextController.text.isEmpty || _selectedHospital == null,
_selectedHospital == null,
onTap: () { onTap: () {
var mobileNum; var mobileNum;
var patientName; var patientName;
@ -274,15 +294,11 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
advanceModel.mobileNumber = mobileNum; advanceModel.mobileNumber = mobileNum;
advanceModel.patientName = patientName; advanceModel.patientName = patientName;
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
model model.getPatientInfoByPatientIDAndMobileNumber(advanceModel).then((value) {
.getPatientInfoByPatientIDAndMobileNumber(advanceModel)
.then((value) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (model.state != ViewState.Error && if (model.state != ViewState.Error && model.state != ViewState.ErrorLocal) {
model.state != ViewState.ErrorLocal) {
Utils.hideKeyboard(context); Utils.hideKeyboard(context);
Navigator.push(context, FadePage(page: PaymentMethod())) Navigator.push(context, FadePage(page: PaymentMethod())).then(
.then(
(value) { (value) {
Navigator.push( Navigator.push(
context, context,
@ -290,8 +306,7 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
page: ConfirmPaymentPage( page: ConfirmPaymentPage(
advanceModel: advanceModel, advanceModel: advanceModel,
selectedPaymentMethod: value, selectedPaymentMethod: value,
patientInfoAndMobileNumber: patientInfoAndMobileNumber: model.patientInfoAndMobileNumber,
model.patientInfoAndMobileNumber,
authenticatedUser: authUser, authenticatedUser: authUser,
), ),
), ),
@ -315,8 +330,7 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
setState(() { setState(() {
if (value == BeneficiaryType.MyAccount) { if (value == BeneficiaryType.MyAccount) {
_fileTextController.text = model.user.patientID.toString(); _fileTextController.text = model.user.patientID.toString();
advanceModel.depositorName = advanceModel.depositorName = model.user.firstName + " " + model.user.lastName;
model.user.firstName + " " + model.user.lastName;
} else } else
_fileTextController.text = ""; _fileTextController.text = "";
@ -358,8 +372,7 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
); );
} }
void confirmSelectFamilyDialog( void confirmSelectFamilyDialog(List<GetAllSharedRecordsByStatusList> getAllSharedRecordsByStatusList) {
List<GetAllSharedRecordsByStatusList> getAllSharedRecordsByStatusList) {
if (getAllSharedRecordsByStatusList.isNotEmpty) if (getAllSharedRecordsByStatusList.isNotEmpty)
showDialog( showDialog(
context: context, context: context,
@ -369,8 +382,7 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
onValueSelected: (value) { onValueSelected: (value) {
setState(() { setState(() {
selectedPatientFamily = value; selectedPatientFamily = value;
_fileTextController.text = _fileTextController.text = selectedPatientFamily.responseID.toString();
selectedPatientFamily.responseID.toString();
advanceModel.depositorName = value.patientName; advanceModel.depositorName = value.patientName;
}); });
}, },
@ -410,8 +422,7 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
getAuthUser() async { getAuthUser() async {
if (await this.sharedPref.getObject(USER_PROFILE) != null) { if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson( var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
await this.sharedPref.getObject(USER_PROFILE));
setState(() { setState(() {
authUser = data; authUser = data;
}); });

@ -8,6 +8,7 @@ import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.da
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/routes.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/theme/colors.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';
@ -19,6 +20,7 @@ import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'dialogs/ConfirmSMSDialog.dart'; import 'dialogs/ConfirmSMSDialog.dart';
import 'new_text_Field.dart'; import 'new_text_Field.dart';
@ -32,11 +34,7 @@ class ConfirmPaymentPage extends StatelessWidget {
AppSharedPreferences sharedPref = AppSharedPreferences(); AppSharedPreferences sharedPref = AppSharedPreferences();
String transID = ""; String transID = "";
ConfirmPaymentPage( ConfirmPaymentPage({this.advanceModel, this.patientInfoAndMobileNumber, this.selectedPaymentMethod, this.authenticatedUser});
{this.advanceModel,
this.patientInfoAndMobileNumber,
this.selectedPaymentMethod,
this.authenticatedUser});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -51,11 +49,9 @@ class ConfirmPaymentPage extends StatelessWidget {
print("dialog dismissed"); print("dialog dismissed");
print(value); print(value);
if (value != null && value) { if (value != null && value) {
AppoitmentAllHistoryResultList appo = AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList();
new AppoitmentAllHistoryResultList();
appo.projectID = patientInfoAndMobileNumber.projectID; appo.projectID = patientInfoAndMobileNumber.projectID;
openPayment(selectedPaymentMethod, authenticatedUser, openPayment(selectedPaymentMethod, authenticatedUser, double.parse(advanceModel.amount), null);
double.parse(advanceModel.amount), null);
} }
}); });
} }
@ -64,6 +60,9 @@ class ConfirmPaymentPage extends StatelessWidget {
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
appBarTitle: TranslationBase.of(context).advancePayment, appBarTitle: TranslationBase.of(context).advancePayment,
showNewAppBarTitle: true,
showNewAppBar: true,
backgroundColor: CustomColors.appBackgroudGreyColor,
body: SingleChildScrollView( body: SingleChildScrollView(
physics: ScrollPhysics(), physics: ScrollPhysics(),
child: Container( child: Container(
@ -71,11 +70,14 @@ class ConfirmPaymentPage extends StatelessWidget {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Texts( Text(
TranslationBase.of(context).confirmThePayment, TranslationBase.of(context).confirmThePayment,
textAlign: TextAlign.center, textAlign: TextAlign.center,
fontWeight: FontWeight.w500, style: TextStyle(
fontSize: 24, fontSize: 18,
fontWeight: FontWeight.w600,
letterSpacing: -0.48,
),
), ),
SizedBox( SizedBox(
height: 12, height: 12,
@ -87,12 +89,15 @@ class ConfirmPaymentPage extends StatelessWidget {
height: 100.0, height: 100.0,
padding: EdgeInsets.all(7.0), padding: EdgeInsets.all(7.0),
width: MediaQuery.of(context).size.width * 0.45, width: MediaQuery.of(context).size.width * 0.45,
child: Image.asset(getImagePath(selectedPaymentMethod)), child: selectedPaymentMethod == "ApplePay" ? SvgPicture.asset(getImagePath(selectedPaymentMethod)) : Image.asset(getImagePath(selectedPaymentMethod)),
), ),
Texts( Text(
'${advanceModel.amount} SAR', '${advanceModel.amount} SAR',
fontSize: 26, style: TextStyle(
bold: true, fontSize: 20,
fontWeight: FontWeight.w900,
letterSpacing: -0.48,
),
) )
], ],
), ),
@ -136,11 +141,7 @@ class ConfirmPaymentPage extends StatelessWidget {
), ),
NewTextFields( NewTextFields(
hintText: TranslationBase.of(context).depositorName, hintText: TranslationBase.of(context).depositorName,
initialValue: model.user.firstName + initialValue: model.user.firstName + " " + model.user.middleName + " " + model.user.lastName,
" " +
model.user.middleName +
" " +
model.user.lastName,
isEnabled: false, isEnabled: false,
), ),
SizedBox( SizedBox(
@ -156,26 +157,24 @@ class ConfirmPaymentPage extends StatelessWidget {
), ),
), ),
bottomSheet: Container( bottomSheet: Container(
height: MediaQuery.of(context).size.height * 0.13, color: Colors.white,
width: double.infinity, child: Container(
padding: EdgeInsets.all(12), height: MediaQuery.of(context).size.width * 0.18,
child: SecondaryButton( width: double.infinity,
textColor: Colors.white, padding: EdgeInsets.all(12),
color: Theme.of(context).primaryColor, child: SecondaryButton(
label: TranslationBase.of(context).confirm.toUpperCase(), textColor: Colors.white,
disabled: model.state == ViewState.Busy, color: CustomColors.accentColor,
onTap: () { label: TranslationBase.of(context).confirm.toUpperCase(),
GifLoaderDialogUtils.showMyDialog(context); disabled: model.state == ViewState.Busy,
model onTap: () {
.sendActivationCodeForAdvancePayment( GifLoaderDialogUtils.showMyDialog(context);
patientID: int.parse(advanceModel.fileNumber), model.sendActivationCodeForAdvancePayment(patientID: int.parse(advanceModel.fileNumber), projectID: advanceModel.hospitalsModel.iD).then((value) {
projectID: advanceModel.hospitalsModel.iD) GifLoaderDialogUtils.hideDialog(context);
.then((value) { if (model.state != ViewState.ErrorLocal && model.state != ViewState.Error) showSMSDialog();
GifLoaderDialogUtils.hideDialog(context); });
if (model.state != ViewState.ErrorLocal && },
model.state != ViewState.Error) showSMSDialog(); ),
});
},
), ),
), ),
), ),
@ -199,36 +198,21 @@ class ConfirmPaymentPage extends StatelessWidget {
case "Installment": case "Installment":
return 'assets/images/new-design/installment.png'; return 'assets/images/new-design/installment.png';
break; break;
case "ApplePay":
return 'assets/images/new-design/applepay.svg';
break;
} }
return 'assets/images/new-design/mada.png'; return 'assets/images/new-design/mada.png';
} }
openPayment(String paymentMethod, AuthenticatedUser authenticatedUser, openPayment(String paymentMethod, AuthenticatedUser authenticatedUser, double amount, AppoitmentAllHistoryResultList appo) {
double amount, AppoitmentAllHistoryResultList appo) { browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart);
browser = new MyInAppBrowser(
onExitCallback: onBrowserExit,
appo: appo,
onLoadStartCallback: onBrowserLoadStart);
transID = Utils.getAdvancePaymentTransID( transID = Utils.getAdvancePaymentTransID(advanceModel.hospitalsModel.iD, int.parse(advanceModel.fileNumber));
advanceModel.hospitalsModel.iD, int.parse(advanceModel.fileNumber));
browser.openPaymentBrowser( browser.openPaymentBrowser(amount, "Advance Payment", transID, advanceModel.hospitalsModel.iD.toString(), advanceModel.email, paymentMethod, patientInfoAndMobileNumber.patientType,
amount, advanceModel.patientName, advanceModel.fileNumber, authenticatedUser, browser, false, "3", null);
"Advance Payment",
transID,
advanceModel.hospitalsModel.iD.toString(),
advanceModel.email,
paymentMethod,
patientInfoAndMobileNumber.patientType,
advanceModel.patientName,
advanceModel.fileNumber,
authenticatedUser,
browser,
false,
null,
null);
} }
onBrowserLoadStart(String url) { onBrowserLoadStart(String url) {
@ -280,23 +264,11 @@ class ConfirmPaymentPage extends StatelessWidget {
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.HIS_createAdvancePayment( service.HIS_createAdvancePayment(appo, advanceModel.hospitalsModel.iD.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], patientInfoAndMobileNumber.patientType,
appo, advanceModel.patientName, advanceModel.fileNumber, AppGlobal.context)
advanceModel.hospitalsModel.iD.toString(),
res['Amount'],
res['Fort_id'],
res['PaymentMethod'],
patientInfoAndMobileNumber.patientType,
advanceModel.patientName,
advanceModel.fileNumber,
AppGlobal.context)
.then((res) { .then((res) {
print(res['OnlineCheckInAppointments'][0]['AdvanceNumber']); print(res['OnlineCheckInAppointments'][0]['AdvanceNumber']);
addAdvancedNumberRequest( addAdvancedNumberRequest(res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), paymentReference, 0, appo);
res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(),
paymentReference,
0,
appo);
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(AppGlobal.context); GifLoaderDialogUtils.hideDialog(AppGlobal.context);
AppToast.showErrorToast(message: err); AppToast.showErrorToast(message: err);
@ -304,13 +276,9 @@ class ConfirmPaymentPage extends StatelessWidget {
}); });
} }
addAdvancedNumberRequest(String advanceNumber, String paymentReference, addAdvancedNumberRequest(String advanceNumber, String paymentReference, dynamic appointmentID, AppoitmentAllHistoryResultList appo) {
dynamic appointmentID, AppoitmentAllHistoryResultList appo) {
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service service.addAdvancedNumberRequest(advanceNumber, paymentReference, appointmentID, AppGlobal.context).then((res) {
.addAdvancedNumberRequest(
advanceNumber, paymentReference, appointmentID, AppGlobal.context)
.then((res) {
print(res); print(res);
GifLoaderDialogUtils.hideDialog(AppGlobal.context); GifLoaderDialogUtils.hideDialog(AppGlobal.context);
navigateToHome(AppGlobal.context); navigateToHome(AppGlobal.context);

@ -10,12 +10,10 @@ class SelectBeneficiaryDialog extends StatefulWidget {
final BeneficiaryType beneficiaryType; final BeneficiaryType beneficiaryType;
final Function(BeneficiaryType) onValueSelected; final Function(BeneficiaryType) onValueSelected;
SelectBeneficiaryDialog( SelectBeneficiaryDialog({Key key, this.beneficiaryType, this.onValueSelected});
{Key key, this.beneficiaryType, this.onValueSelected});
@override @override
_SelectBeneficiaryDialogState createState() => _SelectBeneficiaryDialogState createState() => _SelectBeneficiaryDialogState(this.beneficiaryType);
_SelectBeneficiaryDialogState(this.beneficiaryType);
} }
class _SelectBeneficiaryDialogState extends State<SelectBeneficiaryDialog> { class _SelectBeneficiaryDialogState extends State<SelectBeneficiaryDialog> {
@ -42,7 +40,14 @@ class _SelectBeneficiaryDialogState extends State<SelectBeneficiaryDialog> {
}); });
}, },
child: ListTile( child: ListTile(
title: Text(TranslationBase.of(context).myAccount), title: Text(
TranslationBase.of(context).myAccount,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
letterSpacing: -0.46,
),
),
leading: Radio( leading: Radio(
value: BeneficiaryType.MyAccount, value: BeneficiaryType.MyAccount,
groupValue: beneficiaryType, groupValue: beneficiaryType,
@ -72,7 +77,14 @@ class _SelectBeneficiaryDialogState extends State<SelectBeneficiaryDialog> {
}); });
}, },
child: ListTile( child: ListTile(
title: Text(TranslationBase.of(context).myFamilyFiles), title: Text(
TranslationBase.of(context).myFamilyFiles,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
letterSpacing: -0.46,
),
),
leading: Radio( leading: Radio(
value: BeneficiaryType.MyFamilyFiles, value: BeneficiaryType.MyFamilyFiles,
groupValue: beneficiaryType, groupValue: beneficiaryType,
@ -102,7 +114,14 @@ class _SelectBeneficiaryDialogState extends State<SelectBeneficiaryDialog> {
}); });
}, },
child: ListTile( child: ListTile(
title: Text(TranslationBase.of(context).otherAccount), title: Text(
TranslationBase.of(context).otherAccount,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
letterSpacing: -0.46,
),
),
leading: Radio( leading: Radio(
value: BeneficiaryType.OtherAccount, value: BeneficiaryType.OtherAccount,
groupValue: beneficiaryType, groupValue: beneficiaryType,
@ -134,9 +153,14 @@ class _SelectBeneficiaryDialogState extends State<SelectBeneficiaryDialog> {
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Container( child: Container(
child: Center( child: Center(
child: Texts( child: Text(
TranslationBase.of(context).cancel.toUpperCase(), TranslationBase.of(context).cancel.toUpperCase(),
color: Colors.red, style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
letterSpacing: -0.46,
color: Colors.red,
),
), ),
), ),
), ),
@ -158,9 +182,13 @@ class _SelectBeneficiaryDialogState extends State<SelectBeneficiaryDialog> {
child: Padding( child: Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Center( child: Center(
child: Texts( child: Text(
TranslationBase.of(context).ok, TranslationBase.of(context).ok.toUpperCase(),
fontWeight: FontWeight.w400, style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
letterSpacing: -0.46,
),
), ),
), ),
), ),

@ -11,8 +11,7 @@ class SelectHospitalDialog extends StatefulWidget {
final Function(HospitalsModel) onValueSelected; final Function(HospitalsModel) onValueSelected;
HospitalsModel selectedHospital; HospitalsModel selectedHospital;
SelectHospitalDialog( SelectHospitalDialog({Key key, this.hospitals, this.onValueSelected, this.selectedHospital});
{Key key, this.hospitals, this.onValueSelected, this.selectedHospital});
@override @override
_SelectHospitalDialogState createState() => _SelectHospitalDialogState(); _SelectHospitalDialogState createState() => _SelectHospitalDialogState();
@ -51,8 +50,14 @@ class _SelectHospitalDialogState extends State<SelectHospitalDialog> {
}); });
}, },
child: ListTile( child: ListTile(
title: Text(widget.hospitals[index].name + title: Text(
' ${widget.hospitals[index].distanceInKilometers} KM'), widget.hospitals[index].name + ' ${widget.hospitals[index].distanceInKilometers} KM',
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
letterSpacing: -0.46,
),
),
leading: Radio( leading: Radio(
value: widget.hospitals[index], value: widget.hospitals[index],
groupValue: widget.selectedHospital, groupValue: widget.selectedHospital,
@ -90,9 +95,14 @@ class _SelectHospitalDialogState extends State<SelectHospitalDialog> {
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Container( child: Container(
child: Center( child: Center(
child: Texts( child: Text(
TranslationBase.of(context).cancel.toUpperCase(), TranslationBase.of(context).cancel.toUpperCase(),
color: Colors.red, style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
letterSpacing: -0.46,
color: Colors.red
),
), ),
), ),
), ),
@ -114,10 +124,15 @@ class _SelectHospitalDialogState extends State<SelectHospitalDialog> {
child: Padding( child: Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Center( child: Center(
child: Texts( child: Text(
TranslationBase.of(context).ok, TranslationBase.of(context).ok,
fontWeight: FontWeight.w400, style: TextStyle(
)), fontSize: 14,
fontWeight: FontWeight.w600,
letterSpacing: -0.46,
),
),
),
), ),
), ),
), ),

@ -7,22 +7,21 @@ import 'package:flutter/material.dart';
import '../../../../Constants.dart'; import '../../../../Constants.dart';
class SelectPatientFamilyDialog extends StatefulWidget { class SelectPatientFamilyDialog extends StatefulWidget {
final List<GetAllSharedRecordsByStatusList> getAllSharedRecordsByStatusList; final List<GetAllSharedRecordsByStatusList> getAllSharedRecordsByStatusList;
final Function(GetAllSharedRecordsByStatusList) onValueSelected; final Function(GetAllSharedRecordsByStatusList) onValueSelected;
GetAllSharedRecordsByStatusList selectedPatientFamily; GetAllSharedRecordsByStatusList selectedPatientFamily;
SelectPatientFamilyDialog({Key key, this.getAllSharedRecordsByStatusList, this.onValueSelected,this.selectedPatientFamily}); SelectPatientFamilyDialog({Key key, this.getAllSharedRecordsByStatusList, this.onValueSelected, this.selectedPatientFamily});
@override @override
_SelectPatientFamilyDialogState createState() => _SelectPatientFamilyDialogState(); _SelectPatientFamilyDialogState createState() => _SelectPatientFamilyDialogState();
} }
class _SelectPatientFamilyDialogState extends State<SelectPatientFamilyDialog> { class _SelectPatientFamilyDialogState extends State<SelectPatientFamilyDialog> {
@override @override
void initState() { void initState() {
super.initState(); super.initState();
widget.selectedPatientFamily = widget.selectedPatientFamily?? widget.getAllSharedRecordsByStatusList[0]; widget.selectedPatientFamily = widget.selectedPatientFamily ?? widget.getAllSharedRecordsByStatusList[0];
} }
@override @override
@ -34,7 +33,7 @@ class _SelectPatientFamilyDialogState extends State<SelectPatientFamilyDialog> {
Divider(), Divider(),
...List.generate( ...List.generate(
widget.getAllSharedRecordsByStatusList.length, widget.getAllSharedRecordsByStatusList.length,
(index) => Column( (index) => Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
SizedBox( SizedBox(
@ -51,7 +50,14 @@ class _SelectPatientFamilyDialogState extends State<SelectPatientFamilyDialog> {
}); });
}, },
child: ListTile( child: ListTile(
title: Text(widget.getAllSharedRecordsByStatusList[index].patientName), title: Text(
widget.getAllSharedRecordsByStatusList[index].patientName,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
letterSpacing: -0.46,
),
),
leading: Radio( leading: Radio(
value: widget.getAllSharedRecordsByStatusList[index], value: widget.getAllSharedRecordsByStatusList[index],
groupValue: widget.selectedPatientFamily, groupValue: widget.selectedPatientFamily,
@ -89,9 +95,14 @@ class _SelectPatientFamilyDialogState extends State<SelectPatientFamilyDialog> {
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Container( child: Container(
child: Center( child: Center(
child: Texts( child: Text(
TranslationBase.of(context).cancel.toUpperCase(), TranslationBase.of(context).cancel.toUpperCase(),
color: Colors.red, style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
letterSpacing: -0.46,
color: Colors.red,
),
), ),
), ),
), ),
@ -113,10 +124,15 @@ class _SelectPatientFamilyDialogState extends State<SelectPatientFamilyDialog> {
child: Padding( child: Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Center( child: Center(
child: Texts( child: Text(
TranslationBase.of(context).ok, TranslationBase.of(context).ok,
fontWeight: FontWeight.w400, style: TextStyle(
)), fontSize: 14,
fontWeight: FontWeight.w600,
letterSpacing: -0.46,
),
),
),
), ),
), ),
), ),

@ -9,22 +9,22 @@ import 'package:flutter/material.dart';
import '../../../../Constants.dart'; import '../../../../Constants.dart';
class SelectPatientInfoDialog extends StatefulWidget { class SelectPatientInfoDialog extends StatefulWidget {
final List<PatientInfo> patientInfoList ; final List<PatientInfo> patientInfoList;
final Function(PatientInfo) onValueSelected; final Function(PatientInfo) onValueSelected;
PatientInfo selectedPatientInfo; PatientInfo selectedPatientInfo;
SelectPatientInfoDialog({Key key, this.patientInfoList, this.onValueSelected,this.selectedPatientInfo}); SelectPatientInfoDialog({Key key, this.patientInfoList, this.onValueSelected, this.selectedPatientInfo});
@override @override
_SelectPatientInfoDialogState createState() => _SelectPatientInfoDialogState(); _SelectPatientInfoDialogState createState() => _SelectPatientInfoDialogState();
} }
class _SelectPatientInfoDialogState extends State<SelectPatientInfoDialog> { class _SelectPatientInfoDialogState extends State<SelectPatientInfoDialog> {
@override @override
void initState() { void initState() {
super.initState(); super.initState();
widget.selectedPatientInfo = widget.selectedPatientInfo?? widget.patientInfoList[0]; widget.selectedPatientInfo = widget.selectedPatientInfo ?? widget.patientInfoList[0];
} }
@override @override
@ -36,7 +36,7 @@ class _SelectPatientInfoDialogState extends State<SelectPatientInfoDialog> {
Divider(), Divider(),
...List.generate( ...List.generate(
widget.patientInfoList.length, widget.patientInfoList.length,
(index) => Column( (index) => Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
SizedBox( SizedBox(
@ -53,7 +53,14 @@ class _SelectPatientInfoDialogState extends State<SelectPatientInfoDialog> {
}); });
}, },
child: ListTile( child: ListTile(
title: Text(widget.patientInfoList[index].fullName), title: Text(
widget.patientInfoList[index].fullName,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
letterSpacing: -0.46,
),
),
leading: Radio( leading: Radio(
value: widget.patientInfoList[index], value: widget.patientInfoList[index],
groupValue: widget.selectedPatientInfo, groupValue: widget.selectedPatientInfo,
@ -91,9 +98,14 @@ class _SelectPatientInfoDialogState extends State<SelectPatientInfoDialog> {
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Container( child: Container(
child: Center( child: Center(
child: Texts( child: Text(
TranslationBase.of(context).cancel.toUpperCase(), TranslationBase.of(context).cancel.toUpperCase(),
color: Colors.red, style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
letterSpacing: -0.46,
color: Colors.red,
),
), ),
), ),
), ),
@ -115,10 +127,15 @@ class _SelectPatientInfoDialogState extends State<SelectPatientInfoDialog> {
child: Padding( child: Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Center( child: Center(
child: Texts( child: Text(
TranslationBase.of(context).ok, TranslationBase.of(context).ok.toUpperCase(),
fontWeight: FontWeight.w400, style: TextStyle(
)), fontSize: 14,
fontWeight: FontWeight.w600,
letterSpacing: -0.46,
),
),
),
), ),
), ),
), ),

@ -1,6 +1,7 @@
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/model/ImagesInfo.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/theme/colors.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';
@ -17,10 +18,7 @@ class MyBalancePage extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
imagesInfo.add(ImagesInfo( imagesInfo.add(ImagesInfo(
imageEn: imageEn: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/my-balance/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/my-balance/ar/0.png'));
'https://hmgwebservices.com/Images/MobileApp/images-info-home/my-balance/en/0.png',
imageAr:
'https://hmgwebservices.com/Images/MobileApp/images-info-home/my-balance/ar/0.png'));
return BaseView<MyBalanceViewModel>( return BaseView<MyBalanceViewModel>(
onModelReady: (model) => model.getPatientAdvanceBalanceAmount(), onModelReady: (model) => model.getPatientAdvanceBalanceAmount(),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
@ -29,16 +27,22 @@ class MyBalancePage extends StatelessWidget {
appBarTitle: TranslationBase.of(context).myBalances, appBarTitle: TranslationBase.of(context).myBalances,
imagesInfo: imagesInfo, imagesInfo: imagesInfo,
description: TranslationBase.of(context).infoMyBalance, description: TranslationBase.of(context).infoMyBalance,
showNewAppBar: true,
showNewAppBarTitle: true,
backgroundColor: CustomColors.appBackgroudGreyColor,
body: SingleChildScrollView( body: SingleChildScrollView(
child: Container( child: Container(
margin: EdgeInsets.all(12), margin: EdgeInsets.all(12),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Texts( Text(
TranslationBase.of(context).balanceAmount, TranslationBase.of(context).balanceAmount,
color: Colors.black, style: TextStyle(
bold: true, fontSize: 16,
fontWeight: FontWeight.w600,
letterSpacing: -0.46,
),
), ),
SizedBox( SizedBox(
height: 15, height: 15,
@ -55,15 +59,22 @@ class MyBalancePage extends StatelessWidget {
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Texts( Text(
'${model.totalAdvanceBalanceAmount ?? 0} ' + '${model.totalAdvanceBalanceAmount ?? 0} ' + TranslationBase.of(context).sar,
TranslationBase.of(context).sar, style: TextStyle(
color: Colors.white, fontSize: 14,
bold: true, fontWeight: FontWeight.w600,
letterSpacing: -0.46,
color: Colors.white,
),
), ),
Texts( Text(
TranslationBase.of(context).totalBalance, TranslationBase.of(context).totalBalance,
color: Colors.white, style: TextStyle(
fontSize: 14,
letterSpacing: -0.46,
color: Colors.white,
),
), ),
], ],
), ),
@ -80,18 +91,26 @@ class MyBalancePage extends StatelessWidget {
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(7), borderRadius: BorderRadius.circular(12),
), ),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Texts( Text(
'${model.patientAdvanceBalanceAmountList[index].patientAdvanceBalanceAmount} ' + '${model.patientAdvanceBalanceAmountList[index].patientAdvanceBalanceAmount} ' + TranslationBase.of(context).sar,
TranslationBase.of(context).sar, style: TextStyle(
bold: true, fontSize: 14,
fontWeight: FontWeight.w600,
letterSpacing: -0.46,
),
),
Text(
model.patientAdvanceBalanceAmountList[index].projectDescription,
style: TextStyle(
fontSize: 14,
letterSpacing: -0.46,
),
), ),
Texts(model.patientAdvanceBalanceAmountList[index]
.projectDescription),
], ],
), ),
), ),
@ -111,6 +130,7 @@ class MyBalancePage extends StatelessWidget {
padding: EdgeInsets.all(12), padding: EdgeInsets.all(12),
child: SecondaryButton( child: SecondaryButton(
textColor: Colors.white, textColor: Colors.white,
color: CustomColors.accentColor,
label: TranslationBase.of(context).createAdvancedPayment, label: TranslationBase.of(context).createAdvancedPayment,
onTap: () { onTap: () {
Navigator.push(context, FadePage(page: AdvancePaymentPage())); Navigator.push(context, FadePage(page: AdvancePaymentPage()));

@ -70,8 +70,8 @@ class NewTextFields extends StatefulWidget {
this.prefixIcon, this.prefixIcon,
this.bare = false, this.bare = false,
this.onTap, this.onTap,
this.fontSize = 16.0, this.fontSize = 14.0,
this.fontWeight = FontWeight.w700, this.fontWeight = FontWeight.w600,
this.autoValidate = false, this.autoValidate = false,
this.hintColor, this.hintColor,
this.isEnabled = true,this.counterText=""}) this.isEnabled = true,this.counterText=""})

@ -1,13 +1,7 @@
import 'package:diplomaticquarterapp/core/model/eye/AppoimentAllHistoryResult.dart'; import 'package:diplomaticquarterapp/core/model/eye/AppoimentAllHistoryResult.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/EyeViewModel.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/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_send_email_dialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_send_email_dialog.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -135,7 +129,7 @@ class ClassesPage extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Expanded(flex: 4, child: Text(title,style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, letterSpacing: -0.4),)), Expanded(flex: 4, child: Text(title,style: TextStyle(fontSize: 11, fontWeight: FontWeight.w600, letterSpacing: -0.4))),
Expanded( Expanded(
flex: 2, flex: 2,
child: Row( child: Row(
@ -143,11 +137,11 @@ class ClassesPage extends StatelessWidget {
children: [ children: [
Text( Text(
val1 == 'null' ? '-' : val1, val1 == 'null' ? '-' : val1,
style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, letterSpacing: -0.4), style: TextStyle(fontSize: 11, fontWeight: FontWeight.w600, letterSpacing: -0.4),
), ),
Text( Text(
val2 != 'null' ? '-' : val2, val2 != 'null' ? '-' : val2,
style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, letterSpacing: -0.4), style: TextStyle(fontSize: 11, fontWeight: FontWeight.w600, letterSpacing: -0.4),
), ),
], ],
), ),

@ -142,7 +142,7 @@ class ContactLensPage extends StatelessWidget {
flex: 4, flex: 4,
child: Text( child: Text(
title, title,
style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, letterSpacing: -0.4), style: TextStyle(fontSize: 11, fontWeight: FontWeight.w600, letterSpacing: -0.4),
)), )),
Expanded( Expanded(
flex: 2, flex: 2,
@ -152,7 +152,7 @@ class ContactLensPage extends StatelessWidget {
children: [ children: [
Text( Text(
val1 == 'null' ? '-' : val1, val1 == 'null' ? '-' : val1,
style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, letterSpacing: -0.4), style: TextStyle(fontSize: 11, fontWeight: FontWeight.w600, letterSpacing: -0.4),
), ),
], ],
), ),

@ -120,7 +120,7 @@ class _EyeHomePageState extends State<EyeHomePage> with SingleTickerProviderStat
TranslationBase.of(context).classes, TranslationBase.of(context).classes,
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 12, // fontSize: 12,
letterSpacing: -0.36, letterSpacing: -0.36,
), ),
), ),
@ -133,7 +133,7 @@ class _EyeHomePageState extends State<EyeHomePage> with SingleTickerProviderStat
TranslationBase.of(context).contactLens, TranslationBase.of(context).contactLens,
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 12, // fontSize: 12,
letterSpacing: -0.36, letterSpacing: -0.36,
), ),
), ),

@ -28,6 +28,8 @@ class _PassportUpdatePageState extends State<PassportUpdatePage> {
appBarTitle: TranslationBase.of(context).passportNumber, appBarTitle: TranslationBase.of(context).passportNumber,
isShowAppBar: true, isShowAppBar: true,
isBottomBar: true, isBottomBar: true,
showNewAppBar: true,
showNewAppBarTitle: true,
body: Container( body: Container(
child: SingleChildScrollView( child: SingleChildScrollView(
child: Column( child: Column(
@ -50,34 +52,34 @@ class _PassportUpdatePageState extends State<PassportUpdatePage> {
onChanged: (value) => {_onPassportTextChanged(value)}, onChanged: (value) => {_onPassportTextChanged(value)},
padding: EdgeInsets.only(top: 20, bottom: 20, left: 10, right: 10), padding: EdgeInsets.only(top: 20, bottom: 20, left: 10, right: 10),
hintText: TranslationBase.of(context).passportNumber, hintText: TranslationBase.of(context).passportNumber,
)) )),
Container(
margin: EdgeInsets.only(top: 30.0, left: 45.0, right: 45.0, bottom: 10.0),
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
minWidth: MediaQuery.of(context).size.width,
height: 45.0,
child: RaisedButton(
color: new Color(0xFFc5272d),
textColor: Colors.white,
disabledTextColor: Colors.white,
disabledColor: Colors.red[300],
onPressed: () {
if (_isButtonDisabled == false)
updatePassportNumber();
else
AppToast.showErrorToast(message: TranslationBase.of(context).validPassportNumber);
},
child: Text(TranslationBase.of(context).submit, style: TextStyle(fontSize: 18.0)),
),
),
),
], ],
), ),
), ),
), ),
bottomSheet: Container(
margin: EdgeInsets.only(top: 10.0, left: 30.0, right: 30.0, bottom: 10.0),
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
minWidth: MediaQuery.of(context).size.width,
height: 45.0,
child: RaisedButton(
color: new Color(0xFFc5272d),
textColor: Colors.white,
disabledTextColor: Colors.white,
disabledColor: Colors.red[300],
onPressed: () {
if (_isButtonDisabled == false)
updatePassportNumber();
else
AppToast.showErrorToast(message: TranslationBase.of(context).validPassportNumber);
},
child: Text(TranslationBase.of(context).submit, style: TextStyle(fontSize: 18.0)),
),
),
),
); );
} }

@ -2,6 +2,7 @@ import 'dart:ui';
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_history_page.dart'; import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_history_page.dart';
import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_page.dart'; import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_page.dart';
@ -10,6 +11,7 @@ import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../../../Constants.dart'; import '../../../Constants.dart';
@ -22,6 +24,8 @@ class _HomePrescriptionsPageState extends State<HomePrescriptionsPage> with Sing
TabController _tabController; TabController _tabController;
List<ImagesInfo> imagesInfo = List(); List<ImagesInfo> imagesInfo = List();
ProjectViewModel projectViewModel;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
@ -40,6 +44,7 @@ class _HomePrescriptionsPageState extends State<HomePrescriptionsPage> with Sing
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
return BaseView<PrescriptionsViewModel>( return BaseView<PrescriptionsViewModel>(
onModelReady: (model) => model.getPrescriptions(), onModelReady: (model) => model.getPrescriptions(),
builder: (_, model, widget) => AppScaffold( builder: (_, model, widget) => AppScaffold(
@ -71,7 +76,7 @@ class _HomePrescriptionsPageState extends State<HomePrescriptionsPage> with Sing
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
letterSpacing: -0.48, letterSpacing: -0.48,
), ),
tabs: [Text(TranslationBase.of(context).prescriptions), Text(TranslationBase.of(context).history)], tabs: [Text(TranslationBase.of(context).prescriptions, style: TextStyle(fontFamily: projectViewModel.isArabic ? 'Cairo' : 'WorkSans')), Text(TranslationBase.of(context).history, style: TextStyle(fontFamily: projectViewModel.isArabic ? 'Cairo' : 'WorkSans'))],
), ),
Expanded( Expanded(
child: TabBarView( child: TabBarView(

@ -86,12 +86,6 @@ class RadiologyDetailsPage extends StatelessWidget {
'${finalRadiology.reportData}', '${finalRadiology.reportData}',
style: TextStyle(fontSize: 12, letterSpacing: -0.48), style: TextStyle(fontSize: 12, letterSpacing: -0.48),
), ),
// Texts(
// '${finalRadiology.reportData}',
// textAlign: TextAlign.start,
// fontSize: 12,
//
// ),
mHeight(16), mHeight(16),
(projectViewModel.havePrivilege(9) || projectViewModel.havePrivilege(8)) (projectViewModel.havePrivilege(9) || projectViewModel.havePrivilege(8))
? (finalRadiology.dIAPACSURL != "" && projectViewModel.havePrivilege(9)) ? (finalRadiology.dIAPACSURL != "" && projectViewModel.havePrivilege(9))

@ -1,5 +1,6 @@
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/reports_monthly_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/reports_monthly_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/medical/reports/user_agreement_page.dart'; import 'package:diplomaticquarterapp/pages/medical/reports/user_agreement_page.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
@ -11,6 +12,7 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/gestures.dart'; import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class MonthlyReportsPage extends StatefulWidget { class MonthlyReportsPage extends StatefulWidget {
@override @override
@ -36,6 +38,7 @@ class _MonthlyReportsPageState extends State<MonthlyReportsPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<ReportsMonthlyViewModel>(builder: (_, model, w) { return BaseView<ReportsMonthlyViewModel>(builder: (_, model, w) {
if (isSummary == null) { if (isSummary == null) {
isSummary = model.receiveHealthSummaryReport; isSummary = model.receiveHealthSummaryReport;
@ -184,7 +187,7 @@ class _MonthlyReportsPageState extends State<MonthlyReportsPage> {
RichText( RichText(
text: TextSpan( text: TextSpan(
text: TranslationBase.of(context).toViewTheTermsAndConditions + " ", text: TranslationBase.of(context).toViewTheTermsAndConditions + " ",
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w500, color: Color(0xff2B353E), letterSpacing: -0.64, height: 23 / 16), style: TextStyle(fontSize: 16, fontWeight: FontWeight.w500, color: Color(0xff2B353E), letterSpacing: -0.64, height: 23 / 16, fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins'),
children: [ children: [
TextSpan( TextSpan(
text: TranslationBase.of(context).clickHere, text: TranslationBase.of(context).clickHere,

@ -3,13 +3,12 @@ import 'dart:ui';
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/reports_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/reports_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/extensions/string_extensions.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/medical/reports/report_list_widget.dart'; import 'package:diplomaticquarterapp/pages/medical/reports/report_list_widget.dart';
import 'package:diplomaticquarterapp/pages/medical/reports/reports_page.dart'; import 'package:diplomaticquarterapp/pages/medical/reports/reports_page.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/extensions/string_extensions.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
@ -81,15 +80,19 @@ class _HomeReportPageState extends State<HomeReportPage> with SingleTickerProvid
tabs: [ tabs: [
Text( Text(
TranslationBase.of(context).requested, TranslationBase.of(context).requested,
style: TextStyle(fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins'),
), ),
Text( Text(
TranslationBase.of(context).ready, TranslationBase.of(context).ready,
style: TextStyle(fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins'),
), ),
Text( Text(
TranslationBase.of(context).completed, TranslationBase.of(context).completed,
style: TextStyle(fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins'),
), ),
Text( Text(
TranslationBase.of(context).cancelled, TranslationBase.of(context).cancelled,
style: TextStyle(fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins'),
), ),
], ],
), ),

@ -1,6 +1,7 @@
import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/model/reports/Reports.dart'; import 'package:diplomaticquarterapp/core/model/reports/Reports.dart';
import 'package:diplomaticquarterapp/core/service/medical/reports_service.dart'; import 'package:diplomaticquarterapp/core/service/medical/reports_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/locator.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';
@ -12,6 +13,7 @@ import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_send_email_dialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_send_email_dialog.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:rating_bar/rating_bar.dart'; import 'package:rating_bar/rating_bar.dart';
class ReportListWidget extends StatelessWidget { class ReportListWidget extends StatelessWidget {
@ -20,8 +22,11 @@ class ReportListWidget extends StatelessWidget {
ReportListWidget({@required this.reportList, this.emailAddress}); ReportListWidget({@required this.reportList, this.emailAddress});
ProjectViewModel projectViewModel;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
return ListView.separated( return ListView.separated(
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
padding: EdgeInsets.only(bottom: 14, top: 14, left: 21, right: 21), padding: EdgeInsets.only(bottom: 14, top: 14, left: 21, right: 21),
@ -69,8 +74,8 @@ class ReportListWidget extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: <Widget>[ children: <Widget>[
if (report.projectName != null) myRichText(TranslationBase.of(context).clinic + ":", report.projectName), if (report.projectName != null) myRichText(TranslationBase.of(context).clinic + ":", report.projectName, projectViewModel.isArabic),
if (report.clinicDescription != null) myRichText(TranslationBase.of(context).hospital + ":", report.clinicDescription), if (report.clinicDescription != null) myRichText(TranslationBase.of(context).hospital + ":", report.clinicDescription, projectViewModel.isArabic),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,

@ -7,7 +7,6 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart'; import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart';
import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/StarRating.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -38,96 +37,15 @@ class MedicalReports extends StatelessWidget {
showNewAppBarTitle: true, showNewAppBarTitle: true,
backgroundColor: Color(0xffF7F7F7), backgroundColor: Color(0xffF7F7F7),
body: ListView.separated( body: ListView.separated(
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
itemCount: model.appointHistoryList.length, itemCount: model.appointHistoryList.length,
padding: EdgeInsets.all(21), padding: EdgeInsets.all(21),
separatorBuilder: (context, index) => SizedBox(height: 14), separatorBuilder: (context, index) => SizedBox(height: 14),
itemBuilder: (context, index) { itemBuilder: (context, index) {
AppointmentHistory _appointmenHistory = model.appointHistoryList[index]; AppointmentHistory _appointmenHistory = model.appointHistoryList[index];
return InkWell(
return InkWell( onTap: () => confirmBox(model.appointHistoryList[index], model),
onTap: () => confirmBox(model.appointHistoryList[index], model), child: Container(
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(10.0),
),
boxShadow: [
BoxShadow(
color: Color(0xff000000).withOpacity(.05),
//spreadRadius: 5,
blurRadius: 27,
offset: Offset(0, -3),
),
],
color: Colors.white),
child: Padding(
padding: const EdgeInsets.only(left: 12, right: 12, top: 12, bottom: 12),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
if ((_appointmenHistory.doctorName ?? _appointmenHistory.doctorNameObj) != null)
Text(
(_appointmenHistory.doctorName ?? _appointmenHistory.doctorNameObj),
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16),
),
Text(
DateUtil.formatDateToDate(_appointmenHistory.appointmentDate),
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12),
),
],
),
if ((_appointmenHistory.doctorName ?? _appointmenHistory.doctorNameObj) != null) SizedBox(height: 6),
Row(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
LargeAvatar(
name: _appointmenHistory.doctorName,
url: _appointmenHistory.doctorImageURL,
width: 48,
height: 48,
),
SizedBox(width: 11),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
if (_appointmenHistory.projectName != null) myRichText(TranslationBase.of(context).clinic + ":", _appointmenHistory.projectName),
if (_appointmenHistory.clinicName != null) myRichText(TranslationBase.of(context).hospital + ":", _appointmenHistory.clinicName),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
RatingBar.readOnly(
initialRating: _appointmenHistory.actualDoctorRate.toDouble(),
size: 16.0,
filledColor: Color(0XFFD02127),
emptyColor: Color(0XFFD02127),
isHalfAllowed: true,
halfFilledIcon: Icons.star_half,
filledIcon: Icons.star,
emptyIcon: Icons.star_border,
),
Icon(Icons.email, color: Color(0xff2B353E))
],
),
],
),
),
],
),
],
),
),
),
);
Container(
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
Radius.circular(10.0), Radius.circular(10.0),
@ -135,74 +53,80 @@ class MedicalReports extends StatelessWidget {
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(
color: Color(0xff000000).withOpacity(.05), color: Color(0xff000000).withOpacity(.05),
//spreadRadius: 5,
blurRadius: 27, blurRadius: 27,
offset: Offset(0, -3), offset: Offset(0, -3),
), ),
], ],
color: Colors.white), color: Colors.white),
child: Row( child: Padding(
children: <Widget>[ padding: const EdgeInsets.only(left: 12, right: 12, top: 12, bottom: 12),
Container( child: Column(
margin: EdgeInsets.only(left: 5, right: 5), mainAxisSize: MainAxisSize.min,
child: LargeAvatar( crossAxisAlignment: CrossAxisAlignment.start,
width: 50, children: [
height: 50, Row(
name: model.appointHistoryList[index].doctorNameObj, mainAxisAlignment: MainAxisAlignment.spaceBetween,
url: model.appointHistoryList[index].doctorImageURL, children: [
), if ((_appointmenHistory.doctorName ?? _appointmenHistory.doctorNameObj) != null)
), Text(
Expanded( _appointmenHistory.doctorTitle.toString() + " " + (_appointmenHistory.doctorName ?? _appointmenHistory.doctorNameObj),
flex: 4, style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
SizedBox(
height: 12,
),
Texts(model.appointHistoryList[index].projectName),
Texts(model.appointHistoryList[index].clinicName),
Texts(projectViewModel.isArabic
? DateUtil.getMonthDayYearDateFormattedAr(model.appointHistoryList[index].appointmentDate)
: DateUtil.getMonthDayYearDateFormatted(model.appointHistoryList[index].appointmentDate)),
StarRating(totalAverage: model.appointHistoryList[index].actualDoctorRate.toDouble(), forceStars: true),
SizedBox(
height: 12,
), ),
], Text(
), DateUtil.formatDateToDate(_appointmenHistory.appointmentDate, projectViewModel.isArabic),
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12),
),
],
), ),
), if ((_appointmenHistory.doctorName ?? _appointmenHistory.doctorNameObj) != null) SizedBox(height: 6),
InkWell( Row(
onTap: () => confirmBox(model.appointHistoryList[index], model), mainAxisSize: MainAxisSize.min,
child: Container( children: <Widget>[
width: 120, LargeAvatar(
height: 50, name: _appointmenHistory.doctorName,
decoration: BoxDecoration( url: _appointmenHistory.doctorImageURL,
color: Colors.black54, width: 48,
border: Border.all(color: Colors.transparent, width: 2), height: 48,
shape: BoxShape.rectangle,
borderRadius: BorderRadius.all(
Radius.circular(8.0),
), ),
), SizedBox(width: 11),
child: Center( Expanded(
child: Texts( child: Column(
TranslationBase.of(context).requestReport, crossAxisAlignment: CrossAxisAlignment.start,
fontSize: 12, mainAxisSize: MainAxisSize.min,
color: Colors.white, children: <Widget>[
if (_appointmenHistory.projectName != null) myRichText(TranslationBase.of(context).clinic + ":", _appointmenHistory.projectName, projectViewModel.isArabic),
if (_appointmenHistory.clinicName != null) myRichText(TranslationBase.of(context).hospital + ":", _appointmenHistory.clinicName, projectViewModel.isArabic),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
RatingBar.readOnly(
initialRating: _appointmenHistory.actualDoctorRate.toDouble(),
size: 16.0,
filledColor: Color(0XFFD02127),
emptyColor: Color(0XFFD02127),
isHalfAllowed: true,
halfFilledIcon: Icons.star_half,
filledIcon: Icons.star,
emptyIcon: Icons.star_border,
),
Icon(Icons.email, color: Color(0xff2B353E))
],
),
],
),
), ),
), ],
), ),
), ],
SizedBox( ),
width: 12,
),
],
), ),
); ),
}), );
},
),
), ),
); );
} }

@ -4,6 +4,7 @@ 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/service/base_service.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/models/LiveCare/ApplePayInsertRequest.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';
@ -20,8 +21,7 @@ class LiveCareService extends BaseService {
Map<String, dynamic> request; Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) { if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson( var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
await this.sharedPref.getObject(USER_PROFILE));
authUser = data; authUser = data;
} }
@ -44,8 +44,7 @@ class LiveCareService extends BaseService {
dynamic localRes; dynamic localRes;
await baseAppClient.post(GET_LIVECARE_CLINICS, await baseAppClient.post(GET_LIVECARE_CLINICS, onSuccess: (response, statusCode) async {
onSuccess: (response, statusCode) async {
localRes = response; localRes = response;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
throw error; throw error;
@ -57,8 +56,7 @@ class LiveCareService extends BaseService {
Map<String, dynamic> request; Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) { if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson( var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
await this.sharedPref.getObject(USER_PROFILE));
authUser = data; authUser = data;
} }
@ -81,12 +79,11 @@ class LiveCareService extends BaseService {
dynamic localRes; dynamic localRes;
await baseAppClient.post(GET_LIVECARE_SCHEDULE_CLINICS, await baseAppClient.post(GET_LIVECARE_SCHEDULE_CLINICS, onSuccess: (response, statusCode) async {
onSuccess: (response, statusCode) async { localRes = response;
localRes = response; }, onFailure: (String error, int statusCode) {
}, onFailure: (String error, int statusCode) { throw error;
throw error; }, body: request);
}, body: request);
return Future.value(localRes); return Future.value(localRes);
} }
@ -94,8 +91,7 @@ class LiveCareService extends BaseService {
Map<String, dynamic> request; Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) { if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson( var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
await this.sharedPref.getObject(USER_PROFILE));
authUser = data; authUser = data;
} }
@ -119,12 +115,11 @@ class LiveCareService extends BaseService {
dynamic localRes; dynamic localRes;
await baseAppClient.post(GET_LIVECARE_SCHEDULE_CLINIC_DOCTOR_LIST, await baseAppClient.post(GET_LIVECARE_SCHEDULE_CLINIC_DOCTOR_LIST, onSuccess: (response, statusCode) async {
onSuccess: (response, statusCode) async { localRes = response;
localRes = response; }, onFailure: (String error, int statusCode) {
}, onFailure: (String error, int statusCode) { throw error;
throw error; }, body: request);
}, body: request);
return Future.value(localRes); return Future.value(localRes);
} }
@ -132,23 +127,17 @@ class LiveCareService extends BaseService {
Map<String, dynamic> request; Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) { if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson( var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
await this.sharedPref.getObject(USER_PROFILE));
authUser = data; authUser = data;
} }
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
// Request req = appGlobal.getPublicRequest(); // Request req = appGlobal.getPublicRequest();
request = { request = {"LanguageID": languageID == 'ar' ? 1 : 2, "TokenID": "", "SessionID": "YckwoXhUmWBsnHKEKig"};
"LanguageID": languageID == 'ar' ? 1 : 2,
"TokenID": "",
"SessionID": "YckwoXhUmWBsnHKEKig"
};
dynamic localRes; dynamic localRes;
await baseAppClient.post(GET_LIVECARE_HISTORY, await baseAppClient.post(GET_LIVECARE_HISTORY, onSuccess: (response, statusCode) async {
onSuccess: (response, statusCode) async {
localRes = response; localRes = response;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
throw error; throw error;
@ -156,13 +145,11 @@ class LiveCareService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> getLivecareClinicTiming( Future<Map> getLivecareClinicTiming(int serviceID, BuildContext context) async {
int serviceID, 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) {
var data = AuthenticatedUser.fromJson( var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
await this.sharedPref.getObject(USER_PROFILE));
authUser = data; authUser = data;
} }
@ -185,8 +172,7 @@ class LiveCareService extends BaseService {
dynamic localRes; dynamic localRes;
await baseAppClient.post(GET_LIVECARE_CLINIC_TIMING, await baseAppClient.post(GET_LIVECARE_CLINIC_TIMING, onSuccess: (response, statusCode) async {
onSuccess: (response, statusCode) async {
localRes = response; localRes = response;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
throw error; throw error;
@ -198,8 +184,7 @@ class LiveCareService extends BaseService {
Map<String, dynamic> request; Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) { if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson( var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
await this.sharedPref.getObject(USER_PROFILE));
authUser = data; authUser = data;
} }
@ -225,8 +210,7 @@ class LiveCareService extends BaseService {
dynamic localRes; dynamic localRes;
await baseAppClient.post(GET_ER_APPOINTMENT_FEES, await baseAppClient.post(GET_ER_APPOINTMENT_FEES, onSuccess: (response, statusCode) async {
onSuccess: (response, statusCode) async {
localRes = response; localRes = response;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
throw error; throw error;
@ -238,8 +222,7 @@ class LiveCareService extends BaseService {
Map<String, dynamic> request; Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) { if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson( var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
await this.sharedPref.getObject(USER_PROFILE));
authUser = data; authUser = data;
} }
@ -265,8 +248,7 @@ class LiveCareService extends BaseService {
dynamic localRes; dynamic localRes;
await baseAppClient.post(GET_ER_APPOINTMENT_TIME, await baseAppClient.post(GET_ER_APPOINTMENT_TIME, onSuccess: (response, statusCode) async {
onSuccess: (response, statusCode) async {
localRes = response; localRes = response;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
throw error; throw error;
@ -274,8 +256,7 @@ class LiveCareService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> addNewCallForPatientER( Future<Map> addNewCallForPatientER(int serviceID, String clientRequestID, BuildContext context) async {
int serviceID, String clientRequestID, BuildContext context) async {
Map<String, dynamic> request; Map<String, dynamic> request;
String deviceToken; String deviceToken;
@ -285,8 +266,7 @@ class LiveCareService extends BaseService {
}); });
if (await this.sharedPref.getObject(USER_PROFILE) != null) { if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson( var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
await this.sharedPref.getObject(USER_PROFILE));
authUser = data; authUser = data;
} }
@ -316,8 +296,7 @@ class LiveCareService extends BaseService {
dynamic localRes; dynamic localRes;
await baseAppClient.post(ADD_NEW_CALL_FOR_PATIENT_ER, await baseAppClient.post(ADD_NEW_CALL_FOR_PATIENT_ER, onSuccess: (response, statusCode) async {
onSuccess: (response, statusCode) async {
localRes = response; localRes = response;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
throw error; throw error;
@ -334,16 +313,14 @@ class LiveCareService extends BaseService {
Map<String, dynamic> request; Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) { if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson( var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
await this.sharedPref.getObject(USER_PROFILE));
authUser = data; authUser = data;
} }
request = {"VCID": vc_id}; request = {"VCID": vc_id};
dynamic localRes; dynamic localRes;
await baseAppClient.post(CANCEL_LIVECARE_REQUEST, await baseAppClient.post(CANCEL_LIVECARE_REQUEST, onSuccess: (response, statusCode) async {
onSuccess: (response, statusCode) async {
localRes = response; localRes = response;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
throw error; throw error;
@ -351,25 +328,34 @@ class LiveCareService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> sendLiveCareInvoiceEmail(String appoNo, int projectID, Future<Map> applePayInsertRequest(ApplePayInsertRequest applePayInsertRequest, BuildContext context) async {
String emailAddress, BuildContext context) async { if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
authUser = data;
}
dynamic localRes;
await baseAppClient.post(APPLE_PAY_INSERT_REQUEST, onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: applePayInsertRequest.toJson());
return Future.value(localRes);
}
Future<Map> sendLiveCareInvoiceEmail(String appoNo, int projectID, String emailAddress, 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) {
var data = AuthenticatedUser.fromJson( var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
await this.sharedPref.getObject(USER_PROFILE));
authUser = data; authUser = data;
} }
request = { request = {"To": emailAddress, "ProjectID": projectID, "AppointmentNo": appoNo};
"To": emailAddress,
"ProjectID": projectID,
"AppointmentNo": appoNo
};
dynamic localRes; dynamic localRes;
await baseAppClient.post(SEND_LIVECARE_INVOICE_EMAIL, await baseAppClient.post(SEND_LIVECARE_INVOICE_EMAIL, onSuccess: (response, statusCode) async {
onSuccess: (response, statusCode) async {
localRes = response; localRes = response;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
throw error; throw error;

@ -52,8 +52,8 @@ class DateUtil {
return start + "$milliseconds" + end; return start + "$milliseconds" + end;
} }
static String formatDateToDate(DateTime date) { static String formatDateToDate(DateTime date, bool isArabic) {
return DateFormat('dd MMM yyy').format(date); return DateFormat('dd MMM yyy', isArabic ? "ar_SA" : "en_US").format(date);
} }
static String formatDateToTime(DateTime date) { static String formatDateToTime(DateTime date) {

@ -2150,6 +2150,11 @@ class TranslationBase {
String get arm => localizedValues["arm"][locale.languageCode]; String get arm => localizedValues["arm"][locale.languageCode];
String get removeMeasure => localizedValues["remove-measure"][locale.languageCode]; String get removeMeasure => localizedValues["remove-measure"][locale.languageCode];
String get selectArm => localizedValues["select-arm"][locale.languageCode]; String get selectArm => localizedValues["select-arm"][locale.languageCode];
String get askDocEmpty => localizedValues["ask-doc-empty"][locale.languageCode];
String get onlineClinics => localizedValues["online-clinics"][locale.languageCode];
String get offlineClinics => localizedValues["offline-clinics"][locale.languageCode];
String get clinicSchedule => localizedValues["clinic-schedule"][locale.languageCode];
} }
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> { class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -242,10 +242,8 @@ class _SecondaryButtonState extends State<SecondaryButton>
style: TextStyle( style: TextStyle(
color: widget.textColor, color: widget.textColor,
fontSize: widget.small ? 12.0 : 14.0, fontSize: widget.small ? 12.0 : 14.0,
// fontWeight: FontWeight.w800, fontWeight: FontWeight.w600,
fontFamily: projectViewModel.isArabic ),
? 'Cairo'
: 'WorkSans'),
), ),
) )
], ],

@ -49,7 +49,7 @@ class _VitalSignDetailsWidgetState extends State<LabResultDetailsWidget> {
tableRow.add( tableRow.add(
TableRow( TableRow(
children: [ children: [
Utils.tableColumnValue(DateUtil.formatDateToDate(DateUtil.convertStringToDate(labOrderResultList[i].verifiedOnDateTime)), isLast: i == (labOrderResultList.length - 1)), Utils.tableColumnValue(DateUtil.formatDateToDate(DateUtil.convertStringToDate(labOrderResultList[i].verifiedOnDateTime), false), isLast: i == (labOrderResultList.length - 1)),
Utils.tableColumnValue(labOrderResultList[i].resultValue, isLast: i == (labOrderResultList.length - 1)), Utils.tableColumnValue(labOrderResultList[i].resultValue, isLast: i == (labOrderResultList.length - 1)),
], ],
), ),

@ -46,9 +46,11 @@ class DoctorCard extends StatelessWidget {
this.remainingTimeInMinutes, this.remainingTimeInMinutes,
this.isParentAppointment = false}); this.isParentAppointment = false});
ProjectViewModel projectViewModel;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); projectViewModel = Provider.of(context);
return Container( return Container(
height: 120, height: 120,
decoration: BoxDecoration( decoration: BoxDecoration(
@ -127,7 +129,7 @@ class DoctorCard extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
Text( Text(
DateUtil.formatDateToDate(date), DateUtil.formatDateToDate(date, projectViewModel.isArabic),
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12), style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12),
), ),
Text( Text(
@ -155,11 +157,11 @@ class DoctorCard extends StatelessWidget {
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
myRichText(isSortByClinic ? TranslationBase.of(context).hospital : TranslationBase.of(context).clinic + ":", subName), myRichText(isSortByClinic ? TranslationBase.of(context).hospital : TranslationBase.of(context).clinic + ":", subName, projectViewModel.isArabic),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
if (rating == null) myRichText(TranslationBase.of(context).invoiceNo, billNo ?? ""), if (rating == null) myRichText(TranslationBase.of(context).invoiceNo, billNo ?? "", projectViewModel.isArabic),
if (rating != null) if (rating != null)
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
@ -216,13 +218,13 @@ class DoctorCard extends StatelessWidget {
} }
// todo 'sikander' move this widget to separate file // todo 'sikander' move this widget to separate file
Widget myRichText(String title, String value) { Widget myRichText(String title, String value, bool isArabic) {
return RichText( return RichText(
maxLines: 1, maxLines: 1,
text: TextSpan(text: title, style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 18 / 10), children: <TextSpan>[ text: TextSpan(text: title, style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, fontFamily: isArabic ? 'Cairo' : 'Poppins', color: Color(0xff575757), letterSpacing: -0.4, height: 18 / 10), children: <TextSpan>[
TextSpan( TextSpan(
text: " $value", text: " $value",
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12), style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, fontFamily: isArabic ? 'Cairo' : 'Poppins', color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12),
) )
]), ]),
); );

@ -237,7 +237,7 @@ class _TextsState extends State<Texts> {
letterSpacing: widget.variant == "overline" ? 1 : null, letterSpacing: widget.variant == "overline" ? 1 : null,
fontWeight: widget.fontWeight ?? _getFontWeight(), fontWeight: widget.fontWeight ?? _getFontWeight(),
fontFamily: fontFamily:
projectViewModel.isArabic ? 'Cairo' : 'WorkSans'), projectViewModel.isArabic ? 'Cairo' : 'Poppins'),
), ),
if (widget.readMore && text.length > widget.maxLength && hidden) if (widget.readMore && text.length > widget.maxLength && hidden)
Positioned( Positioned(

@ -154,6 +154,7 @@ class _AppDrawerState extends State<AppDrawer> {
Padding(child: Image.asset('assets/images/lang.png'), padding: EdgeInsets.all(3)), Padding(child: Image.asset('assets/images/lang.png'), padding: EdgeInsets.all(3)),
isImageIcon: true, isImageIcon: true,
bottomLine: false, bottomLine: false,
projectProvider: projectProvider,
), ),
onTap: () { onTap: () {
sharedPref.setBool(IS_ROBOT_INIT, null); sharedPref.setBool(IS_ROBOT_INIT, null);
@ -181,6 +182,7 @@ class _AppDrawerState extends State<AppDrawer> {
iconColor: Theme.of(context).textTheme.bodyText1.color, iconColor: Theme.of(context).textTheme.bodyText1.color,
sideArrow: true, sideArrow: true,
letterSpacing: -0.84, letterSpacing: -0.84,
projectProvider: projectProvider
), ),
onTap: () { onTap: () {
Navigator.of(context).pop(); Navigator.of(context).pop();
@ -312,6 +314,7 @@ class _AppDrawerState extends State<AppDrawer> {
letterSpacing: -0.84, letterSpacing: -0.84,
fontSize: 14, fontSize: 14,
fontHeight: projectProvider.isArabic ? 1 : 0.8, fontHeight: projectProvider.isArabic ? 1 : 0.8,
projectProvider: projectProvider
), ),
onTap: () { onTap: () {
sharedPref.remove(APPOINTMENT_HISTORY_MEDICAL); sharedPref.remove(APPOINTMENT_HISTORY_MEDICAL);
@ -333,6 +336,7 @@ class _AppDrawerState extends State<AppDrawer> {
bottomLine: false, bottomLine: false,
letterSpacing: -0.84, letterSpacing: -0.84,
fontSize: 14, fontSize: 14,
projectProvider: projectProvider,
count: notificationCount != null count: notificationCount != null
? new Container( ? new Container(
padding: EdgeInsets.all(4), padding: EdgeInsets.all(4),
@ -374,6 +378,7 @@ class _AppDrawerState extends State<AppDrawer> {
bottomLine: false, bottomLine: false,
letterSpacing: -0.84, letterSpacing: -0.84,
fontSize: 14, fontSize: 14,
projectProvider: projectProvider
), ),
onTap: () { onTap: () {
Navigator.of(context).pushNamed( Navigator.of(context).pushNamed(
@ -388,6 +393,7 @@ class _AppDrawerState extends State<AppDrawer> {
bottomLine: false, bottomLine: false,
letterSpacing: -0.84, letterSpacing: -0.84,
fontSize: 14, fontSize: 14,
projectProvider: projectProvider
), ),
onTap: () { onTap: () {
if (Platform.isIOS) { if (Platform.isIOS) {
@ -405,6 +411,7 @@ class _AppDrawerState extends State<AppDrawer> {
bottomLine: false, bottomLine: false,
letterSpacing: -0.84, letterSpacing: -0.84,
fontSize: 14, fontSize: 14,
projectProvider: projectProvider
), ),
onTap: () { onTap: () {
logout(); logout();
@ -420,6 +427,7 @@ class _AppDrawerState extends State<AppDrawer> {
letterSpacing: -0.84, letterSpacing: -0.84,
fontSize: 14, fontSize: 14,
bottomLine: false, bottomLine: false,
projectProvider: projectProvider
), ),
onTap: () { onTap: () {
login(); login();
@ -504,6 +512,7 @@ class _AppDrawerState extends State<AppDrawer> {
var appLanguage = await sharedPref.getString(APP_LANGUAGE); var appLanguage = await sharedPref.getString(APP_LANGUAGE);
await sharedPref.clear(); await sharedPref.clear();
await sharedPref.setString(APP_LANGUAGE, appLanguage); await sharedPref.setString(APP_LANGUAGE, appLanguage);
await sharedPref.remove(APPOINTMENT_HISTORY_MEDICAL);
this.user = null; this.user = null;
Navigator.of(context).pushNamed(HOME); Navigator.of(context).pushNamed(HOME);
// projectProvider.platformBridge().unRegisterHmgGeofences(); // projectProvider.platformBridge().unRegisterHmgGeofences();

@ -1,6 +1,7 @@
import 'dart:ui'; import 'dart:ui';
import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -19,9 +20,10 @@ class DrawerItem extends StatefulWidget {
final double fontHeight; final double fontHeight;
final double letterSpacing; final double letterSpacing;
final double fontSize; final double fontSize;
final ProjectViewModel projectProvider;
DrawerItem(this.title, this.icon, DrawerItem(this.title, this.icon,
{this.fontSize, this.letterSpacing, this.textColor, this.iconColor, this.subTitle = '', this.bottomLine = true, this.count, this.sideArrow = false, this.isImageIcon = false, this.fontHeight}); {this.fontSize, this.letterSpacing, this.textColor, this.iconColor, this.subTitle = '', this.bottomLine = true, this.count, this.sideArrow = false, this.isImageIcon = false, this.fontHeight, this.projectProvider});
@override @override
_DrawerItemState createState() => _DrawerItemState(); _DrawerItemState createState() => _DrawerItemState();
@ -76,7 +78,7 @@ class _DrawerItemState extends State<DrawerItem> {
) )
: SizedBox(), : SizedBox(),
])), ])),
widget.sideArrow == true ? Expanded(flex: 1, child: Icon(Icons.keyboard_arrow_right, color: Colors.black)) : Expanded(flex: 1, child: SizedBox()), widget.sideArrow == true ? Expanded(flex: 1, child: Icon(widget.projectProvider.isArabic ? Icons.keyboard_arrow_left : Icons.keyboard_arrow_right, color: Colors.black)) : Expanded(flex: 1, child: SizedBox()),
], ],
), ),
)); ));

@ -5,17 +5,21 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/order_detail.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/order_detail.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/models/LiveCare/ApplePayInsertRequest.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/services/livecare_services/livecare_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/gif_loader_dialog_utils.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
import 'package:flutter_inappwebview/flutter_inappwebview.dart'; import 'package:flutter_inappwebview/flutter_inappwebview.dart';
enum _PAYMENT_TYPE { PACKAGES, PHARMACY, PATIENT } enum _PAYMENT_TYPE { PACKAGES, PHARMACY, PATIENT }
var _InAppBrowserOptions = InAppBrowserClassOptions( var _InAppBrowserOptions = InAppBrowserClassOptions(
inAppWebViewGroupOptions: InAppWebViewGroupOptions( inAppWebViewGroupOptions: InAppWebViewGroupOptions(crossPlatform: InAppWebViewOptions(useShouldOverrideUrlLoading: true)),
crossPlatform: InAppWebViewOptions(useShouldOverrideUrlLoading: true)),
crossPlatform: InAppBrowserOptions(hideUrlBar: true), crossPlatform: InAppBrowserOptions(hideUrlBar: true),
ios: IOSInAppBrowserOptions( ios: IOSInAppBrowserOptions(
toolbarBottom: false, toolbarBottom: false,
@ -23,38 +27,28 @@ var _InAppBrowserOptions = InAppBrowserClassOptions(
class MyInAppBrowser extends InAppBrowser { class MyInAppBrowser extends InAppBrowser {
_PAYMENT_TYPE paymentType; _PAYMENT_TYPE paymentType;
// static String SERVICE_URL = // static String SERVICE_URL =
// 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT // 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT
static String SERVICE_URL = static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE
'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE
// static String PREAUTH_SERVICE_URL = // static String PREAUTH_SERVICE_URL =
// 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort PreAuth Payment Gateway URL UAT // 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort PreAuth Payment Gateway URL UAT
static String PREAUTH_SERVICE_URL = static String PREAUTH_SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store
'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store
// static String PRESCRIPTION_PAYMENT_WITH_ORDERID = // static String PRESCRIPTION_PAYMENT_WITH_ORDERID =
// 'https://uat.hmgwebservices.com/epharmacy/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID='; // 'https://uat.hmgwebservices.com/epharmacy/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID=';
static String PRESCRIPTION_PAYMENT_WITH_ORDERID = static String PRESCRIPTION_PAYMENT_WITH_ORDERID = 'https://mdlaboratories.com/exacartapi/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID='; //Live
'https://mdlaboratories.com/exacartapi/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID='; //Live
// Packages // Packages
static String PACKAGES_REQUEST_PAYMENT_URL = static String PACKAGES_REQUEST_PAYMENT_URL = '$EXA_CART_API_BASE_URL/checkout/OpcCompleteRedirectionPayment1';
'$EXA_CART_API_BASE_URL/checkout/OpcCompleteRedirectionPayment1'; static String PACKAGES_PAYMENT_SUCCESS_URL = '$EXA_CART_API_BASE_URL/Checkout/MobilePaymentSuccess';
static String PACKAGES_PAYMENT_SUCCESS_URL = static String PACKAGES_PAYMENT_FAIL_URL = '$EXA_CART_API_BASE_URL/Checkout/MobilePaymentFailed';
'$EXA_CART_API_BASE_URL/Checkout/MobilePaymentSuccess';
static String PACKAGES_PAYMENT_FAIL_URL = static List<String> successURLS = ['success', 'PayFortResponse', 'PayFortSucess', 'mobilepaymentcomplete'];
'$EXA_CART_API_BASE_URL/Checkout/MobilePaymentFailed';
static List<String> successURLS = [
'success',
'PayFortResponse',
'PayFortSucess',
'mobilepaymentcomplete'
];
static List<String> errorURLS = ['PayfortCancel', 'errorpage', 'Failed']; static List<String> errorURLS = ['PayfortCancel', 'errorpage', 'Failed'];
@ -76,8 +70,7 @@ class MyInAppBrowser extends InAppBrowser {
static bool isPaymentDone = false; static bool isPaymentDone = false;
MyInAppBrowser( MyInAppBrowser({this.onExitCallback, this.appo, this.onLoadStartCallback, this.context});
{this.onExitCallback, this.appo, this.onLoadStartCallback, this.context});
Future onBrowserCreated() async { Future onBrowserCreated() async {
print("\n\nBrowser Created!\n\n"); print("\n\nBrowser Created!\n\n");
@ -99,8 +92,7 @@ class MyInAppBrowser extends InAppBrowser {
} }
@override @override
void onProgressChanged(int progress) { void onProgressChanged(int progress) {}
}
@override @override
void onExit() { void onExit() {
@ -109,14 +101,11 @@ class MyInAppBrowser extends InAppBrowser {
} }
@override @override
Future<ShouldOverrideUrlLoadingAction> shouldOverrideUrlLoading( Future<ShouldOverrideUrlLoadingAction> shouldOverrideUrlLoading(ShouldOverrideUrlLoadingRequest shouldOverrideUrlLoadingRequest) async {
ShouldOverrideUrlLoadingRequest shouldOverrideUrlLoadingRequest) async {
var url = shouldOverrideUrlLoadingRequest.url; var url = shouldOverrideUrlLoadingRequest.url;
debugPrint("redirecting/overriding to: $url"); debugPrint("redirecting/overriding to: $url");
if (paymentType == _PAYMENT_TYPE.PACKAGES && if (paymentType == _PAYMENT_TYPE.PACKAGES && [PACKAGES_PAYMENT_SUCCESS_URL, PACKAGES_PAYMENT_FAIL_URL].contains(url)) {
[PACKAGES_PAYMENT_SUCCESS_URL, PACKAGES_PAYMENT_FAIL_URL]
.contains(url)) {
isPaymentDone = (url == PACKAGES_PAYMENT_SUCCESS_URL); isPaymentDone = (url == PACKAGES_PAYMENT_SUCCESS_URL);
close(); close();
} }
@ -135,86 +124,88 @@ class MyInAppBrowser extends InAppBrowser {
getPatientData() async { getPatientData() async {
if (await this.sharedPref.getObject(USER_PROFILE) != null) { if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson( var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
await this.sharedPref.getObject(USER_PROFILE));
authUser = data; authUser = data;
} }
if (await this.sharedPref.getDouble(USER_LAT) != null && if (await this.sharedPref.getDouble(USER_LAT) != null && await this.sharedPref.getDouble(USER_LONG) != null) {
await this.sharedPref.getDouble(USER_LONG) != null) {
lat = await this.sharedPref.getDouble(USER_LAT); lat = await this.sharedPref.getDouble(USER_LAT);
long = await this.sharedPref.getDouble(USER_LONG); long = await this.sharedPref.getDouble(USER_LONG);
} }
} }
openPackagesPaymentBrowser( openPackagesPaymentBrowser({@required int customer_id, @required int order_id}) {
{@required int customer_id, @required int order_id}) {
paymentType = _PAYMENT_TYPE.PACKAGES; paymentType = _PAYMENT_TYPE.PACKAGES;
var full_url = var full_url = '$PACKAGES_REQUEST_PAYMENT_URL?customer_id=$customer_id&order_id=$order_id';
'$PACKAGES_REQUEST_PAYMENT_URL?customer_id=$customer_id&order_id=$order_id';
this.openUrl(url: full_url, options: _InAppBrowserOptions); this.openUrl(url: full_url, options: _InAppBrowserOptions);
} }
openPaymentBrowser( openPaymentBrowser(double amount, String orderDesc, String transactionID, String projId, String emailId, String paymentMethod, dynamic patientType, String patientName, dynamic patientID,
double amount, AuthenticatedUser authenticatedUser, InAppBrowser browser, bool isLiveCareAppo, var servID, var LiveServID,
String orderDesc, [var appoDate, var appoNo, var clinicID, var doctorID]) async {
String transactionID,
String projId,
String emailId,
String paymentMethod,
dynamic patientType,
String patientName,
dynamic patientID,
AuthenticatedUser authenticatedUser,
InAppBrowser browser,
bool isLiveCareAppo,
var servID,
var LiveServID,
[var appoDate,
var appoNo,
var clinicID,
var doctorID]) {
this.browser = browser; this.browser = browser;
getPatientData(); await getPatientData();
generateURL( if (paymentMethod == "ApplePay") {
amount, MyChromeSafariBrowser safariBrowser = new MyChromeSafariBrowser(new MyInAppBrowser(), onExitCallback: browser.onExit, onLoadStartCallback: this.browser.onLoadStart, appo: this.appo);
orderDesc,
transactionID, if (context != null) GifLoaderDialogUtils.showMyDialog(context);
projId,
emailId, LiveCareService service = new LiveCareService();
paymentMethod, ApplePayInsertRequest applePayInsertRequest = new ApplePayInsertRequest();
patientType,
patientName, applePayInsertRequest.clientRequestID = transactionID;
patientID, applePayInsertRequest.clinicID = clinicID != null ? clinicID : 0;
authenticatedUser, applePayInsertRequest.currency = authenticatedUser.outSA == 1 ? "AED" : "SAR";
isLiveCareAppo, applePayInsertRequest.customerEmail = emailId;
servID, applePayInsertRequest.customerID = authenticatedUser.patientID;
LiveServID, applePayInsertRequest.customerName = authenticatedUser.firstName;
appoDate, applePayInsertRequest.deviceToken = deviceToken;
appoNo, applePayInsertRequest.doctorID = doctorID != null ? doctorID : 0;
clinicID, applePayInsertRequest.projectID = projId;
doctorID) applePayInsertRequest.serviceID = servID;
.then((value) { applePayInsertRequest.channelID = 3;
paymentType = _PAYMENT_TYPE.PATIENT; applePayInsertRequest.patientID = authenticatedUser.patientID;
this.browser.openUrl(url: value, options: _InAppBrowserOptions); applePayInsertRequest.patientTypeID = authenticatedUser.patientType;
}); applePayInsertRequest.patientOutSA = authenticatedUser.outSA;
applePayInsertRequest.appointmentDate = appoDate != null ? appoDate : null;
applePayInsertRequest.appointmentNo = appoNo != null ? appoNo : 0;
applePayInsertRequest.orderDescription = orderDesc;
applePayInsertRequest.liveServiceID = LiveServID;
applePayInsertRequest.latitude = this.lat.toString();
applePayInsertRequest.longitude = this.long.toString();
applePayInsertRequest.amount = amount.toString();
applePayInsertRequest.isSchedule = "0";
applePayInsertRequest.language = getLanguageID() == 'ar' ? 'AR' : 'EN';
applePayInsertRequest.userName = authenticatedUser.patientID;
applePayInsertRequest.responseContinueURL = "http://hmg.com/Documents/success.html";
applePayInsertRequest.backClickUrl = "http://hmg.com/Documents/success.html";
applePayInsertRequest.paymentOption = "ApplePay";
service.applePayInsertRequest(applePayInsertRequest, context).then((res) {
if (context != null) GifLoaderDialogUtils.hideDialog(context);
var url = "https://hmgwebservices.com/HMGApplePayLive/applepay/pay?apq=" + res['result'];
print(url);
safariBrowser.open(url: url);
// this.browser.openUrl(url: url, options: _InAppBrowserOptions);
}).catchError((err) {
print(err);
if (context != null) GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err);
});
} else {
generateURL(amount, orderDesc, transactionID, projId, emailId, paymentMethod, patientType, patientName, patientID, authenticatedUser, isLiveCareAppo, servID, LiveServID, appoDate, appoNo,
clinicID, doctorID)
.then((value) {
paymentType = _PAYMENT_TYPE.PATIENT;
this.browser.openUrl(url: value, options: _InAppBrowserOptions);
});
}
} }
openPharmacyPaymentBrowser( openPharmacyPaymentBrowser(OrderDetailModel order, double amount, String orderDesc, String transactionID, String emailId, String paymentMethod, String patientName, dynamic patientID,
OrderDetailModel order, AuthenticatedUser authenticatedUser, InAppBrowser browser) {
double amount,
String orderDesc,
String transactionID,
String emailId,
String paymentMethod,
String patientName,
dynamic patientID,
AuthenticatedUser authenticatedUser,
InAppBrowser browser) {
this.browser = browser; this.browser = browser;
getPatientData(); getPatientData();
generatePharmacyURL(order, amount, orderDesc, transactionID, emailId, generatePharmacyURL(order, amount, orderDesc, transactionID, emailId, paymentMethod, patientName, patientID, authenticatedUser).then((value) {
paymentMethod, patientName, patientID, authenticatedUser)
.then((value) {
this.browser.openUrl(url: value); this.browser.openUrl(url: value);
}); });
} }
@ -224,25 +215,9 @@ class MyInAppBrowser extends InAppBrowser {
this.browser.openUrl(url: url, options: _InAppBrowserOptions); this.browser.openUrl(url: url, options: _InAppBrowserOptions);
} }
Future<String> generateURL( Future<String> generateURL(double amount, String orderDesc, String transactionID, String projId, String emailId, String paymentMethod, dynamic patientType, String patientName, dynamic patientID,
double amount, AuthenticatedUser authUser, bool isLiveCareAppo, var servID, var LiveServID,
String orderDesc, [var appoDate, var appoNo, var clinicID, var doctorID, var patientData]) async {
String transactionID,
String projId,
String emailId,
String paymentMethod,
dynamic patientType,
String patientName,
dynamic patientID,
AuthenticatedUser authUser,
bool isLiveCareAppo,
var servID,
var LiveServID,
[var appoDate,
var appoNo,
var clinicID,
var doctorID,
var patientData]) async {
getDeviceToken(); getDeviceToken();
String currentLanguageID = getLanguageID() == 'ar' ? 'AR' : 'EN'; String currentLanguageID = getLanguageID() == 'ar' ? 'AR' : 'EN';
String form = isLiveCareAppo ? getLiveCareForm() : getForm(); String form = isLiveCareAppo ? getLiveCareForm() : getForm();
@ -256,19 +231,15 @@ class MyInAppBrowser extends InAppBrowser {
form = form.replaceFirst('PROJECT_ID_VALUE', projId); form = form.replaceFirst('PROJECT_ID_VALUE', projId);
form = form.replaceFirst('PAYMENT_OPTION_VALUE', paymentMethod); form = form.replaceFirst('PAYMENT_OPTION_VALUE', paymentMethod);
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('PATIENT_TYPE_ID', patientData == null ? patientType.toString() : "1");
form = form.replaceFirst(
'PATIENT_TYPE_ID', patientData == null ? patientType.toString() : "1");
form = form.replaceFirst( form = form.replaceFirst('DEVICE_TOKEN', await sharedPref.getString(PUSH_TOKEN));
'DEVICE_TOKEN', await sharedPref.getString(PUSH_TOKEN));
form = form.replaceFirst('LATITUDE_VALUE', this.lat.toString()); form = form.replaceFirst('LATITUDE_VALUE', this.lat.toString());
form = form.replaceFirst('LONGITUDE_VALUE', this.long.toString()); form = form.replaceFirst('LONGITUDE_VALUE', this.long.toString());
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);
else else
form = form.replaceFirst('SERVICE_URL_VALUE', MyInAppBrowser.SERVICE_URL); form = form.replaceFirst('SERVICE_URL_VALUE', MyInAppBrowser.SERVICE_URL);
@ -297,19 +268,8 @@ class MyInAppBrowser extends InAppBrowser {
} }
Future<String> generatePharmacyURL( Future<String> generatePharmacyURL(
OrderDetailModel order, OrderDetailModel order, double amount, String orderDesc, String transactionID, String emailId, String paymentMethod, String patientName, dynamic patientID, AuthenticatedUser authUser) async {
double amount, String pharmacyURL = PRESCRIPTION_PAYMENT_WITH_ORDERID + order.orderGuid + '&&CustomerId=' + "${order.customerId}";
String orderDesc,
String transactionID,
String emailId,
String paymentMethod,
String patientName,
dynamic patientID,
AuthenticatedUser authUser) async {
String pharmacyURL = PRESCRIPTION_PAYMENT_WITH_ORDERID +
order.orderGuid +
'&&CustomerId=' +
"${order.customerId}";
return pharmacyURL; return pharmacyURL;
} }
@ -380,10 +340,18 @@ class MyInAppBrowser extends InAppBrowser {
'</body>' + '</body>' +
'</html>'; '</html>';
} }
safariCallBack() {
print("Safari CallBack!!!");
}
} }
class MyChromeSafariBrowser extends ChromeSafariBrowser { class MyChromeSafariBrowser extends ChromeSafariBrowser {
MyChromeSafariBrowser(browserFallback) : super(bFallback: browserFallback); final Function onExitCallback;
final Function onLoadStartCallback;
AppoitmentAllHistoryResultList appo;
MyChromeSafariBrowser(browserFallback, {@required this.onExitCallback, @required this.onLoadStartCallback, @required this.appo}) : super(bFallback: browserFallback);
@override @override
void onOpened() { void onOpened() {
@ -393,10 +361,13 @@ class MyChromeSafariBrowser extends ChromeSafariBrowser {
@override @override
void onCompletedInitialLoad() { void onCompletedInitialLoad() {
print("ChromeSafari browser initial load completed"); print("ChromeSafari browser initial load completed");
onLoadStartCallback("ApplePay");
} }
@override @override
void onClosed() { void onClosed() {
print("ChromeSafari browser closed"); print("ChromeSafari browser closed");
MyInAppBrowser.isPaymentDone = true;
onExitCallback();
} }
} }

@ -1,4 +1,5 @@
import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart'; import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/header_model.dart'; import 'package:diplomaticquarterapp/models/header_model.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
@ -8,6 +9,7 @@ import 'package:diplomaticquarterapp/widgets/dialogs/confirm_send_email_dialog.d
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/extensions/string_extensions.dart'; import 'package:diplomaticquarterapp/extensions/string_extensions.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
import 'package:provider/provider.dart';
import 'package:rating_bar/rating_bar.dart'; import 'package:rating_bar/rating_bar.dart';
class DoctorHeader extends StatelessWidget { class DoctorHeader extends StatelessWidget {
@ -30,10 +32,12 @@ class DoctorHeader extends StatelessWidget {
this.onRatingAndReviewTap}) this.onRatingAndReviewTap})
: super(key: key); : super(key: key);
ProjectViewModel projectViewModel;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
String _speciality = (headerModel?.speciality ?? []).length > 0 ? headerModel.speciality.first : ""; String _speciality = (headerModel?.speciality ?? []).length > 0 ? headerModel.speciality.first : "";
projectViewModel = Provider.of(context);
return Container( return Container(
color: Colors.white, color: Colors.white,
child: Column( child: Column(
@ -62,8 +66,8 @@ class DoctorHeader extends StatelessWidget {
_speciality, _speciality,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.48, height: 18 / 12), style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.48, height: 18 / 12),
), ),
headerModel.invoiceNo.isNotEmpty ? myRichText(TranslationBase.of(context).invoiceNo + ":", headerModel.invoiceNo) : Container(), headerModel.invoiceNo.isNotEmpty ? myRichText(TranslationBase.of(context).invoiceNo + ":", headerModel.invoiceNo, projectViewModel.isArabic) : Container(),
myRichText(TranslationBase.of(context).branch, headerModel.projectName), myRichText(TranslationBase.of(context).branch, headerModel.projectName, projectViewModel.isArabic),
], ],
), ),
), ),
@ -73,7 +77,7 @@ class DoctorHeader extends StatelessWidget {
children: [ children: [
if (headerModel.date != null) if (headerModel.date != null)
Text( Text(
DateUtil.formatDateToDate(headerModel.date), DateUtil.formatDateToDate(headerModel.date, projectViewModel.isArabic),
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12), style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12),
), ),
if (headerModel.time != null) if (headerModel.time != null)
@ -84,7 +88,7 @@ class DoctorHeader extends StatelessWidget {
if (headerModel?.nationalityFlagURL != null) if (headerModel?.nationalityFlagURL != null)
Padding( Padding(
padding: const EdgeInsets.only(top: 8.0), padding: const EdgeInsets.only(top: 8.0),
child: Image.network(headerModel.nationalityFlagURL ?? "", height: 16), child: Image.network(headerModel.nationalityFlagURL ?? "", height: 20),
), ),
], ],
) )
@ -139,7 +143,7 @@ class DoctorHeader extends StatelessWidget {
}, },
child: Container( child: Container(
padding: EdgeInsets.only(top: 10, bottom: 10, right: 21, left: 15), padding: EdgeInsets.only(top: 10, bottom: 10, right: 21, left: 15),
decoration: BoxDecoration(color: Color(0XFFD02127), borderRadius: BorderRadius.only(topLeft: Radius.circular(10))), decoration: BoxDecoration(color: Color(0XFFD02127), borderRadius: projectViewModel.isArabic ? BorderRadius.only(topRight: Radius.circular(10)) : BorderRadius.only(topLeft: Radius.circular(10))),
child: Row( child: Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
@ -147,7 +151,7 @@ class DoctorHeader extends StatelessWidget {
SizedBox(width: 6), SizedBox(width: 6),
Text( Text(
buttonTitle == null ? TranslationBase.of(context).sendEmail : buttonTitle, buttonTitle == null ? TranslationBase.of(context).sendEmail : buttonTitle,
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.64, height: 25 / 16), style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.64, height: 1),
), ),
], ],
), ),

@ -18,7 +18,8 @@ class AppExpandableNotifier extends StatefulWidget {
final bool isExpand; final bool isExpand;
bool expandFlag = false; bool expandFlag = false;
var controller = new ExpandableController(); var controller = new ExpandableController();
AppExpandableNotifier({this.headerWidget, this.bodyWidget, this.title, this.collapsed, this.isExpand = false}); bool isTitleSingleLine;
AppExpandableNotifier({this.headerWidget, this.bodyWidget, this.title, this.collapsed, this.isExpand = false, this.isTitleSingleLine = true});
_AppExpandableNotifier createState() => _AppExpandableNotifier(); _AppExpandableNotifier createState() => _AppExpandableNotifier();
} }
@ -66,7 +67,7 @@ class _AppExpandableNotifier extends State<AppExpandableNotifier> {
header: Padding( header: Padding(
padding: const EdgeInsets.only(top: 12, bottom: 12, left: 21, right: 21), padding: const EdgeInsets.only(top: 12, bottom: 12, left: 21, right: 21),
child: InkWell( child: InkWell(
onTap: (){ onTap: () {
setState(() { setState(() {
widget.expandFlag = !widget.expandFlag; widget.expandFlag = !widget.expandFlag;
widget.controller.expanded = widget.expandFlag; widget.controller.expanded = widget.expandFlag;
@ -80,16 +81,23 @@ class _AppExpandableNotifier extends State<AppExpandableNotifier> {
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
if (_mainTitle.isNotEmpty) if (_mainTitle.isNotEmpty && widget.isTitleSingleLine)
Text( Text(
_mainTitle, _mainTitle,
style: TextStyle(fontSize: 20, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.72, height: 1), style: TextStyle(fontSize: 20, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.72, height: 1),
), ),
// Text( if (_title.isNotEmpty && !widget.isTitleSingleLine)
// _subTitle, Text(
// maxLines: 1, _title,
// style: TextStyle(fontSize: 24, fontWeight: FontWeight.w700, color: Color(0xff2E303A), letterSpacing: -1.44, height: 25 / 24), maxLines: 1,
// ), style: TextStyle(fontSize: 24, fontWeight: FontWeight.w700, color: Color(0xff2E303A), letterSpacing: -1.44, height: 25 / 24),
),
if (_subTitle.isNotEmpty && !widget.isTitleSingleLine)
Text(
_subTitle,
maxLines: 1,
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.72, height: 23 / 12),
),
], ],
), ),
), ),

@ -4,29 +4,27 @@ import 'package:flutter/material.dart';
/// [page] /// [page]
class FadePage extends PageRouteBuilder { class FadePage extends PageRouteBuilder {
final Widget page; final Widget page;
FadePage({this.page}) FadePage({this.page})
: super( : super(
opaque: false, opaque: false,
fullscreenDialog: true, fullscreenDialog: true,
barrierDismissible: true, barrierDismissible: true,
barrierColor: Colors.black.withOpacity(0.8), barrierColor: Colors.black.withOpacity(0.8),
pageBuilder: ( pageBuilder: (
BuildContext context, BuildContext context,
Animation<double> animation, Animation<double> animation,
Animation<double> secondaryAnimation, Animation<double> secondaryAnimation,
) => ) =>
page, page,
transitionDuration: Duration(milliseconds: 300), transitionDuration: Duration(milliseconds: 300),
transitionsBuilder: ( transitionsBuilder: (
BuildContext context, BuildContext context,
Animation<double> animation, Animation<double> animation,
Animation<double> secondaryAnimation, Animation<double> secondaryAnimation,
Widget child, Widget child,
) { ) {
return FadeTransition( return FadeTransition(opacity: animation, child: child);
opacity: animation, },
child: child );
); }
}
);
}

Loading…
Cancel
Save