dev_v3.13.6_voipcall
Sultan khan 3 years ago
parent abcf82346e
commit b45cbbcf29

@ -1,3 +1,3 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
final Color secondaryColor = Colors.red[800]; final Color? secondaryColor = Colors.red[800];

@ -19,11 +19,14 @@ var PACKAGES_SHOPPING_CART = '/api/shopping_cart_items';
var PACKAGES_ORDERS = '/api/orders'; var PACKAGES_ORDERS = '/api/orders';
var PACKAGES_ORDER_HISTORY = '/api/orders/items'; var PACKAGES_ORDER_HISTORY = '/api/orders/items';
var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara'; var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara';
// var BASE_URL = 'http://10.50.100.198:4422/'; // var BASE_URL = 'http://10.50.100.198:2018/';
var BASE_URL = 'https://uat.hmgwebservices.com/'; var BASE_URL = 'https://uat.hmgwebservices.com/';
// var BASE_URL = 'https://hmgwebservices.com/'; // var BASE_URL = 'https://hmgwebservices.com/';
// var BASE_URL = 'https://orash.cloudsolutions.com.sa/'; // var BASE_URL = 'https://orash.cloudsolutions.com.sa/';
// var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; // var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/';
// var BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/';
// var BASE_URL = 'https://webservices.hmg.com/';
// Pharmacy UAT URLs // Pharmacy UAT URLs
// var BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; // var BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/';
@ -33,6 +36,10 @@ var BASE_URL = 'https://uat.hmgwebservices.com/';
var BASE_PHARMACY_URL = 'https://mdlaboratories.com/exacartapi/api/'; var BASE_PHARMACY_URL = 'https://mdlaboratories.com/exacartapi/api/';
var PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapi/api/'; var PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapi/api/';
// Pharmacy VidaPlus URLs
// var BASE_PHARMACY_URL = 'https://mdlaboratories.com/exacartapitest/api/';
// var PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapitest/api/';
// // Pharmacy Pre-Production URLs // // Pharmacy Pre-Production URLs
// var BASE_PHARMACY_URL = 'https://mdlaboratories.com/exacartapitest/api/'; // var BASE_PHARMACY_URL = 'https://mdlaboratories.com/exacartapitest/api/';
// var PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapitest/api/'; // var PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapitest/api/';
@ -40,6 +47,8 @@ var PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapi/api/';
// RC API URL // RC API URL
var RC_BASE_URL = 'https://rc.hmg.com/'; var RC_BASE_URL = 'https://rc.hmg.com/';
// var RC_BASE_URL = 'https://ms.hmg.com/rc/';
var PING_SERVICE = 'Services/Weather.svc/REST/CheckConnectivity'; var PING_SERVICE = 'Services/Weather.svc/REST/CheckConnectivity';
var GET_PROJECT = 'Services/Lists.svc/REST/GetProject'; var GET_PROJECT = 'Services/Lists.svc/REST/GetProject';
@ -326,7 +335,7 @@ var UPDATE_COVID_QUESTIONNAIRE = 'Services/Doctors.svc/REST/COVID19_Questionnari
var CHANNEL = 3; var CHANNEL = 3;
var GENERAL_ID = 'Cs2020@2016\$2958'; var GENERAL_ID = 'Cs2020@2016\$2958';
var IP_ADDRESS = '10.20.10.20'; var IP_ADDRESS = '10.20.10.20';
var VERSION_ID = 10.8; var VERSION_ID = 10.9;
var SETUP_ID = '91877'; var SETUP_ID = '91877';
var LANGUAGE = 2; var LANGUAGE = 2;
// var PATIENT_OUT_SA = 0; // var PATIENT_OUT_SA = 0;

@ -1893,4 +1893,10 @@ const Map localizedValues = {
"sickLeaveAdmittedPatient": {"en": "You cannot activate this sick leave since you're an admitted patient.", "ar": "لا يمكنك تفعيل هذه الإجازة المرضية لأنك مريض مقبل."}, "sickLeaveAdmittedPatient": {"en": "You cannot activate this sick leave since you're an admitted patient.", "ar": "لا يمكنك تفعيل هذه الإجازة المرضية لأنك مريض مقبل."},
"dischargeDate": {"en": "Discharge Date", "ar": "تاريخ التفريغ"}, "dischargeDate": {"en": "Discharge Date", "ar": "تاريخ التفريغ"},
"selectAdmissionText": {"en": "Please select one of the admissions from below to view medical reports:", "ar": "يرجى تحديد أحد حالات القبول من الأسفل لعرض التقارير الطبية:"}, "selectAdmissionText": {"en": "Please select one of the admissions from below to view medical reports:", "ar": "يرجى تحديد أحد حالات القبول من الأسفل لعرض التقارير الطبية:"},
"invalidEligibility": {"en": "You cannot make online payment because you are not eligible to use the provided service.", "ar": "لا يمكنك إجراء الدفع عبر الإنترنت لأنك غير مؤهل لاستخدام الخدمة المقدمة."},
"invalidInsurance": {"en": "You cannot make online payment because you do not have a valid insurance.", "ar": "لا يمكنك إجراء الدفع عبر الإنترنت لأنه ليس لديك تأمين صالح."},
"continueCash": {"en": "Continue as cash", "ar": "تواصل نقدا"},
"updateInsurance": {"en": "Update insurance", "ar": "تحديث التأمين"},
"downloadReport": {"en": "Download Report", "ar": "تحميل تقرير المختبر"},
"habibCallCenter": {"en": "Please contact AlHabib call center to update your insurance manually.", "ar": "يرجى الاتصال بمركز اتصال الحبيب لتحديث التأمين الخاص بك يدوياً."},
}; };

@ -16,6 +16,7 @@ class PatientLabOrders {
int gender; int gender;
String genderDescription; String genderDescription;
String invoiceNo; String invoiceNo;
String invoiceNo_VP;
bool isActiveDoctorProfile; bool isActiveDoctorProfile;
bool isDoctorAllowVedioCall; bool isDoctorAllowVedioCall;
bool isExecludeDoctor; bool isExecludeDoctor;
@ -68,6 +69,7 @@ class PatientLabOrders {
this.projectNameN, this.projectNameN,
this.qR, this.qR,
this.setupID, this.setupID,
this.invoiceNo_VP,
this.speciality,this.isLiveCareAppointment}); this.speciality,this.isLiveCareAppointment});
PatientLabOrders.fromJson(Map<String, dynamic> json) { PatientLabOrders.fromJson(Map<String, dynamic> json) {
@ -103,6 +105,7 @@ class PatientLabOrders {
projectNameN = json['ProjectNameN']; projectNameN = json['ProjectNameN'];
qR = json['QR']; qR = json['QR'];
setupID = json['SetupID']; setupID = json['SetupID'];
invoiceNo_VP = json['invoiceNo_VP'];
isLiveCareAppointment = json['IsLiveCareAppointment']; isLiveCareAppointment = json['IsLiveCareAppointment'];
// speciality = json['Speciality'].cast<String>(); // speciality = json['Speciality'].cast<String>();
} }
@ -143,6 +146,7 @@ class PatientLabOrders {
data['SetupID'] = this.setupID; data['SetupID'] = this.setupID;
data['Speciality'] = this.speciality; data['Speciality'] = this.speciality;
data['IsLiveCareAppointment'] = this.isLiveCareAppointment; data['IsLiveCareAppointment'] = this.isLiveCareAppointment;
data['invoiceNo_VP'] =this.invoiceNo_VP;
return data; return data;
} }
} }

@ -1,5 +1,6 @@
class RequestPatientLabSpecialResult { class RequestPatientLabSpecialResult {
String invoiceNo; String invoiceNo;
String invoiceNoVP;
String orderNo; String orderNo;
String setupID; String setupID;
String projectID; String projectID;
@ -20,6 +21,7 @@ class RequestPatientLabSpecialResult {
RequestPatientLabSpecialResult( RequestPatientLabSpecialResult(
{this.invoiceNo, {this.invoiceNo,
this.invoiceNoVP,
this.orderNo, this.orderNo,
this.setupID, this.setupID,
this.projectID, this.projectID,
@ -40,6 +42,7 @@ class RequestPatientLabSpecialResult {
RequestPatientLabSpecialResult.fromJson(Map<String, dynamic> json) { RequestPatientLabSpecialResult.fromJson(Map<String, dynamic> json) {
invoiceNo = json['InvoiceNo']; invoiceNo = json['InvoiceNo'];
invoiceNo = json['InvoiceNo_VP'];
orderNo = json['OrderNo']; orderNo = json['OrderNo'];
setupID = json['SetupID']; setupID = json['SetupID'];
projectID = json['ProjectID']; projectID = json['ProjectID'];
@ -62,6 +65,7 @@ class RequestPatientLabSpecialResult {
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = new Map<String, dynamic>();
data['InvoiceNo'] = this.invoiceNo; data['InvoiceNo'] = this.invoiceNo;
data['InvoiceNo_VP'] = this.invoiceNoVP;
data['OrderNo'] = this.orderNo; data['OrderNo'] = this.orderNo;
data['SetupID'] = this.setupID; data['SetupID'] = this.setupID;
data['ProjectID'] = this.projectID; data['ProjectID'] = this.projectID;

@ -23,8 +23,11 @@ class RequestSendLabReportEmail {
String doctorName; String doctorName;
String projectID; String projectID;
String invoiceNo; String invoiceNo;
String invoiceNoVP;
String orderDate; String orderDate;
String orderNo; String orderNo;
bool isDownload;
int doctorID;
RequestSendLabReportEmail( RequestSendLabReportEmail(
{this.versionID, {this.versionID,
@ -51,8 +54,11 @@ class RequestSendLabReportEmail {
this.doctorName, this.doctorName,
this.projectID, this.projectID,
this.invoiceNo, this.invoiceNo,
this.invoiceNoVP,
this.orderDate, this.orderDate,
this.orderNo}); this.orderNo,
this.isDownload,
this.doctorID});
RequestSendLabReportEmail.fromJson(Map<String, dynamic> json) { RequestSendLabReportEmail.fromJson(Map<String, dynamic> json) {
versionID = json['VersionID']; versionID = json['VersionID'];
@ -79,8 +85,11 @@ class RequestSendLabReportEmail {
doctorName = json['DoctorName']; doctorName = json['DoctorName'];
projectID = json['ProjectID']; projectID = json['ProjectID'];
invoiceNo = json['InvoiceNo']; invoiceNo = json['InvoiceNo'];
invoiceNoVP = json['InvoiceNo_VP'];
orderDate = json['OrderDate']; orderDate = json['OrderDate'];
orderNo = json['OrderNo']; orderNo = json['OrderNo'];
isDownload = json['IsDownload'];
doctorID = json['DoctorID'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -109,8 +118,11 @@ class RequestSendLabReportEmail {
data['DoctorName'] = this.doctorName; data['DoctorName'] = this.doctorName;
data['ProjectID'] = this.projectID; data['ProjectID'] = this.projectID;
data['InvoiceNo'] = this.invoiceNo; data['InvoiceNo'] = this.invoiceNo;
data['InvoiceNo_VP'] = this.invoiceNoVP;
data['OrderDate'] = this.orderDate; data['OrderDate'] = this.orderDate;
data['OrderNo'] = this.orderNo; data['OrderNo'] = this.orderNo;
data['IsDownload'] = this.isDownload;
data['DoctorID'] = this.doctorID;
return data; return data;
} }
} }

@ -0,0 +1,15 @@
class VidaPlusProjectListModel {
int projectID;
VidaPlusProjectListModel({this.projectID});
VidaPlusProjectListModel.fromJson(Map<String, dynamic> json) {
projectID = json['ProjectID'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['ProjectID'] = this.projectID;
return data;
}
}

@ -3,9 +3,10 @@ import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
class FinalRadiology { class FinalRadiology {
String setupID; String setupID;
int projectID; int projectID;
Null patientID; dynamic patientID;
int invoiceLineItemNo; int invoiceLineItemNo;
int invoiceNo; int invoiceNo;
dynamic invoiceNo_VP;
int doctorID; int doctorID;
int clinicID; int clinicID;
DateTime orderDate; DateTime orderDate;
@ -49,6 +50,7 @@ class FinalRadiology {
this.patientID, this.patientID,
this.invoiceLineItemNo, this.invoiceLineItemNo,
this.invoiceNo, this.invoiceNo,
this.invoiceNo_VP,
this.doctorID, this.doctorID,
this.clinicID, this.clinicID,
this.orderDate, this.orderDate,
@ -92,6 +94,7 @@ class FinalRadiology {
patientID = json['PatientID']; patientID = json['PatientID'];
invoiceLineItemNo = json['InvoiceLineItemNo']; invoiceLineItemNo = json['InvoiceLineItemNo'];
invoiceNo = json['InvoiceNo']; invoiceNo = json['InvoiceNo'];
invoiceNo_VP = json['InvoiceNo_VP'];
doctorID = json['DoctorID']; doctorID = json['DoctorID'];
clinicID = json['ClinicID']; clinicID = json['ClinicID'];
orderDate = DateUtil.convertStringToDate(json['OrderDate']); orderDate = DateUtil.convertStringToDate(json['OrderDate']);
@ -141,6 +144,7 @@ class FinalRadiology {
data['PatientID'] = this.patientID; data['PatientID'] = this.patientID;
data['InvoiceLineItemNo'] = this.invoiceLineItemNo; data['InvoiceLineItemNo'] = this.invoiceLineItemNo;
data['InvoiceNo'] = this.invoiceNo; data['InvoiceNo'] = this.invoiceNo;
data['InvoiceNo_VP'] = this.invoiceNo_VP;
data['DoctorID'] = this.doctorID; data['DoctorID'] = this.doctorID;
data['ClinicID'] = this.clinicID; data['ClinicID'] = this.clinicID;
data['OrderDate'] = this.orderDate; data['OrderDate'] = this.orderDate;

@ -6,6 +6,7 @@ class RequestSendRadReportEmail {
String doctorName; String doctorName;
String generalid; String generalid;
int invoiceNo; int invoiceNo;
int invoiceNo_VP;
String iPAdress; String iPAdress;
bool isDentalAllowedBackend; bool isDentalAllowedBackend;
int languageID; int languageID;
@ -35,6 +36,7 @@ class RequestSendRadReportEmail {
this.doctorName, this.doctorName,
this.generalid, this.generalid,
this.invoiceNo, this.invoiceNo,
this.invoiceNo_VP,
this.iPAdress, this.iPAdress,
this.isDentalAllowedBackend, this.isDentalAllowedBackend,
this.languageID, this.languageID,
@ -63,6 +65,7 @@ class RequestSendRadReportEmail {
doctorName = json['DoctorName']; doctorName = json['DoctorName'];
generalid = json['generalid']; generalid = json['generalid'];
invoiceNo = json['InvoiceNo']; invoiceNo = json['InvoiceNo'];
invoiceNo_VP = json['InvoiceNo_VP'];
iPAdress = json['IPAdress']; iPAdress = json['IPAdress'];
isDentalAllowedBackend = json['isDentalAllowedBackend']; isDentalAllowedBackend = json['isDentalAllowedBackend'];
languageID = json['LanguageID']; languageID = json['LanguageID'];
@ -94,6 +97,7 @@ class RequestSendRadReportEmail {
data['DoctorName'] = this.doctorName; data['DoctorName'] = this.doctorName;
data['generalid'] = this.generalid; data['generalid'] = this.generalid;
data['InvoiceNo'] = this.invoiceNo; data['InvoiceNo'] = this.invoiceNo;
data['InvoiceNo_VP'] = this.invoiceNo_VP;
data['IPAdress'] = this.iPAdress; data['IPAdress'] = this.iPAdress;
data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; data['isDentalAllowedBackend'] = this.isDentalAllowedBackend;
data['LanguageID'] = this.languageID; data['LanguageID'] = this.languageID;

@ -77,6 +77,7 @@ class BaseAppClient {
body['IPAdress'] = IP_ADDRESS; body['IPAdress'] = IP_ADDRESS;
body['generalid'] = GENERAL_ID; body['generalid'] = GENERAL_ID;
// body['isVidaPlus'] = true;
body['Latitude'] = await AppSharedPreferences().getDouble(USER_LAT); body['Latitude'] = await AppSharedPreferences().getDouble(USER_LAT);
body['Longitude'] = await AppSharedPreferences().getDouble(USER_LONG); body['Longitude'] = await AppSharedPreferences().getDouble(USER_LONG);
@ -149,7 +150,7 @@ class BaseAppClient {
// body['IdentificationNo'] = 1023854217; // body['IdentificationNo'] = 1023854217;
// body['MobileNo'] = "531940021"; // body['MobileNo'] = "531940021";
// body['PatientID'] = 4767370; //3844083 // body['PatientID'] = 2001273; //3844083
// body['TokenID'] = "@dm!n"; // body['TokenID'] = "@dm!n";
// Patient ID: 3027574 // Patient ID: 3027574
@ -158,11 +159,11 @@ class BaseAppClient {
body.removeWhere((key, value) => key == null || value == null); body.removeWhere((key, value) => key == null || value == null);
// if (AppGlobal.isNetworkDebugEnabled) { if (AppGlobal.isNetworkDebugEnabled) {
print("URL : $url"); print("URL : $url");
final jsonBody = json.encode(body); final jsonBody = json.encode(body);
print(jsonBody); print(jsonBody);
// } }
if (await Utils.checkConnection(bypassConnectionCheck: bypassConnectionCheck)) { if (await Utils.checkConnection(bypassConnectionCheck: bypassConnectionCheck)) {
final response = await http.post(Uri.parse(url.trim()), body: json.encode(body), headers: headers); final response = await http.post(Uri.parse(url.trim()), body: json.encode(body), headers: headers);

@ -148,4 +148,5 @@ class AskDoctorService extends BaseService {
}, body: body); }, body: body);
return Future.value(localRes); return Future.value(localRes);
} }
} }

@ -11,6 +11,8 @@ import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.da
class LabsService extends BaseService { class LabsService extends BaseService {
List<PatientLabOrders> patientLabOrdersList = List(); List<PatientLabOrders> patientLabOrdersList = List();
String labReportPDF = "";
Future getPatientLabOrdersList() async { Future getPatientLabOrdersList() async {
hasError = false; hasError = false;
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
@ -32,11 +34,14 @@ class LabsService extends BaseService {
List<LabResult> labResultList = List(); List<LabResult> labResultList = List();
List<LabOrderResult> labOrdersResultsList = List(); List<LabOrderResult> labOrdersResultsList = List();
Future getLaboratoryResult({String projectID, int clinicID, String invoiceNo, String orderNo, String setupID}) async { Future getLaboratoryResult({String projectID, int clinicID, String invoiceNo, String orderNo, String setupID, bool isVidaPlus}) async {
hasError = false; hasError = false;
_requestPatientLabSpecialResult.projectID = projectID; _requestPatientLabSpecialResult.projectID = projectID;
_requestPatientLabSpecialResult.clinicID = clinicID; _requestPatientLabSpecialResult.clinicID = clinicID;
_requestPatientLabSpecialResult.invoiceNo = invoiceNo;
_requestPatientLabSpecialResult.invoiceNo = isVidaPlus ? "0" : invoiceNo;
_requestPatientLabSpecialResult.invoiceNoVP = isVidaPlus ? invoiceNo : "0";
_requestPatientLabSpecialResult.orderNo = orderNo; _requestPatientLabSpecialResult.orderNo = orderNo;
_requestPatientLabSpecialResult.setupID = setupID; _requestPatientLabSpecialResult.setupID = setupID;
@ -51,10 +56,11 @@ class LabsService extends BaseService {
}, body: _requestPatientLabSpecialResult.toJson()); }, body: _requestPatientLabSpecialResult.toJson());
} }
Future getPatientLabResult({PatientLabOrders patientLabOrder}) async { Future getPatientLabResult({PatientLabOrders patientLabOrder, bool isVidaPlus}) async {
hasError = false; hasError = false;
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['InvoiceNo'] = patientLabOrder.invoiceNo; body['InvoiceNo_VP'] = isVidaPlus ? patientLabOrder.invoiceNo : "0";
body['InvoiceNo'] = isVidaPlus ? "0" : patientLabOrder.invoiceNo;
body['OrderNo'] = patientLabOrder.orderNo; body['OrderNo'] = patientLabOrder.orderNo;
body['isDentalAllowedBackend'] = false; body['isDentalAllowedBackend'] = false;
body['SetupID'] = patientLabOrder.setupID; body['SetupID'] = patientLabOrder.setupID;
@ -174,7 +180,8 @@ class LabsService extends BaseService {
Future getPatientLabOrdersResults({PatientLabOrders patientLabOrder, String procedure}) async { Future getPatientLabOrdersResults({PatientLabOrders patientLabOrder, String procedure}) async {
hasError = false; hasError = false;
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['InvoiceNo'] = patientLabOrder.invoiceNo; body['InvoiceNo'] = "0";
body['InvoiceNo_VP'] = patientLabOrder.invoiceNo;
body['OrderNo'] = patientLabOrder.orderNo; body['OrderNo'] = patientLabOrder.orderNo;
body['isDentalAllowedBackend'] = false; body['isDentalAllowedBackend'] = false;
body['SetupID'] = patientLabOrder.setupID; body['SetupID'] = patientLabOrder.setupID;
@ -194,9 +201,10 @@ class LabsService extends BaseService {
RequestSendLabReportEmail _requestSendLabReportEmail = RequestSendLabReportEmail(); RequestSendLabReportEmail _requestSendLabReportEmail = RequestSendLabReportEmail();
Future sendLabReportEmail({PatientLabOrders patientLabOrder, AuthenticatedUser userObj}) async { Future sendLabReportEmail({PatientLabOrders patientLabOrder, AuthenticatedUser userObj, bool isVidaPlus, bool isDownload = false}) async {
_requestSendLabReportEmail.projectID = patientLabOrder.projectID; _requestSendLabReportEmail.projectID = patientLabOrder.projectID;
_requestSendLabReportEmail.invoiceNo = patientLabOrder.invoiceNo; _requestSendLabReportEmail.invoiceNo = isVidaPlus ? "0" : patientLabOrder.invoiceNo;
_requestSendLabReportEmail.invoiceNoVP = isVidaPlus ? patientLabOrder.invoiceNo : "0";
_requestSendLabReportEmail.doctorName = patientLabOrder.doctorName; _requestSendLabReportEmail.doctorName = patientLabOrder.doctorName;
_requestSendLabReportEmail.clinicName = patientLabOrder.clinicDescription; _requestSendLabReportEmail.clinicName = patientLabOrder.clinicDescription;
_requestSendLabReportEmail.patientName = userObj.firstName + " " + userObj.lastName; _requestSendLabReportEmail.patientName = userObj.firstName + " " + userObj.lastName;
@ -208,8 +216,15 @@ class LabsService extends BaseService {
_requestSendLabReportEmail.projectName = patientLabOrder.projectName; _requestSendLabReportEmail.projectName = patientLabOrder.projectName;
_requestSendLabReportEmail.setupID = patientLabOrder.setupID; _requestSendLabReportEmail.setupID = patientLabOrder.setupID;
_requestSendLabReportEmail.orderNo = patientLabOrder.orderNo; _requestSendLabReportEmail.orderNo = patientLabOrder.orderNo;
_requestSendLabReportEmail.orderNo = patientLabOrder.orderNo;
_requestSendLabReportEmail.isDownload = isDownload;
_requestSendLabReportEmail.doctorID = patientLabOrder.doctorID;
await baseAppClient.post(SEND_LAB_RESULT_EMAIL, onSuccess: (dynamic response, int statusCode) {}, onFailure: (String error, int statusCode) { await baseAppClient.post(SEND_LAB_RESULT_EMAIL, onSuccess: (dynamic response, int statusCode) {
if (isDownload) {
labReportPDF = response['LabReportsPDFContent'];
}
}, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: _requestSendLabReportEmail.toJson()); }, body: _requestSendLabReportEmail.toJson());

@ -1,7 +1,6 @@
import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/model/radiology/final_radiology.dart'; import 'package:diplomaticquarterapp/core/model/radiology/final_radiology.dart';
import 'package:diplomaticquarterapp/core/model/radiology/request_send_rad_report_email.dart'; import 'package:diplomaticquarterapp/core/model/radiology/request_send_rad_report_email.dart';
import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
@ -9,10 +8,13 @@ class RadiologyService extends BaseService {
List<FinalRadiology> finalRadiologyList = List(); List<FinalRadiology> finalRadiologyList = List();
String url = ''; String url = '';
Future getRadImageURL({int invoiceNo, int lineItem, int projectId}) async { bool isRadiologyVIDAPlus = false;
Future getRadImageURL({int invoiceNo, int lineItem, int projectId, bool isVidaPlus}) async {
hasError = false; hasError = false;
final Map<String, dynamic> body = new Map<String, dynamic>(); final Map<String, dynamic> body = new Map<String, dynamic>();
body['InvoiceNo'] = invoiceNo; body['InvoiceNo'] = isVidaPlus ? "0" : invoiceNo;
body['InvoiceNo_VP'] = isVidaPlus ? invoiceNo : "0";
body['LineItemNo'] = lineItem; body['LineItemNo'] = lineItem;
body['ProjectID'] = projectId; body['ProjectID'] = projectId;
@ -28,9 +30,18 @@ class RadiologyService extends BaseService {
hasError = false; hasError = false;
await baseAppClient.post(GET_PATIENT_ORDERS, onSuccess: (dynamic response, int statusCode) { await baseAppClient.post(GET_PATIENT_ORDERS, onSuccess: (dynamic response, int statusCode) {
finalRadiologyList.clear(); finalRadiologyList.clear();
// response['FinalRadiologyList'].forEach((radiology) {
if (response['FinalRadiologyList'] != null && response['FinalRadiologyList'].length != 0) {
isRadiologyVIDAPlus = false;
response['FinalRadiologyList'].forEach((radiology) { response['FinalRadiologyList'].forEach((radiology) {
finalRadiologyList.add(FinalRadiology.fromJson(radiology)); finalRadiologyList.add(FinalRadiology.fromJson(radiology));
}); });
} else {
isRadiologyVIDAPlus = true;
response['FinalRadiologyListAPI'].forEach((radiology) {
finalRadiologyList.add(FinalRadiology.fromJson(radiology));
});
}
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
@ -56,6 +67,7 @@ class RadiologyService extends BaseService {
_requestSendRadReportEmail.projectID = finalRadiology.projectID; _requestSendRadReportEmail.projectID = finalRadiology.projectID;
_requestSendRadReportEmail.clinicName = finalRadiology.clinicDescription; _requestSendRadReportEmail.clinicName = finalRadiology.clinicDescription;
_requestSendRadReportEmail.invoiceNo = finalRadiology.invoiceNo; _requestSendRadReportEmail.invoiceNo = finalRadiology.invoiceNo;
_requestSendRadReportEmail.invoiceNo_VP = finalRadiology.invoiceNo_VP;
_requestSendRadReportEmail.invoiceLineItemNo = finalRadiology.invoiceLineItemNo; _requestSendRadReportEmail.invoiceLineItemNo = finalRadiology.invoiceLineItemNo;
_requestSendRadReportEmail.setupID = finalRadiology.setupID; _requestSendRadReportEmail.setupID = finalRadiology.setupID;
_requestSendRadReportEmail.doctorName = finalRadiology.doctorName; _requestSendRadReportEmail.doctorName = finalRadiology.doctorName;

@ -29,7 +29,7 @@ class ReportsService extends BaseService {
} }
Future getInPatientReports() async { Future getInPatientReports() async {
RequestReports _requestReportsInpatient = RequestReports(isReport: true, encounterType: 2, requestType: 2, patientOutSA: 0, projectID: 0); RequestReports _requestReportsInpatient = RequestReports(isReport: true, encounterType: 2, requestType: 1, patientOutSA: 0, projectID: 0);
hasError = false; hasError = false;
await baseAppClient.post(REPORTS, onSuccess: (dynamic response, int statusCode) { await baseAppClient.post(REPORTS, onSuccess: (dynamic response, int statusCode) {
inpatientReportsList.clear(); inpatientReportsList.clear();
@ -137,7 +137,7 @@ class ReportsService extends BaseService {
body['ProjectID'] = projectID; body['ProjectID'] = projectID;
body['Remarks'] = ""; body['Remarks'] = "";
body['ProcedureId'] = ""; body['ProcedureId'] = "";
body['RequestType'] = 2; body['RequestType'] = 1;
body['Source'] = 2; body['Source'] = 2;
body['Status'] = 1; body['Status'] = 1;
body['CreatedBy'] = 102; body['CreatedBy'] = 102;

@ -1,19 +1,25 @@
import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/model/privilege/PrivilegeModel.dart'; import 'package:diplomaticquarterapp/core/model/privilege/PrivilegeModel.dart';
import 'package:diplomaticquarterapp/core/model/privilege/VidaPlusProjectListModel.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart';
class PrivilegeService extends BaseService { class PrivilegeService extends BaseService {
List<PrivilegeModel> privilegeModelList = List(); List<PrivilegeModel> privilegeModelList = List();
List<VidaPlusProjectListModel> vidaPlusProjectListModel = List();
Future getPrivilege() async { Future getPrivilege() async {
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['PatientType'] = 4; body['PatientType'] = 4;
await baseAppClient.post(GET_PRIVILEGE, await baseAppClient.post(GET_PRIVILEGE, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
response['ServicePrivilegeList'].forEach((item) { response['ServicePrivilegeList'].forEach((item) {
privilegeModelList.add(PrivilegeModel.fromJson(item)); privilegeModelList.add(PrivilegeModel.fromJson(item));
}); });
if (response['ProjectListVidaPlus'].length != 0) {
response['ProjectListVidaPlus'].forEach((item) {
vidaPlusProjectListModel.add(VidaPlusProjectListModel.fromJson(item));
});
}
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;

@ -20,6 +20,8 @@ class LabsViewModel extends BaseViewModel {
List<LabOrderResult> get labOrdersResultsList => _labsService.labOrdersResultsList; List<LabOrderResult> get labOrdersResultsList => _labsService.labOrdersResultsList;
List<TimeSeriesSales2> timeSeries = []; List<TimeSeriesSales2> timeSeries = [];
String get labReportPDF => _labsService.labReportPDF;
List<PatientLabOrdersList> _patientLabOrdersListClinic = List(); List<PatientLabOrdersList> _patientLabOrdersListClinic = List();
List<PatientLabOrdersList> _patientLabOrdersListHospital = List(); List<PatientLabOrdersList> _patientLabOrdersListHospital = List();
@ -72,9 +74,14 @@ class LabsViewModel extends BaseViewModel {
List<LabResultList> labResultLists = List(); List<LabResultList> labResultLists = List();
getLaboratoryResult({String projectID, int clinicID, String invoiceNo, String orderNo, String setupID}) async { getLaboratoryResult({String projectID, int clinicID, String invoiceNo, String orderNo, String setupID, bool isVidaPlus}) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _labsService.getLaboratoryResult(invoiceNo: invoiceNo, orderNo: orderNo, projectID: projectID, clinicID: clinicID, setupID: setupID); await _labsService.getLaboratoryResult(invoiceNo: invoiceNo,
orderNo: orderNo,
projectID: projectID,
clinicID: clinicID,
setupID: setupID,
isVidaPlus: isVidaPlus);
if (_labsService.hasError) { if (_labsService.hasError) {
error = _labsService.error; error = _labsService.error;
setState(ViewState.Error); setState(ViewState.Error);
@ -83,9 +90,9 @@ class LabsViewModel extends BaseViewModel {
} }
} }
getPatientLabResult({PatientLabOrders patientLabOrder}) async { getPatientLabResult({PatientLabOrders patientLabOrder, bool isVidaPlus}) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _labsService.getPatientLabResult(patientLabOrder: patientLabOrder); await _labsService.getPatientLabResult(patientLabOrder: patientLabOrder, isVidaPlus: isVidaPlus);
if (_labsService.hasError) { if (_labsService.hasError) {
error = _labsService.error; error = _labsService.error;
setState(ViewState.Error); setState(ViewState.Error);
@ -135,11 +142,14 @@ class LabsViewModel extends BaseViewModel {
} }
} }
sendLabReportEmail({PatientLabOrders patientLabOrder, String mes, AuthenticatedUser userObj}) async { sendLabReportEmail({PatientLabOrders patientLabOrder, String mes, AuthenticatedUser userObj, bool isVidaPlus, bool isDownload = false}) async {
await _labsService.sendLabReportEmail(patientLabOrder: patientLabOrder, userObj: userObj); await _labsService.sendLabReportEmail(patientLabOrder: patientLabOrder, userObj: userObj, isVidaPlus: isVidaPlus, isDownload: isDownload);
if (_labsService.hasError) { if (_labsService.hasError) {
error = _labsService.error; error = _labsService.error;
} else } else {
if (isDownload) {} else {
AppToast.showSuccessToast(message: mes); AppToast.showSuccessToast(message: mes);
} }
} }
}
}

@ -18,9 +18,14 @@ class RadiologyViewModel extends BaseViewModel {
List<FinalRadiologyList> get finalRadiologyList => filterType == FilterType.Clinic ? _finalRadiologyListClinic : _finalRadiologyListHospital; List<FinalRadiologyList> get finalRadiologyList => filterType == FilterType.Clinic ? _finalRadiologyListClinic : _finalRadiologyListHospital;
bool _isRadiologyVIDAPlus = false;
bool get isRadiologyVIDAPlus => _isRadiologyVIDAPlus;
void getPatientRadOrders() async { void getPatientRadOrders() async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _radiologyService.getPatientRadOrders(); await _radiologyService.getPatientRadOrders();
_isRadiologyVIDAPlus = _radiologyService.isRadiologyVIDAPlus;
if (_radiologyService.hasError) { if (_radiologyService.hasError) {
error = _radiologyService.error; error = _radiologyService.error;
setState(ViewState.Error); setState(ViewState.Error);
@ -43,9 +48,9 @@ class RadiologyViewModel extends BaseViewModel {
String get radImageURL => _radiologyService.url; String get radImageURL => _radiologyService.url;
getRadImageURL({int invoiceNo, int lineItem, int projectId}) async { getRadImageURL({int invoiceNo, int lineItem, int projectId, bool isVidaPlus}) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _radiologyService.getRadImageURL(invoiceNo: invoiceNo, lineItem: lineItem, projectId: projectId); await _radiologyService.getRadImageURL(invoiceNo: invoiceNo, lineItem: lineItem, projectId: projectId, isVidaPlus: isVidaPlus);
if (_radiologyService.hasError) { if (_radiologyService.hasError) {
error = _radiologyService.error; error = _radiologyService.error;
setState(ViewState.Error); setState(ViewState.Error);

@ -5,6 +5,7 @@ import 'package:diplomaticquarterapp/analytics/google-analytics.dart';
import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/privilege/PrivilegeModel.dart'; import 'package:diplomaticquarterapp/core/model/privilege/PrivilegeModel.dart';
import 'package:diplomaticquarterapp/core/model/privilege/VidaPlusProjectListModel.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/laser_body_parts.dart'; import 'package:diplomaticquarterapp/models/Appointments/laser_body_parts.dart';
@ -15,8 +16,8 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter_datetime_picker/flutter_datetime_picker.dart'; import 'package:flutter_datetime_picker/flutter_datetime_picker.dart';
var isAppArabic = false; var isAppArabic = false;
class ProjectViewModel extends BaseViewModel {
class ProjectViewModel extends BaseViewModel {
GAnalytics get analytics => locator<GAnalytics>(); GAnalytics get analytics => locator<GAnalytics>();
// Platform Bridge // Platform Bridge
@ -40,9 +41,13 @@ class ProjectViewModel extends BaseViewModel {
double _longitude; double _longitude;
RegisterInfoResponse _registerInfo = RegisterInfoResponse(); RegisterInfoResponse _registerInfo = RegisterInfoResponse();
double get latitude => _latitude; double get latitude => _latitude;
double get longitude => _longitude; double get longitude => _longitude;
RegisterInfoResponse get registerInfo => _registerInfo; RegisterInfoResponse get registerInfo => _registerInfo;
dynamic get searchValue => searchvalue; dynamic get searchValue => searchvalue;
Locale get appLocal => _appLocale; Locale get appLocal => _appLocale;
@ -54,9 +59,11 @@ class ProjectViewModel extends BaseViewModel {
bool isLoginChild = false; bool isLoginChild = false;
List<PrivilegeModel> privilegeRootUser = List(); List<PrivilegeModel> privilegeRootUser = List();
List<PrivilegeModel> privilegeChildUser = List(); List<PrivilegeModel> privilegeChildUser = List();
List<VidaPlusProjectListModel> _vidaPlusProjectListModel = List();
List<PrivilegeModel> get privileges => List<PrivilegeModel> get privileges => isLoginChild ? privilegeChildUser : privilegeChildUser;
isLoginChild ? privilegeChildUser : privilegeChildUser;
List<VidaPlusProjectListModel> get vidaPlusProjectList => _vidaPlusProjectListModel;
List<LaserBodyPart> selectedBodyPartList = []; List<LaserBodyPart> selectedBodyPartList = [];
@ -64,9 +71,7 @@ class ProjectViewModel extends BaseViewModel {
ProjectViewModel() { ProjectViewModel() {
loadSharedPrefLanguage(); loadSharedPrefLanguage();
subscription = Connectivity() subscription = Connectivity().onConnectivityChanged.listen((ConnectivityResult result) {
.onConnectivityChanged
.listen((ConnectivityResult result) {
switch (result) { switch (result) {
case ConnectivityResult.wifi: case ConnectivityResult.wifi:
isInternetConnection = true; isInternetConnection = true;
@ -89,8 +94,7 @@ class ProjectViewModel extends BaseViewModel {
} }
Future loadSharedPrefLanguage() async { Future loadSharedPrefLanguage() async {
currentLanguage = currentLanguage = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
_appLocale = Locale(currentLanguage); _appLocale = Locale(currentLanguage);
isAppArabic = _isArabic = currentLanguage == 'ar'; isAppArabic = _isArabic = currentLanguage == 'ar';
notifyListeners(); notifyListeners();
@ -121,6 +125,11 @@ class ProjectViewModel extends BaseViewModel {
notifyListeners(); notifyListeners();
} }
setVidaPlusProjectList(List<VidaPlusProjectListModel> vidaPlusProjectListModelInput) {
_vidaPlusProjectListModel = vidaPlusProjectListModelInput;
notifyListeners();
}
setPrivilege({privilegeList, bool isLoginChild = false}) { setPrivilege({privilegeList, bool isLoginChild = false}) {
List<PrivilegeModel> privilege = List(); List<PrivilegeModel> privilege = List();
@ -166,6 +175,7 @@ class ProjectViewModel extends BaseViewModel {
searchvalue = data; searchvalue = data;
notifyListeners(); notifyListeners();
} }
setRegisterData(RegisterInfoResponse data) { setRegisterData(RegisterInfoResponse data) {
_registerInfo = data; _registerInfo = data;
notifyListeners(); notifyListeners();

@ -19,7 +19,7 @@ class DQIcons {
DQIcons._(); DQIcons._();
static const _kFontFam = 'DQIcons'; static const _kFontFam = 'DQIcons';
static const String _kFontPkg = null; static const Null _kFontPkg = null;
static const IconData blood_pressure = static const IconData blood_pressure =
IconData(0xe800, fontFamily: _kFontFam, fontPackage: _kFontPkg); IconData(0xe800, fontFamily: _kFontFam, fontPackage: _kFontPkg);

@ -36,16 +36,16 @@ class MyApp extends StatefulWidget {
@override @override
_MyApp createState() => new _MyApp(); _MyApp createState() => new _MyApp();
} }
class MyHttpOverrides extends HttpOverrides{ class MyHttpOverrides extends HttpOverrides{
@override @override
HttpClient createHttpClient(SecurityContext context) { HttpClient createHttpClient(SecurityContext? context){
return super.createHttpClient(context)..badCertificateCallback = (X509Certificate cert, String host, int port) => true; return super.createHttpClient(context)
..badCertificateCallback = (X509Certificate cert, String host, int port)=> true;
} }
} }
class _MyApp extends State<MyApp> { class _MyApp extends State<MyApp> {
AppUpdateInfo _updateInfo; late AppUpdateInfo _updateInfo;
final GlobalKey<NavigatorState> navigatorKey = GlobalKey<NavigatorState>(); final GlobalKey<NavigatorState> navigatorKey = GlobalKey<NavigatorState>();
@ -70,7 +70,7 @@ class _MyApp extends State<MyApp> {
// var font = projectProvider.isArabic ? 'Cairo' : 'WorkSans'; // var font = projectProvider.isArabic ? 'Cairo' : 'WorkSans';
// Re-enable once going live // Re-enable once going live
if (Platform.isAndroid) checkForUpdate(); // if (Platform.isAndroid) checkForUpdate();
ThemeNotifier(defaultTheme()); ThemeNotifier(defaultTheme());
super.initState(); super.initState();
@ -121,10 +121,10 @@ class _MyApp extends State<MyApp> {
], ],
child: Consumer<ProjectViewModel>( child: Consumer<ProjectViewModel>(
builder: (context, projectProvider, child) => MaterialApp( builder: (context, projectProvider, child) => MaterialApp(
builder: (BuildContext context, Widget child) { builder: (_, __) {
return MediaQuery( return MediaQuery(
data: MediaQuery.of(context).copyWith(textScaleFactor: 1.0,), //set desired text scale factor here data: MediaQuery.of(context).copyWith(textScaleFactor: 1.0,), //set desired text scale factor here
child: child, child: child ?? SizedBox(),
); );
}, },
navigatorKey: locator<NavigationService>().navigatorKey, navigatorKey: locator<NavigationService>().navigatorKey,

@ -1,6 +1,6 @@
class AncillaryOrdersListModel { class AncillaryOrdersListModel {
List<AncillaryOrderList> ancillaryOrderList; List<AncillaryOrderList> ancillaryOrderList;
Null errCode; dynamic errCode;
String message; String message;
int patientID; int patientID;
String patientName; String patientName;
@ -32,7 +32,7 @@ class AncillaryOrdersListModel {
errCode = json['ErrCode']; errCode = json['ErrCode'];
message = json['Message']; message = json['Message'];
patientID = json['PatientID']; patientID = json['PatientID'];
patientName = json['PatientName']; patientName = json['PatientName'] != null ? json['PatientName'] : "";
patientType = json['PatientType']; patientType = json['PatientType'];
projectID = json['ProjectID']; projectID = json['ProjectID'];
projectName = json['ProjectName']; projectName = json['ProjectName'];
@ -83,7 +83,7 @@ class AncillaryOrderList {
appointmentDate = json['AppointmentDate']; appointmentDate = json['AppointmentDate'];
appointmentNo = json['AppointmentNo']; appointmentNo = json['AppointmentNo'];
clinicID = json['ClinicID']; clinicID = json['ClinicID'];
clinicName = json['ClinicName']; clinicName = json['ClinicName'] != null ? json['ClinicName'] : "";
doctorID = json['DoctorID']; doctorID = json['DoctorID'];
doctorName = json['DoctorName']; doctorName = json['DoctorName'];
orderDate = json['OrderDate']; orderDate = json['OrderDate'];

@ -0,0 +1,18 @@
class AncillaryOrdersProcedureList {
int procedureID;
String procedureDescription;
AncillaryOrdersProcedureList({this.procedureID, this.procedureDescription});
AncillaryOrdersProcedureList.fromJson(Map<String, dynamic> json) {
procedureID = json['ProcedureID'];
procedureDescription = json['ProcedureDescription'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['ProcedureID'] = this.procedureID;
data['ProcedureDescription'] = this.procedureDescription;
return data;
}
}

@ -10,7 +10,7 @@ class TamaraRequestModel {
String customerEmail; String customerEmail;
String orderDescription; String orderDescription;
bool isInstallment; bool isInstallment;
int projectID; num projectID;
String accessCode; String accessCode;
String sHARequestPhase; String sHARequestPhase;
String sHAResponsePhase; String sHAResponsePhase;

@ -7,6 +7,7 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.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/anicllary-orders/ancillary_order_proc_model.dart'; import 'package:diplomaticquarterapp/models/anicllary-orders/ancillary_order_proc_model.dart';
import 'package:diplomaticquarterapp/models/anicllary-orders/ancillary_orders_proc_list.dart';
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/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
@ -571,7 +572,6 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
} else { } else {
checkPaymentStatus(appo); checkPaymentStatus(appo);
} }
} }
checkTamaraPaymentStatus(String orderID, AppoitmentAllHistoryResultList appo) { checkTamaraPaymentStatus(String orderID, AppoitmentAllHistoryResultList appo) {
@ -633,18 +633,21 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
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( // List<AncillaryOrdersProcedureList> ancillaryOrdersProcedureList = [];
appo, // selectedProcList.forEach((element) {
widget.projectID.toString(), // ancillaryOrdersProcedureList.add(new AncillaryOrdersProcedureList(procedureID: num.parse(element.procedureID), procedureDescription: element.procedureName));
res['Amount'], // });
res['Fort_id'], service.HIS_createAdvancePayment(appo, widget.projectID.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], projectViewModel.user.patientType,
res['PaymentMethod'], projectViewModel.user.firstName + " " + projectViewModel.user.lastName, projectViewModel.user.patientID, localContext,
projectViewModel.user.patientType, isAncillaryOrder: true)
projectViewModel.user.firstName + " " + projectViewModel.user.lastName,
projectViewModel.user.patientID,
localContext)
.then((res) { .then((res) {
addAdvancedNumberRequest(res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), paymentReference, 0, appo); addAdvancedNumberRequest(
Utils.isVidaPlusProject(projectViewModel, widget.projectID)
? res['OnlineCheckInAppointments'][0]['AdvanceNumber_VP'].toString()
: res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(),
paymentReference,
0,
appo);
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(localContext); GifLoaderDialogUtils.hideDialog(localContext);
AppToast.showErrorToast(message: err); AppToast.showErrorToast(message: err);
@ -665,7 +668,6 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
autoGenerateInvoice() { autoGenerateInvoice() {
List<dynamic> selectedProcListAPI = []; List<dynamic> selectedProcListAPI = [];
Map<dynamic, dynamic> selectedProcListAPIMap;
selectedProcList.forEach((element) { selectedProcList.forEach((element) {
selectedProcListAPI.add({ selectedProcListAPI.add({

@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/my_balance/AdvanceModel.dart'; import 'package:diplomaticquarterapp/core/model/my_balance/AdvanceModel.dart';
import 'package:diplomaticquarterapp/core/model/my_balance/patient_info_and_mobile_number.dart'; import 'package:diplomaticquarterapp/core/model/my_balance/patient_info_and_mobile_number.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.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/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
@ -20,6 +21,7 @@ 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 'package:flutter_svg/flutter_svg.dart';
import 'package:provider/provider.dart';
import 'dialogs/ConfirmSMSDialog.dart'; import 'dialogs/ConfirmSMSDialog.dart';
import 'new_text_Field.dart'; import 'new_text_Field.dart';
@ -31,11 +33,13 @@ class ConfirmPaymentPage extends StatelessWidget {
MyInAppBrowser browser; MyInAppBrowser browser;
AuthenticatedUser authenticatedUser; AuthenticatedUser authenticatedUser;
AppSharedPreferences sharedPref = AppSharedPreferences(); AppSharedPreferences sharedPref = AppSharedPreferences();
ProjectViewModel projectViewModel;
ConfirmPaymentPage({this.advanceModel, this.patientInfoAndMobileNumber, this.selectedPaymentMethod, this.authenticatedUser}); ConfirmPaymentPage({this.advanceModel, this.patientInfoAndMobileNumber, this.selectedPaymentMethod, this.authenticatedUser});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
void showSMSDialog() { void showSMSDialog() {
showDialog( showDialog(
context: context, context: context,
@ -250,8 +254,13 @@ class ConfirmPaymentPage extends StatelessWidget {
GifLoaderDialogUtils.showMyDialog(AppGlobal.context); GifLoaderDialogUtils.showMyDialog(AppGlobal.context);
service.createAdvancePayment(appo, appo.projectID.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], AppGlobal.context).then((res) { service.createAdvancePayment(appo, appo.projectID.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], AppGlobal.context).then((res) {
GifLoaderDialogUtils.hideDialog(AppGlobal.context); GifLoaderDialogUtils.hideDialog(AppGlobal.context);
print(res['OnlineCheckInAppointments'][0]['AdvanceNumber']); addAdvancedNumberRequest(
addAdvancedNumberRequest(res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), paymentReference, appo.appointmentNo.toString(), appo); Utils.isVidaPlusProject(projectViewModel, appo.projectID)
? res['OnlineCheckInAppointments'][0]['AdvanceNumber_VP'].toString()
: res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(),
paymentReference,
appo.appointmentNo.toString(),
appo);
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(AppGlobal.context); GifLoaderDialogUtils.hideDialog(AppGlobal.context);
AppToast.showErrorToast(message: err); AppToast.showErrorToast(message: err);

@ -59,6 +59,10 @@ class _BookConfirmState extends State<BookConfirm> {
AppSharedPreferences sharedPref = new AppSharedPreferences(); AppSharedPreferences sharedPref = new AppSharedPreferences();
bool isInsured = false;
bool isEligible = false;
bool isCash = false;
@override @override
void initState() { void initState() {
// widget.authUser = new AuthenticatedUser(); // widget.authUser = new AuthenticatedUser();
@ -331,9 +335,9 @@ class _BookConfirmState extends State<BookConfirm> {
AppToast.showSuccessToast(message: TranslationBase.of(context).bookedSuccess); AppToast.showSuccessToast(message: TranslationBase.of(context).bookedSuccess);
Future.delayed(new Duration(milliseconds: 500), () { Future.delayed(new Duration(milliseconds: 500), () {
checkPatientNphiesEligibility(docObject, res['AppointmentNo'], context); // checkPatientNphiesEligibility(docObject, res['AppointmentNo'], context);
// getPatientShare(context, res['AppointmentNo'], docObject.clinicID, docObject.projectID, docObject); getToDoCount();
// getToDoCount(); getPatientShare(context, res['AppointmentNo'], docObject.clinicID, docObject.projectID, docObject);
}); });
widget.service.logDoctorFreeSlots(docObject.doctorID, docObject.clinicID, docObject.projectID, decodedLogs, res['AppointmentNo'], context).then((res) { widget.service.logDoctorFreeSlots(docObject.doctorID, docObject.clinicID, docObject.projectID, decodedLogs, res['AppointmentNo'], context).then((res) {
@ -437,13 +441,40 @@ class _BookConfirmState extends State<BookConfirm> {
} }
getPatientShare(context, String appointmentNo, int clinicID, int projectID, DoctorList docObject) { getPatientShare(context, String appointmentNo, int clinicID, int projectID, DoctorList docObject) {
String errorMsg = "";
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
widget.service.getPatientShare(appointmentNo, clinicID, projectID, context).then((res) { widget.service.getPatientShare(appointmentNo, clinicID, projectID, context).then((res) {
projectViewModel.selectedBodyPartList.clear(); projectViewModel.selectedBodyPartList.clear();
projectViewModel.laserSelectionDuration = 0; projectViewModel.laserSelectionDuration = 0;
print(res); print(res);
widget.patientShareResponse = new PatientShareResponse.fromJson(res); widget.patientShareResponse = new PatientShareResponse.fromJson(res['OnlineCheckInAppointments'][0]);
isInsured = res["IsInsured"];
isEligible = res["IsEligible"];
isCash = res["IsCash"];
if (isCash) {
navigateToBookSuccess(context, docObject, widget.patientShareResponse); navigateToBookSuccess(context, docObject, widget.patientShareResponse);
} else {
if (isInsured && isEligible) {
navigateToBookSuccess(context, docObject, widget.patientShareResponse);
} else {
if (isInsured && !isEligible) {
errorMsg = TranslationBase.of(context).invalidEligibility;
} else {
errorMsg = TranslationBase.of(context).invalidInsurance;
}
ConfirmDialog dialog = new ConfirmDialog(
isDissmissable: false,
context: context,
confirmMessage: errorMsg,
okText: TranslationBase.of(context).updateInsuranceText,
cancelText: TranslationBase.of(context).continueCash,
okFunction: () => {openUpdateInsurance()},
cancelFunction: () => {continueAsCash(docObject, appointmentNo)});
dialog.showAlertDialog(context);
}
}
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
// AppToast.showErrorToast(message: err); // AppToast.showErrorToast(message: err);

@ -1,6 +1,5 @@
import 'dart:io'; import 'dart:io';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
@ -46,6 +45,7 @@ class BookSuccess extends StatefulWidget {
class _BookSuccessState extends State<BookSuccess> { class _BookSuccessState extends State<BookSuccess> {
AppSharedPreferences sharedPref = AppSharedPreferences(); AppSharedPreferences sharedPref = AppSharedPreferences();
// AuthenticatedUser authUser; // AuthenticatedUser authUser;
ProjectViewModel projectViewModel; ProjectViewModel projectViewModel;
@ -775,7 +775,13 @@ class _BookSuccessState extends State<BookSuccess> {
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
String paymentReference = res['Fort_id'].toString(); String paymentReference = res['Fort_id'].toString();
service.createAdvancePayment(appo, appo.projectID.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], context).then((res) { service.createAdvancePayment(appo, appo.projectID.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], context).then((res) {
addAdvancedNumberRequest(res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), paymentReference, appo.appointmentNo.toString(), appo); addAdvancedNumberRequest(
Utils.isVidaPlusProject(projectViewModel, appo.projectID)
? res['OnlineCheckInAppointments'][0]['AdvanceNumber_VP'].toString()
: res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(),
paymentReference,
appo.appointmentNo.toString(),
appo);
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err); AppToast.showErrorToast(message: err);

@ -609,6 +609,8 @@ class _SearchByClinicState extends State<SearchByClinic> {
result = LinkedHashSet<String>.from(arr).toList(); result = LinkedHashSet<String>.from(arr).toList();
numAll = result.length; numAll = result.length;
nearestAppo = false;
isProjectLoaded = false;
navigateToSearchResults(context, doctorsList, _patientDoctorAppointmentListHospital); navigateToSearchResults(context, doctorsList, _patientDoctorAppointmentListHospital);
} else { } else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']); AppToast.showErrorToast(message: res['ErrorEndUserMessage']);

@ -126,7 +126,7 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
value: item, value: item,
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [Text(item.projectName), getCovidTestTypeImage(item)], children: [Text(item.projectName ?? ""), getCovidTestTypeImage(item)],
), ),
); );
}).toList(), }).toList(),

@ -402,8 +402,12 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
String paymentReference = res['Fort_id'].toString(); String paymentReference = res['Fort_id'].toString();
service.createAdvancePayment(appo, appo.projectID.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], context).then((res) { service.createAdvancePayment(appo, appo.projectID.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], context).then((res) {
print(res['OnlineCheckInAppointments'][0]['AdvanceNumber']); addAdvancedNumberRequest(
addAdvancedNumberRequest(res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), paymentReference, appo.appointmentNo.toString()); Utils.isVidaPlusProject(projectViewModel, appo.projectID)
? res['OnlineCheckInAppointments'][0]['AdvanceNumber_VP'].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);

@ -79,6 +79,10 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
bool dataLoaded = false; bool dataLoaded = false;
bool isInsured = false;
bool isEligible = false;
bool isCash = false;
@override @override
void initState() { void initState() {
widget.patientShareResponse = new PatientShareResponse(); widget.patientShareResponse = new PatientShareResponse();
@ -543,8 +547,8 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
confirmAppointment(appo); confirmAppointment(appo);
break; break;
case 20: case 20:
// getPatientShare(context, appo); getPatientShare(context, appo);
checkPatientNphiesEligibility(context, appo); // checkPatientNphiesEligibility(context, appo);
break; break;
case 30: case 30:
getAppoQR(context, appo); getAppoQR(context, appo);
@ -889,6 +893,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
} }
getPatientShare(context, AppoitmentAllHistoryResultList appo) { getPatientShare(context, AppoitmentAllHistoryResultList appo) {
String errorMsg = "";
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
if (appo.isLiveCareAppointment) { if (appo.isLiveCareAppointment) {
getLiveCareAppointmentPatientShare(context, service, appo); getLiveCareAppointmentPatientShare(context, service, appo);
@ -896,8 +901,33 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
service.getPatientShare(appo.appointmentNo.toString(), appo.clinicID, appo.projectID, context).then((res) { service.getPatientShare(appo.appointmentNo.toString(), appo.clinicID, appo.projectID, context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
widget.patientShareResponse = new PatientShareResponse.fromJson(res); widget.patientShareResponse = new PatientShareResponse.fromJson(res['OnlineCheckInAppointments'][0]);
isInsured = res["IsInsured"];
isEligible = res["IsEligible"];
isCash = res["IsCash"];
if (isCash) {
openPaymentDialog(appo, widget.patientShareResponse); openPaymentDialog(appo, widget.patientShareResponse);
} else {
if (isInsured && isEligible) {
openPaymentDialog(appo, widget.patientShareResponse);
} else {
if (isInsured && !isEligible) {
errorMsg = TranslationBase.of(context).invalidEligibility;
} else {
errorMsg = TranslationBase.of(context).invalidInsurance;
}
ConfirmDialog dialog = new ConfirmDialog(
isDissmissable: false,
context: context,
confirmMessage: errorMsg,
okText: TranslationBase.of(context).updateInsuranceText,
cancelText: TranslationBase.of(context).continueCash,
okFunction: () => {openUpdateInsurance()},
cancelFunction: () => {continueAsCash(appo)});
dialog.showAlertDialog(context);
}
}
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err); AppToast.showErrorToast(message: err);
@ -1181,7 +1211,14 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
String paymentReference = res['Fort_id'].toString(); String paymentReference = res['Fort_id'].toString();
service.createAdvancePayment(appo, appo.projectID.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], context).then((res) { service.createAdvancePayment(appo, appo.projectID.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
addAdvancedNumberRequest(res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), paymentReference, appo.appointmentNo.toString(), appo, res['OnlineCheckInAppointments'][0]); addAdvancedNumberRequest(
Utils.isVidaPlusProject(projectViewModel, appo.projectID)
? res['OnlineCheckInAppointments'][0]['AdvanceNumber_VP'].toString()
: res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(),
paymentReference,
appo.appointmentNo.toString(),
appo,
res['OnlineCheckInAppointments'][0]);
}).catchError((err) { }).catchError((err) {
print(err); print(err);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);

@ -218,17 +218,17 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
inputWidget(TranslationBase.of(context).subject, "", titleController), inputWidget(TranslationBase.of(context).subject, "", titleController),
SizedBox(height: 12), SizedBox(height: 12),
inputWidget(TranslationBase.of(context).message, "", messageController, lines: 11, suffixTap: () async { inputWidget(TranslationBase.of(context).message, "", messageController, lines: 11, suffixTap: () async {
// if (Platform.isAndroid) { if (Platform.isAndroid) {
// if (await PermissionService.isMicrophonePermissionEnabled()) { if (await PermissionService.isMicrophonePermissionEnabled()) {
// openSpeechReco(); openSpeechReco();
// } else { } else {
// Utils.showPermissionConsentDialog(context, TranslationBase.of(context).recordAudioPermission, () { Utils.showPermissionConsentDialog(context, TranslationBase.of(context).recordAudioPermission, () {
// openSpeechReco(); openSpeechReco();
// }); });
// } }
// } else { } else {
// openSpeechReco(); openSpeechReco();
// } }
}), }),
SizedBox(height: 12), SizedBox(height: 12),
InkWell( InkWell(
@ -340,7 +340,7 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
}); });
} }
}, },
color: (titleController.text.toString().isEmpty || messageController.text.toString().isEmpty) ? Color(0xffEAEAEA) : Color(0xffD02127), color: Color(0xffD02127),
textColor: Colors.white, textColor: Colors.white,
disabledColor: Color(0xffEAEAEA), disabledColor: Color(0xffEAEAEA),
), ),
@ -405,8 +405,8 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
color: Color(0xff575757), color: Color(0xff575757),
letterSpacing: -0.56, letterSpacing: -0.56,
), ),
// suffixIconConstraints: BoxConstraints(minWidth: 50), suffixIconConstraints: BoxConstraints(minWidth: 50),
// suffixIcon: suffixTap == null ? null : IconButton(icon: Icon(Icons.mic, color: Color(0xff2E303A)), onPressed: suffixTap), suffixIcon: suffixTap == null ? null : IconButton(icon: Icon(Icons.mic, color: Color(0xff2E303A)), onPressed: suffixTap),
contentPadding: EdgeInsets.zero, contentPadding: EdgeInsets.zero,
border: InputBorder.none, border: InputBorder.none,
focusedBorder: InputBorder.none, focusedBorder: InputBorder.none,
@ -517,9 +517,9 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
return; return;
} }
// openSpeechReco() async { openSpeechReco() async {
// new RoboSearch(context: context).showAlertDialog(context); new RoboSearch(context: context).showAlertDialog(context);
// _currentLocaleId = TranslationBase.of(AppGlobal.context).locale.languageCode; _currentLocaleId = TranslationBase.of(AppGlobal.context).locale.languageCode;
// bool available = await speech.initialize(onStatus: statusListener, onError: errorListener); // bool available = await speech.initialize(onStatus: statusListener, onError: errorListener);
// if (available) { // if (available) {
// speech.listen( // speech.listen(
@ -530,11 +530,11 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
// } else { // } else {
// print("The user has denied the use of speech recognition."); // print("The user has denied the use of speech recognition.");
// } // }
// } }
//
// void errorListener(SpeechRecognitionError error) { // void errorListener(SpeechRecognitionError error) {
// event.setValue({"searchText": 'null'}); // event.setValue({"searchText": 'null'});
// //SpeechToText.closeAlertDialog(context); // SpeechToText.closeAlertDialog(context);
// print(error); // print(error);
// } // }
@ -561,9 +561,9 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
} }
} }
// Future<void> initSpeechState() async { Future<void> initSpeechState() async {
// bool hasSpeech = await speech.initialize(onError: errorListener, onStatus: statusListener); // bool hasSpeech = await speech.initialize(onError: errorListener, onStatus: statusListener);
// print(hasSpeech); // print(hasSpeech);
// if (!mounted) return; // if (!mounted) return;
// } }
} }

@ -132,7 +132,15 @@ class _AttachInsuranceCardImageDialogState extends State<AttachInsuranceCardImag
), ),
Padding( Padding(
padding: const EdgeInsets.all(18.0), padding: const EdgeInsets.all(18.0),
child: DefaultButton( child:
// Text(TranslationBase.of(context).habibCallCenter,
// style: TextStyle(
// fontSize: 16,
// letterSpacing: -0.48,
// fontWeight: FontWeight.w600,
// ),
// ),
DefaultButton(
TranslationBase.of(context).updateInsuranceManually, TranslationBase.of(context).updateInsuranceManually,
() { () {
Navigator.pop(context); Navigator.pop(context);

@ -184,6 +184,9 @@ class InsurancePage extends StatelessWidget {
void updateManually(BuildContext context, String errorMsg, String patientIdentificationID, int patientID, String mobileNumber) { void updateManually(BuildContext context, String errorMsg, String patientIdentificationID, int patientID, String mobileNumber) {
ConfirmDialog dialog = new ConfirmDialog( ConfirmDialog dialog = new ConfirmDialog(
context: context, context: context,
// confirmMessage: errorMsg + ". " + TranslationBase.of(context).habibCallCenter,
// okText: TranslationBase.of(context).ok,
// cancelText: TranslationBase.of(context).cancel,
confirmMessage: errorMsg + ". " + TranslationBase.of(context).updateInsuranceManuallyDialog, confirmMessage: errorMsg + ". " + TranslationBase.of(context).updateInsuranceManuallyDialog,
okText: TranslationBase.of(context).yes, okText: TranslationBase.of(context).yes,
cancelText: TranslationBase.of(context).no, cancelText: TranslationBase.of(context).no,
@ -196,7 +199,9 @@ class InsurancePage extends StatelessWidget {
patientIdentificationNo: patientIdentificationID, patientIdentificationNo: patientIdentificationID,
patientID: patientID, patientID: patientID,
patientMobileNumber: mobileNumber, patientMobileNumber: mobileNumber,
))) ),
),
),
}, },
cancelFunction: () => {}); cancelFunction: () => {});
dialog.showAlertDialog(context); dialog.showAlertDialog(context);

@ -256,7 +256,7 @@ class _Login extends State<Login> {
sharedPref.setObject(REGISTER_DATA_FOR_REGISTER, request); sharedPref.setObject(REGISTER_DATA_FOR_REGISTER, request);
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
authService.checkPatientAuthentication(request).then((value) { authService.checkPatientAuthentication(request).then((value) {
if (value['UserAccountIsActivated']) { // if (value['UserAccountIsActivated']) {
if (value['isSMSSent']) { if (value['isSMSSent']) {
sharedPref.setString(LOGIN_TOKEN_ID, value['LogInTokenID']); sharedPref.setString(LOGIN_TOKEN_ID, value['LogInTokenID']);
sharedPref.setObject(REGISTER_DATA_FOR_LOGIIN, request); sharedPref.setObject(REGISTER_DATA_FOR_LOGIIN, request);
@ -267,17 +267,17 @@ class _Login extends State<Login> {
this.checkActivationCode(); this.checkActivationCode();
} }
} }
} else { // } else {
ConfirmDialog activationDialog = new ConfirmDialog( // ConfirmDialog activationDialog = new ConfirmDialog(
context: context, // context: context,
confirmMessage: TranslationBase.of(context).accountDeactivatedMsg, // confirmMessage: TranslationBase.of(context).accountDeactivatedMsg,
okText: TranslationBase.of(context).yes, // okText: TranslationBase.of(context).yes,
cancelText: TranslationBase.of(context).no, // cancelText: TranslationBase.of(context).no,
okFunction: () => {ConfirmDialog.closeAlertDialog(context), this.activatePatientFile()}, // okFunction: () => {ConfirmDialog.closeAlertDialog(context), this.activatePatientFile()},
cancelFunction: () => {}); // cancelFunction: () => {});
GifLoaderDialogUtils.hideDialog(context); // GifLoaderDialogUtils.hideDialog(context);
activationDialog.showAlertDialog(context); // activationDialog.showAlertDialog(context);
} // }
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
ConfirmDialog dialog = new ConfirmDialog( ConfirmDialog dialog = new ConfirmDialog(

@ -60,6 +60,7 @@ class AskDoctorPage extends StatelessWidget {
itemBuilder: (context, _index) { itemBuilder: (context, _index) {
DoctorList _doctor = _doctorList[_index]; DoctorList _doctor = _doctorList[_index];
DoctorList doctorList = DoctorList( DoctorList doctorList = DoctorList(
date: _doctor.date,
projectID: _doctor.projectID, projectID: _doctor.projectID,
setupID: _doctor.setupID, setupID: _doctor.setupID,
clinicID: _doctor.clinicID, clinicID: _doctor.clinicID,

@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/core/viewModels/medical/ask_doctor_view_mod
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/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.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';
@ -27,7 +28,7 @@ class DoctorResponse extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
SizedBox( SizedBox(
height: 65, height: 16,
), ),
AppExpandableNotifier( AppExpandableNotifier(
headerWidget: Padding( headerWidget: Padding(
@ -61,6 +62,7 @@ class DoctorResponse extends StatelessWidget {
return InkWell( return InkWell(
onTap: () { onTap: () {
///go to page ViewDoctorResponsesPage ///go to page ViewDoctorResponsesPage
if (doctor.transactions != null && doctor.transactions.isNotEmpty) {
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
@ -69,6 +71,9 @@ class DoctorResponse extends StatelessWidget {
), ),
), ),
); );
} else {
Utils.showErrorToast("There are no doctor responses for this request.");
}
}, },
child: Container( child: Container(
height: 100, height: 100,

@ -468,7 +468,13 @@ class _ConfirmPaymentPageState extends State<ConfirmPaymentPage> {
service.HIS_createAdvancePayment(appo, widget.advanceModel.hospitalsModel.iD.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], widget.patientInfoAndMobileNumber.patientType, service.HIS_createAdvancePayment(appo, widget.advanceModel.hospitalsModel.iD.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], widget.patientInfoAndMobileNumber.patientType,
widget.advanceModel.patientName, widget.advanceModel.fileNumber, AppGlobal.context) widget.advanceModel.patientName, widget.advanceModel.fileNumber, AppGlobal.context)
.then((res) { .then((res) {
addAdvancedNumberRequest(res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), paymentReference, 0, appo); addAdvancedNumberRequest(
Utils.isVidaPlusProject(projectViewModel, widget.advanceModel.hospitalsModel.iD)
? res['OnlineCheckInAppointments'][0]['AdvanceNumber_VP'].toString()
: 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);

@ -106,7 +106,7 @@ class MyBalancePage extends StatelessWidget {
), ),
), ),
Text( Text(
TranslationBase.of(context).sar, projectViewModel.user.outSA == 1 ? TranslationBase.of(context).aed : TranslationBase.of(context).sar,
style: TextStyle( style: TextStyle(
fontSize: 16, fontSize: 16,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
@ -157,7 +157,7 @@ class MyBalancePage extends StatelessWidget {
), ),
), ),
Text( Text(
amount.toStringAsFixed(2) + " " + TranslationBase.of(context).sar, amount.toStringAsFixed(2) + " " + (projectViewModel.user.outSA == 1 ? TranslationBase.of(context).aed : TranslationBase.of(context).sar),
style: TextStyle( style: TextStyle(
fontSize: 16, fontSize: 16,
letterSpacing: -0.64, letterSpacing: -0.64,

@ -1,13 +1,22 @@
import 'dart:convert';
import 'dart:io';
import 'dart:typed_data';
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/medical/labs_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/labs_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/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/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/data_display/medical/LabResult/laboratory_result_widget.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/LabResult/laboratory_result_widget.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:open_filex/open_filex.dart';
import 'package:path_provider/path_provider.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class LaboratoryResultPage extends StatefulWidget { class LaboratoryResultPage extends StatefulWidget {
@ -29,7 +38,9 @@ class _LaboratoryResultPageState extends State<LaboratoryResultPage> {
clinicID: widget.patientLabOrders.clinicID, clinicID: widget.patientLabOrders.clinicID,
projectID: widget.patientLabOrders.projectID, projectID: widget.patientLabOrders.projectID,
orderNo: widget.patientLabOrders.orderNo, orderNo: widget.patientLabOrders.orderNo,
setupID: widget.patientLabOrders.setupID), setupID: widget.patientLabOrders.setupID,
isVidaPlus: Utils.isVidaPlusProject(projectViewModel, num.parse(widget.patientLabOrders.projectID)),
),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
appBarTitle: widget.patientLabOrders.doctorName, appBarTitle: widget.patientLabOrders.doctorName,
@ -37,13 +48,17 @@ class _LaboratoryResultPageState extends State<LaboratoryResultPage> {
showNewAppBar: true, showNewAppBar: true,
showNewAppBarTitle: true, showNewAppBarTitle: true,
backgroundColor: Color(0xffF8F8F8), backgroundColor: Color(0xffF8F8F8),
body: ListView.builder( body: SingleChildScrollView(
child: Column(
children: [
ListView.builder(
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
shrinkWrap: true,
padding: EdgeInsets.only(bottom: 12), padding: EdgeInsets.only(bottom: 12),
itemBuilder: (context, index) => LaboratoryResultWidget( itemBuilder: (context, index) => LaboratoryResultWidget(
onTap: () async { onTap: () async {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await model.sendLabReportEmail(patientLabOrder: widget.patientLabOrders, mes: TranslationBase.of(context).sendSuc, userObj: projectViewModel.user); await model.sendLabReportEmail(patientLabOrder: widget.patientLabOrders, mes: TranslationBase.of(context).sendSuc, userObj: projectViewModel.user, isVidaPlus: Utils.isVidaPlusProject(projectViewModel, num.parse(widget.patientLabOrders.projectID)));
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
}, },
billNo: widget.patientLabOrders.invoiceNo, billNo: widget.patientLabOrders.invoiceNo,
@ -54,10 +69,52 @@ class _LaboratoryResultPageState extends State<LaboratoryResultPage> {
), ),
itemCount: 1, itemCount: 1,
), ),
SizedBox(
height: 120.0,
)
],
),
),
// bottomSheet: Container(
// color: Colors.white,
// height: MediaQuery.of(context).size.height * 0.081,
// width: double.infinity,
// padding: EdgeInsets.all(12.0),
// child: Column(
// children: <Widget>[
// Container(
// width: MediaQuery.of(context).size.width * 0.9,
// child: DefaultButton(
// TranslationBase.of(context).downloadReport,
// () async {
// GifLoaderDialogUtils.showMyDialog(context);
// await model.sendLabReportEmail(patientLabOrder: widget.patientLabOrders, mes: TranslationBase.of(context).sendSuc, userObj: projectViewModel.user, isVidaPlus: Utils.isVidaPlusProject(projectViewModel, num.parse(widget.patientLabOrders.projectID)), isDownload: true);
// GifLoaderDialogUtils.hideDialog(context);
// try {
// String path = await _createFileFromString(model.labReportPDF, "pdf");
// OpenFilex.open(path);
// } catch (ex) {
// AppToast.showErrorToast(message: "Cannot open file.");
// }
// },
// textColor: Colors.white,
// ),
// ),
// ],
// ),
// ),
), ),
); );
} }
Future<String> _createFileFromString(String encodedStr, String ext) async {
Uint8List bytes = base64.decode(encodedStr);
String dir = (await getApplicationDocumentsDirectory()).path;
File file = File("$dir/" + DateTime.now().millisecondsSinceEpoch.toString() + "." + ext);
await file.writeAsBytes(bytes);
return file.path;
}
String getSpecialResults(LabsViewModel model) { String getSpecialResults(LabsViewModel model) {
String labResults = ""; String labResults = "";
model.patientLabSpecialResult.forEach((element) { model.patientLabSpecialResult.forEach((element) {

@ -1,12 +1,12 @@
import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/model/radiology/final_radiology.dart'; import 'package:diplomaticquarterapp/core/model/radiology/final_radiology.dart';
import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/radiology_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/radiology_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/models/header_model.dart'; import 'package:diplomaticquarterapp/models/header_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_send_email_dialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_send_email_dialog.dart';
@ -19,14 +19,19 @@ import 'package:url_launcher/url_launcher.dart';
class RadiologyDetailsPage extends StatelessWidget { class RadiologyDetailsPage extends StatelessWidget {
final FinalRadiology finalRadiology; final FinalRadiology finalRadiology;
bool isRadiologyVidaPlus;
RadiologyDetailsPage({Key key, this.finalRadiology}); RadiologyDetailsPage({Key key, this.finalRadiology, this.isRadiologyVidaPlus});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<RadiologyViewModel>( return BaseView<RadiologyViewModel>(
onModelReady: (model) => model.getRadImageURL(projectId: finalRadiology.projectID, lineItem: finalRadiology.invoiceLineItemNo, invoiceNo: finalRadiology.invoiceNo), onModelReady: (model) => model.getRadImageURL(
projectId: finalRadiology.projectID,
lineItem: finalRadiology.invoiceLineItemNo,
invoiceNo: Utils.isVidaPlusProject(projectViewModel, finalRadiology.projectID) ? finalRadiology.invoiceNo_VP : finalRadiology.invoiceNo,
isVidaPlus: Utils.isVidaPlusProject(projectViewModel, finalRadiology.projectID)),
builder: (_, model, widget) => AppScaffold( builder: (_, model, widget) => AppScaffold(
appBarTitle: TranslationBase.of(context).report, appBarTitle: TranslationBase.of(context).report,
isShowAppBar: true, isShowAppBar: true,
@ -45,7 +50,7 @@ class RadiologyDetailsPage extends StatelessWidget {
finalRadiology.doctorID, finalRadiology.doctorID,
finalRadiology.doctorImageURL, finalRadiology.doctorImageURL,
finalRadiology.speciality, finalRadiology.speciality,
finalRadiology.invoiceNo.toString(), Utils.isVidaPlusProject(projectViewModel, finalRadiology.projectID) ? finalRadiology.invoiceNo_VP.toString() : finalRadiology.invoiceNo.toString(),
finalRadiology.projectName, finalRadiology.projectName,
finalRadiology.orderDate, finalRadiology.orderDate,
null, null,

@ -6,6 +6,7 @@ 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/radiology/radiology_details_page.dart'; import 'package:diplomaticquarterapp/pages/medical/radiology/radiology_details_page.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart';
import 'package:diplomaticquarterapp/widgets/new_design/my_tab_view.dart'; import 'package:diplomaticquarterapp/widgets/new_design/my_tab_view.dart';
import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart';
@ -78,12 +79,14 @@ class RadiologyHomePage extends StatelessWidget {
FadePage( FadePage(
page: RadiologyDetailsPage( page: RadiologyDetailsPage(
finalRadiology: radiology, finalRadiology: radiology,
isRadiologyVidaPlus: Utils.isVidaPlusProject(projectViewModel, radiology.projectID),
), ),
), ),
), ),
isInOutPatient: radiology.isInOutPatient, isInOutPatient: radiology.isInOutPatient,
name: TranslationBase.of(context).dr + " " + radiology.doctorName, name: TranslationBase.of(context).dr + " " + radiology.doctorName,
billNo: radiology.invoiceNo.toString(), billNo: Utils.isVidaPlusProject(projectViewModel, radiology.projectID) ? radiology.invoiceNo_VP.toString() : radiology.invoiceNo.toString(),
// billNo: radiology.invoiceNo_VP.toString(),
profileUrl: radiology.doctorImageURL, profileUrl: radiology.doctorImageURL,
subName: _isSortByClinic ? radiology.projectName : radiology.clinicDescription, subName: _isSortByClinic ? radiology.projectName : radiology.clinicDescription,
isLiveCareAppointment: radiology.isLiveCareAppointment, isLiveCareAppointment: radiology.isLiveCareAppointment,

@ -70,42 +70,41 @@ class _HomeReportPageState extends State<HomeReportPage> with SingleTickerProvid
body: Container( body: Container(
child: Column( child: Column(
children: [ children: [
TabBar( // TabBar(
controller: _tabController_new, // controller: _tabController_new,
indicatorWeight: 3.0, // indicatorWeight: 3.0,
indicatorSize: TabBarIndicatorSize.tab, // indicatorSize: TabBarIndicatorSize.tab,
labelColor: Color(0xff2B353E), // labelColor: Color(0xff2B353E),
unselectedLabelColor: Color(0xff575757), // unselectedLabelColor: Color(0xff575757),
labelPadding: EdgeInsets.only(top: 15, bottom: 13, left: 20, right: 20), // labelPadding: EdgeInsets.only(top: 15, bottom: 13, left: 20, right: 20),
labelStyle: TextStyle( // labelStyle: TextStyle(
fontSize: 16, // fontSize: 16,
fontWeight: FontWeight.w600, // fontWeight: FontWeight.w600,
letterSpacing: -0.48, // letterSpacing: -0.48,
), // ),
unselectedLabelStyle: TextStyle( // unselectedLabelStyle: TextStyle(
fontSize: 16, // fontSize: 16,
fontWeight: FontWeight.w600, // fontWeight: FontWeight.w600,
letterSpacing: -0.48, // letterSpacing: -0.48,
), // ),
onTap: (int value) { // onTap: (int value) {
print(value); // print(value);
setState(() {}); // setState(() {});
}, // },
tabs: [ // tabs: [
Text( // Text(
TranslationBase.of(context).outpatient, // TranslationBase.of(context).outpatient,
style: TextStyle(fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins'), // style: TextStyle(fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins'),
), // ),
Text( // Text(
TranslationBase.of(context).inPatient, // TranslationBase.of(context).inPatient,
style: TextStyle(fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins'), // style: TextStyle(fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins'),
), // ),
], // ],
), // ),
if (model.user != null) if (model.user != null)
Expanded( Expanded(
child: child: TabBarView(
TabBarView(
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
controller: _tabController_new, controller: _tabController_new,
children: <Widget>[ children: <Widget>[
@ -249,6 +248,7 @@ class _HomeReportPageState extends State<HomeReportPage> with SingleTickerProvid
if (projectViewModel.havePrivilege(21) if (projectViewModel.havePrivilege(21)
// && _tabController_new.index == 0 // && _tabController_new.index == 0
) )
if (_tabController_new.index == 0)
Padding( Padding(
padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21), padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21),
child: DefaultButton( child: DefaultButton(

@ -117,23 +117,23 @@ class ReportListWidget extends StatelessWidget {
if (reportList[index].status == 2) if (reportList[index].status == 2)
Row( Row(
children: [ children: [
InkWell( // InkWell(
onTap: () { // onTap: () {
getMedicalReportPDF(report); // getMedicalReportPDF(report);
}, // },
child: Padding( // child: Padding(
padding: const EdgeInsets.only(right: 11.0, left: 11.0), // padding: const EdgeInsets.only(right: 11.0, left: 11.0),
child: Text(TranslationBase.of(context).viewReport, // child: Text(TranslationBase.of(context).viewReport,
style: TextStyle( // style: TextStyle(
fontSize: 12, // fontSize: 12,
fontWeight: FontWeight.w600, // fontWeight: FontWeight.w600,
fontStyle: FontStyle.italic, // fontStyle: FontStyle.italic,
color: CustomColors.accentColor, // color: CustomColors.accentColor,
letterSpacing: -0.48, // letterSpacing: -0.48,
height: 18 / 12, // height: 18 / 12,
decoration: TextDecoration.underline)), // decoration: TextDecoration.underline)),
), // ),
), // ),
IconButton( IconButton(
icon: Icon(Icons.email), icon: Icon(Icons.email),
color: Color(0xff28323A), color: Color(0xff28323A),

@ -1,4 +1,4 @@
import 'package:badges/badges.dart'; import 'package:badges/badges.dart' as badge_import;
import 'package:diplomaticquarterapp/Constants.dart'; import 'package:diplomaticquarterapp/Constants.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart';
@ -95,11 +95,11 @@ class PaymentService extends StatelessWidget {
? Positioned( ? Positioned(
left: 8, left: 8,
top: 4, top: 4,
child: Badge( child: badge_import.Badge(
toAnimate: false, toAnimate: false,
elevation: 0, elevation: 0,
position: BadgePosition.topEnd(), position: badge_import.BadgePosition.topEnd(),
shape: BadgeShape.circle, shape: badge_import.BadgeShape.circle,
badgeColor: secondaryColor.withOpacity(1.0), badgeColor: secondaryColor.withOpacity(1.0),
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
badgeContent: Container( badgeContent: Container(
@ -111,11 +111,11 @@ class PaymentService extends StatelessWidget {
: Positioned( : Positioned(
right: 8, right: 8,
top: 4, top: 4,
child: Badge( child: badge_import.Badge(
toAnimate: false, toAnimate: false,
elevation: 0, elevation: 0,
position: BadgePosition.topEnd(), position: badge_import.BadgePosition.topEnd(),
shape: BadgeShape.circle, shape: badge_import.BadgeShape.circle,
badgeColor: secondaryColor.withOpacity(1.0), badgeColor: secondaryColor.withOpacity(1.0),
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
badgeContent: Container( badgeContent: Container(

@ -12,6 +12,7 @@ import 'package:diplomaticquarterapp/models/Appointments/doctor_pre_post_image.d
import 'package:diplomaticquarterapp/models/Appointments/laser_body_parts.dart'; import 'package:diplomaticquarterapp/models/Appointments/laser_body_parts.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/models/Request.dart'; import 'package:diplomaticquarterapp/models/Request.dart';
import 'package:diplomaticquarterapp/models/anicllary-orders/ancillary_orders_proc_list.dart';
import 'package:diplomaticquarterapp/models/apple_pay_request.dart'; import 'package:diplomaticquarterapp/models/apple_pay_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';
@ -484,7 +485,7 @@ class DoctorsListService extends BaseService {
dynamic localRes; dynamic localRes;
await baseAppClient.post(GET_PATIENT_SHARE, onSuccess: (response, statusCode) async { await baseAppClient.post(GET_PATIENT_SHARE, onSuccess: (response, statusCode) async {
localRes = response['OnlineCheckInAppointments'][0]; localRes = response;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
throw error; throw error;
}, body: request); }, body: request);
@ -961,6 +962,7 @@ class DoctorsListService extends BaseService {
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
request = { request = {
"AdvanceNumber": advanceNumber, "AdvanceNumber": advanceNumber,
"AdvanceNumber_VP": advanceNumber,
"PaymentReferenceNumber": paymentReference, "PaymentReferenceNumber": paymentReference,
"AppointmentID": appointmentID, "AppointmentID": appointmentID,
"VersionID": req.VersionID, "VersionID": req.VersionID,
@ -1046,12 +1048,18 @@ class DoctorsListService extends BaseService {
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
authUser = data; authUser = data;
} }
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest(); List<String> procedureOrderIDs = [];
selectedProcListAPI.forEach((element) {
procedureOrderIDs.add(element["ProcedureID"]);
});
request = { request = {
"RequestAncillaryOrderInvoice": [ "RequestAncillaryOrderInvoice": [
{"MemberID": 102, "ProjectID": projectID, "AppointmentNo": appointmentID, "OrderNo": orderNo, "AncillaryOrderInvoiceProcList": selectedProcListAPI} {"MemberID": 102, "ProjectID": projectID, "AppointmentNo": appointmentID, "OrderNo": orderNo, "AncillaryOrderInvoiceProcList": selectedProcListAPI}
] ],
"ProcedureOrderIds": procedureOrderIDs
}; };
dynamic localRes; dynamic localRes;
await baseAppClient.post(GENERATE_ANCILLARY_ORDERS_INVOICE, onSuccess: (response, statusCode) async { await baseAppClient.post(GENERATE_ANCILLARY_ORDERS_INVOICE, onSuccess: (response, statusCode) async {
@ -1368,7 +1376,8 @@ class DoctorsListService extends BaseService {
} }
Future<Map> HIS_createAdvancePayment(AppoitmentAllHistoryResultList appo, String projectID, double payedAmount, String paymentReference, String paymentMethodName, dynamic patientType, Future<Map> HIS_createAdvancePayment(AppoitmentAllHistoryResultList appo, String projectID, double payedAmount, String paymentReference, String paymentMethodName, dynamic patientType,
String patientName, dynamic patientID, BuildContext context) async { String patientName, dynamic patientID, BuildContext context,
{bool isAncillaryOrder = false}) 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(await this.sharedPref.getObject(USER_PROFILE)); var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
@ -1400,6 +1409,8 @@ class DoctorsListService extends BaseService {
"SessionID": "YckwoXhUmWBsnHKEKig", "SessionID": "YckwoXhUmWBsnHKEKig",
"isDentalAllowedBackend": false, "isDentalAllowedBackend": false,
"PatientTypeID": patientType, "PatientTypeID": patientType,
"IsAncillaryOrder": isAncillaryOrder,
// "AncillaryProcedureList": ancillaryOrdersProcedureList,
"PatientType": patientType "PatientType": patientType
}; };
dynamic localRes; dynamic localRes;
@ -1832,4 +1843,6 @@ class DoctorsListService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
} }

@ -54,6 +54,7 @@ class _SplashScreenState extends State<SplashScreen> {
await _privilegeService.getPrivilege(); await _privilegeService.getPrivilege();
ProjectViewModel projectProvider = Provider.of<ProjectViewModel>(context, listen: false); ProjectViewModel projectProvider = Provider.of<ProjectViewModel>(context, listen: false);
projectProvider.setPrivilegeModelList(privilege: _privilegeService.privilegeModelList); projectProvider.setPrivilegeModelList(privilege: _privilegeService.privilegeModelList);
projectProvider.setVidaPlusProjectList(_privilegeService.vidaPlusProjectListModel);
AppSharedPreferences().clear(); // Clearing Shared Preferences On App Launch AppSharedPreferences().clear(); // Clearing Shared Preferences On App Launch
AppSharedPreferences().setString(APP_LANGUAGE, projectProvider.isArabic ? "ar" : "en"); AppSharedPreferences().setString(APP_LANGUAGE, projectProvider.isArabic ? "ar" : "en");
var themeNotifier = Provider.of<ThemeNotifier>(context, listen: false); var themeNotifier = Provider.of<ThemeNotifier>(context, listen: false);

@ -2902,6 +2902,12 @@ class TranslationBase {
String get sickLeaveAdmittedPatient => localizedValues["sickLeaveAdmittedPatient"][locale.languageCode]; String get sickLeaveAdmittedPatient => localizedValues["sickLeaveAdmittedPatient"][locale.languageCode];
String get dischargeDate => localizedValues["dischargeDate"][locale.languageCode]; String get dischargeDate => localizedValues["dischargeDate"][locale.languageCode];
String get selectAdmissionText => localizedValues["selectAdmissionText"][locale.languageCode]; String get selectAdmissionText => localizedValues["selectAdmissionText"][locale.languageCode];
String get invalidEligibility => localizedValues["invalidEligibility"][locale.languageCode];
String get invalidInsurance => localizedValues["invalidInsurance"][locale.languageCode];
String get continueCash => localizedValues["continueCash"][locale.languageCode];
String get updateInsuranceText => localizedValues["updateInsurance"][locale.languageCode];
String get downloadReport => localizedValues["downloadReport"][locale.languageCode];
String get habibCallCenter => localizedValues["habibCallCenter"][locale.languageCode];
} }

@ -4,7 +4,7 @@ import 'dart:io';
import 'dart:typed_data'; import 'dart:typed_data';
import 'package:auto_size_text/auto_size_text.dart'; import 'package:auto_size_text/auto_size_text.dart';
import 'package:badges/badges.dart'; import 'package:badges/badges.dart' as badge_import;
import 'package:cached_network_image/cached_network_image.dart'; import 'package:cached_network_image/cached_network_image.dart';
import 'package:connectivity/connectivity.dart'; import 'package:connectivity/connectivity.dart';
import 'package:crypto/crypto.dart' as crypto; import 'package:crypto/crypto.dart' as crypto;
@ -241,11 +241,11 @@ class Utils {
? Positioned( ? Positioned(
left: 8, left: 8,
top: 4, top: 4,
child: Badge( child: badge_import.Badge(
toAnimate: false, toAnimate: false,
elevation: 0, elevation: 0,
position: BadgePosition.topEnd(), position: badge_import.BadgePosition.topEnd(),
shape: BadgeShape.circle, shape: badge_import.BadgeShape.circle,
badgeColor: secondaryColor.withOpacity(1.0), badgeColor: secondaryColor.withOpacity(1.0),
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
badgeContent: Container( badgeContent: Container(
@ -259,11 +259,11 @@ class Utils {
? Positioned( ? Positioned(
right: 8, right: 8,
top: 4, top: 4,
child: Badge( child: badge_import.Badge(
toAnimate: false, toAnimate: false,
elevation: 0, elevation: 0,
position: BadgePosition.topEnd(), position: badge_import.BadgePosition.topEnd(),
shape: BadgeShape.circle, shape: badge_import.BadgeShape.circle,
badgeColor: secondaryColor.withOpacity(1.0), badgeColor: secondaryColor.withOpacity(1.0),
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
badgeContent: Container( badgeContent: Container(
@ -614,11 +614,11 @@ class Utils {
? Positioned( ? Positioned(
left: 8, left: 8,
top: 4, top: 4,
child: Badge( child: badge_import.Badge(
toAnimate: false, toAnimate: false,
elevation: 0, elevation: 0,
position: BadgePosition.topEnd(), position: badge_import.BadgePosition.topEnd(),
shape: BadgeShape.circle, shape: badge_import.BadgeShape.circle,
badgeColor: secondaryColor.withOpacity(1.0), badgeColor: secondaryColor.withOpacity(1.0),
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
badgeContent: Container( badgeContent: Container(
@ -632,11 +632,11 @@ class Utils {
? Positioned( ? Positioned(
right: 8, right: 8,
top: 4, top: 4,
child: Badge( child: badge_import.Badge(
toAnimate: false, toAnimate: false,
elevation: 0, elevation: 0,
position: BadgePosition.topEnd(), position: badge_import.BadgePosition.topEnd(),
shape: BadgeShape.circle, shape: badge_import.BadgeShape.circle,
badgeColor: secondaryColor.withOpacity(1.0), badgeColor: secondaryColor.withOpacity(1.0),
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
badgeContent: Container( badgeContent: Container(
@ -810,6 +810,16 @@ class Utils {
return crypto.md5.convert(utf8.encode(input)).toString(); return crypto.md5.convert(utf8.encode(input)).toString();
} }
static bool isVidaPlusProject(ProjectViewModel projectViewModel, int projectID) {
bool isVidaPlus = false;
projectViewModel.vidaPlusProjectList.forEach((element) {
if (element.projectID == projectID) {
isVidaPlus = true;
}
});
return isVidaPlus;
}
static String generateSignature() { static String generateSignature() {
} }

@ -24,9 +24,9 @@ Interval _getInternalInterval(
class AnimatedTextFormField extends StatefulWidget { class AnimatedTextFormField extends StatefulWidget {
AnimatedTextFormField({ AnimatedTextFormField({
Key key, Key? key,
this.interval = const Interval(0.0, 1.0), this.interval = const Interval(0.0, 1.0),
@required this.width, required this.width,
this.loadingController, this.loadingController,
this.inertiaController, this.inertiaController,
this.inertiaDirection, this.inertiaDirection,
@ -47,35 +47,35 @@ class AnimatedTextFormField extends StatefulWidget {
super(key: key); super(key: key);
final Interval interval; final Interval interval;
final AnimationController loadingController; final AnimationController? loadingController;
final AnimationController inertiaController; final AnimationController? inertiaController;
final double width; final double width;
final bool enabled; final bool enabled;
final String labelText; final String? labelText;
final Widget prefixIcon; final Widget? prefixIcon;
final Widget suffixIcon; final Widget? suffixIcon;
final TextInputType keyboardType; final TextInputType? keyboardType;
final TextInputAction textInputAction; final TextInputAction? textInputAction;
final bool obscureText; final bool obscureText;
final TextEditingController controller; final TextEditingController? controller;
final FocusNode focusNode; final FocusNode? focusNode;
final FormFieldValidator<String> validator; final FormFieldValidator<String>? validator;
final ValueChanged<String> onFieldSubmitted; final ValueChanged<String>? onFieldSubmitted;
final FormFieldSetter<String> onSaved; final FormFieldSetter<String>? onSaved;
final TextFieldInertiaDirection inertiaDirection; final TextFieldInertiaDirection? inertiaDirection;
@override @override
_AnimatedTextFormFieldState createState() => _AnimatedTextFormFieldState(); _AnimatedTextFormFieldState createState() => _AnimatedTextFormFieldState();
} }
class _AnimatedTextFormFieldState extends State<AnimatedTextFormField> { class _AnimatedTextFormFieldState extends State<AnimatedTextFormField> {
Animation<double> scaleAnimation; late Animation<double> scaleAnimation;
Animation<double> sizeAnimation; late Animation<double> sizeAnimation;
Animation<double> suffixIconOpacityAnimation; late Animation<double> suffixIconOpacityAnimation;
Animation<double> fieldTranslateAnimation; late Animation<double> fieldTranslateAnimation;
Animation<double> iconRotationAnimation; late Animation<double> iconRotationAnimation;
Animation<double> iconTranslateAnimation; late Animation<double> iconTranslateAnimation;
@override @override
void initState() { void initState() {
@ -140,7 +140,7 @@ class _AnimatedTextFormFieldState extends State<AnimatedTextFormField> {
begin: 48.0, begin: 48.0,
end: widget.width, end: widget.width,
).animate(CurvedAnimation( ).animate(CurvedAnimation(
parent: loadingController, parent: loadingController!,
curve: _getInternalInterval( curve: _getInternalInterval(
.2, 1.0, interval.begin, interval.end, Curves.linearToEaseOut), .2, 1.0, interval.begin, interval.end, Curves.linearToEaseOut),
reverseCurve: Curves.easeInExpo, reverseCurve: Curves.easeInExpo,
@ -194,13 +194,13 @@ class _AnimatedTextFormFieldState extends State<AnimatedTextFormField> {
borderSide: new BorderSide(), borderSide: new BorderSide(),
), ),
labelText: widget.labelText, labelText: widget.labelText,
prefixIcon: _buildInertiaAnimation(widget.prefixIcon), prefixIcon: _buildInertiaAnimation(widget.prefixIcon!),
suffixIcon: _buildInertiaAnimation(widget.loadingController != null suffixIcon: _buildInertiaAnimation(widget.loadingController != null
? FadeTransition( ? FadeTransition(
opacity: suffixIconOpacityAnimation, opacity: suffixIconOpacityAnimation!,
child: widget.suffixIcon, child: widget.suffixIcon!,
) )
: widget.suffixIcon), : widget.suffixIcon!),
); );
} }
@ -251,9 +251,9 @@ class _AnimatedTextFormFieldState extends State<AnimatedTextFormField> {
class AnimatedPasswordTextFormField extends StatefulWidget { class AnimatedPasswordTextFormField extends StatefulWidget {
AnimatedPasswordTextFormField({ AnimatedPasswordTextFormField({
Key key, Key? key,
this.interval = const Interval(0.0, 1.0), this.interval = const Interval(0.0, 1.0),
@required this.animatedWidth, required this.animatedWidth,
this.loadingController, this.loadingController,
this.inertiaController, this.inertiaController,
this.inertiaDirection, this.inertiaDirection,
@ -271,19 +271,19 @@ class AnimatedPasswordTextFormField extends StatefulWidget {
super(key: key); super(key: key);
final Interval interval; final Interval interval;
final AnimationController loadingController; final AnimationController? loadingController;
final AnimationController inertiaController; final AnimationController? inertiaController;
final double animatedWidth; final double animatedWidth;
final bool enabled; final bool enabled;
final String labelText; final String? labelText;
final TextInputType keyboardType; final TextInputType? keyboardType;
final TextInputAction textInputAction; final TextInputAction? textInputAction;
final TextEditingController controller; final TextEditingController? controller;
final FocusNode focusNode; final FocusNode? focusNode;
final FormFieldValidator<String> validator; final FormFieldValidator<String>? validator;
final ValueChanged<String> onFieldSubmitted; final ValueChanged<String>? onFieldSubmitted;
final FormFieldSetter<String> onSaved; final FormFieldSetter<String>? onSaved;
final TextFieldInertiaDirection inertiaDirection; final TextFieldInertiaDirection? inertiaDirection;
@override @override
_AnimatedPasswordTextFormFieldState createState() => _AnimatedPasswordTextFormFieldState createState() =>

@ -11,11 +11,11 @@ class StepperView extends StatefulWidget {
final int initialNumber; final int initialNumber;
final int maxNumber; final int maxNumber;
final int minNumber; final int minNumber;
final StepperCallbackFuture counterCallback; final StepperCallbackFuture? counterCallback;
final Function increaseCallback; final Function? increaseCallback;
final Function decreaseCallback; final Function? decreaseCallback;
StepperView({this.initialNumber = 1, this.minNumber = 1, this.maxNumber, @required this.counterCallback, this.increaseCallback, this.decreaseCallback, this.height = 25, @required this.foregroundColor, @required this.backgroundColor, this.buttonPadding = 1}){ StepperView({this.initialNumber = 1, this.minNumber = 1, required this.maxNumber, @required this.counterCallback, this.increaseCallback, this.decreaseCallback, this.height = 25, required this.foregroundColor, required this.backgroundColor, this.buttonPadding = 1}){
assert((this.initialNumber >= this.minNumber && this.initialNumber <= this.maxNumber)); assert((this.initialNumber >= this.minNumber && this.initialNumber <= this.maxNumber));
} }
@override @override
@ -23,15 +23,15 @@ class StepperView extends StatefulWidget {
} }
class _StepperViewState extends State<StepperView> { class _StepperViewState extends State<StepperView> {
int _currentCount; late int _currentCount;
StepperCallbackFuture _counterCallback; late StepperCallbackFuture _counterCallback;
Function _increaseCallback; late Function _increaseCallback;
Function _decreaseCallback; late Function _decreaseCallback;
@override @override
void initState() { void initState() {
_currentCount = widget.initialNumber ?? 1; _currentCount = widget.initialNumber ?? 1;
_counterCallback = widget.counterCallback; _counterCallback = widget.counterCallback!;
_increaseCallback = widget.increaseCallback ?? () {}; _increaseCallback = widget.increaseCallback ?? () {};
_decreaseCallback = widget.decreaseCallback ?? () {}; _decreaseCallback = widget.decreaseCallback ?? () {};
super.initState(); super.initState();
@ -52,7 +52,7 @@ class _StepperViewState extends State<StepperView> {
mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [ children: [
_createDecrementButton( _createDecrementButton(
(_currentCount > widget.minNumber) ? () => _decrement() : null, ((_currentCount > widget.minNumber) ? () => _decrement() : null) as VoidCallback,
), ),
Container( Container(
width: 25, width: 25,
@ -69,7 +69,7 @@ class _StepperViewState extends State<StepperView> {
) )
), ),
_createIncrementButton( _createIncrementButton(
(_currentCount < widget.maxNumber) ? () => _increment() : null ((_currentCount < widget.maxNumber) ? () => _increment() : null) as VoidCallback
), ),
], ],
), ),
@ -77,7 +77,7 @@ class _StepperViewState extends State<StepperView> {
} }
void _increment() async{ void _increment() async{
doInc({@required bool can}){ doInc({required bool can}){
if(can) if(can)
setState(() { setState(() {
_currentCount++; _currentCount++;
@ -98,7 +98,7 @@ class _StepperViewState extends State<StepperView> {
} }
void _decrement() async{ void _decrement() async{
doDec({@required bool can}){ doDec({required bool can}){
if(can) if(can)
setState(() { setState(() {
_currentCount--; _currentCount--;
@ -117,7 +117,7 @@ class _StepperViewState extends State<StepperView> {
} }
} }
Widget _createIncrementButton(Function onPressed,) { Widget _createIncrementButton(VoidCallback onPressed,) {
return Stack( return Stack(
children: [ children: [
RawMaterialButton( RawMaterialButton(
@ -152,7 +152,7 @@ class _StepperViewState extends State<StepperView> {
); );
} }
Widget _createDecrementButton(Function onPressed) { Widget _createDecrementButton(VoidCallback onPressed) {
return Stack( return Stack(
children: [ children: [
RawMaterialButton( RawMaterialButton(

@ -1,5 +1,6 @@
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter_gifimage/flutter_gifimage.dart'; import 'package:flutter_gif/flutter_gif.dart';
class GifLoaderContainer extends StatefulWidget { class GifLoaderContainer extends StatefulWidget {
@override @override
@ -7,15 +8,16 @@ class GifLoaderContainer extends StatefulWidget {
} }
class _GifLoaderContainerState extends State<GifLoaderContainer> with TickerProviderStateMixin { class _GifLoaderContainerState extends State<GifLoaderContainer> with TickerProviderStateMixin {
GifController controller1; late FlutterGifController controller;
@override @override
void initState() { void initState() {
controller1 = GifController(vsync: this); FlutterGifController controller= FlutterGifController(vsync: this);
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance.addPostFrameCallback((_) {
try { try {
controller1.repeat(min: 0, max: 11, period: Duration(milliseconds: 750), reverse: true); controller.repeat(min: 0, max: 11, period: Duration(milliseconds: 750), reverse: true);
} catch (ex) {} } catch (ex) {}
}); });
super.initState(); super.initState();
@ -23,7 +25,7 @@ class _GifLoaderContainerState extends State<GifLoaderContainer> with TickerProv
@override @override
void dispose() { void dispose() {
controller1.dispose(); controller.dispose();
super.dispose(); super.dispose();
} }
@ -34,7 +36,7 @@ class _GifLoaderContainerState extends State<GifLoaderContainer> with TickerProv
child: Container( child: Container(
// margin: EdgeInsets.only(bottom: 40), // margin: EdgeInsets.only(bottom: 40),
child: GifImage( child: GifImage(
controller: controller1, controller: controller,
image: AssetImage("assets/images/progress-loading-red.gif"), //NetworkImage("http://img.mp.itc.cn/upload/20161107/5cad975eee9e4b45ae9d3c1238ccf91e.jpg"), image: AssetImage("assets/images/progress-loading-red.gif"), //NetworkImage("http://img.mp.itc.cn/upload/20161107/5cad975eee9e4b45ae9d3c1238ccf91e.jpg"),
), ),
)); ));

@ -6,20 +6,20 @@ import 'package:flutter/rendering.dart';
class AnimatedButton extends StatefulWidget { class AnimatedButton extends StatefulWidget {
AnimatedButton({ AnimatedButton({
Key key, Key? key,
@required this.text, required this.text,
@required this.onPressed, required this.onPressed,
@required this.controller, required this.controller,
this.textColor, this.textColor,
this.loadingColor, required this.loadingColor,
this.color, this.color,
}) : super(key: key); }) : super(key: key);
final String text; final String text;
final Color color; final Color? color;
final Color textColor; final Color? textColor;
final Color loadingColor; final Color loadingColor;
final Function onPressed; final VoidCallback? onPressed;
final AnimationController controller; final AnimationController controller;
@override @override
@ -28,18 +28,18 @@ class AnimatedButton extends StatefulWidget {
class _AnimatedButtonState extends State<AnimatedButton> class _AnimatedButtonState extends State<AnimatedButton>
with SingleTickerProviderStateMixin { with SingleTickerProviderStateMixin {
Animation<double> _sizeAnimation; late Animation<double> _sizeAnimation;
Animation<double> _textOpacityAnimation; late Animation<double> _textOpacityAnimation;
Animation<double> _buttonOpacityAnimation; late Animation<double> _buttonOpacityAnimation;
Animation<double> _ringThicknessAnimation; late Animation<double> _ringThicknessAnimation;
Animation<double> _ringOpacityAnimation; late Animation<double> _ringOpacityAnimation;
Animation<Color> _colorAnimation; late Animation<Color?> _colorAnimation;
var _isLoading = false; var _isLoading = false;
var _hover = false; var _hover = false;
var _width = 120.0; var _width = 120.0;
Color _color; late Color _color;
Color _loadingColor; late Color _loadingColor;
static const _height = 40.0; static const _height = 40.0;
static const _loadingCircleRadius = _height / 2; static const _loadingCircleRadius = _height / 2;
@ -91,10 +91,11 @@ class _AnimatedButtonState extends State<AnimatedButton>
final theme = Theme.of(context); final theme = Theme.of(context);
final buttonTheme = theme.floatingActionButtonTheme; final buttonTheme = theme.floatingActionButtonTheme;
_color = widget.color ?? buttonTheme.backgroundColor; _color = (widget.color ?? buttonTheme.backgroundColor)!;
_loadingColor = widget.loadingColor ?? theme.accentColor; _loadingColor = widget.loadingColor ?? theme.colorScheme.secondary;
_colorAnimation = ColorTween( _colorAnimation = ColorTween(
begin: _color, begin: _color,
end: _loadingColor, end: _loadingColor,
).animate( ).animate(
@ -137,14 +138,14 @@ class _AnimatedButtonState extends State<AnimatedButton>
/// sets width and size animation /// sets width and size animation
void _updateWidth() { void _updateWidth() {
final theme = Theme.of(context); final theme = Theme.of(context);
final fontSize = theme.textTheme.button.fontSize; final fontSize = theme.textTheme.button!.fontSize;
final renderParagraph = RenderParagraph( final renderParagraph = RenderParagraph(
TextSpan( TextSpan(
text: widget.text, text: widget.text,
style: TextStyle( style: TextStyle(
fontSize: fontSize, fontSize: fontSize,
fontWeight: theme.textTheme.button.fontWeight, fontWeight: theme.textTheme.button!.fontWeight,
letterSpacing: theme.textTheme.button.letterSpacing, letterSpacing: theme.textTheme.button!.letterSpacing,
), ),
), ),
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
@ -155,7 +156,7 @@ class _AnimatedButtonState extends State<AnimatedButton>
// text width based on fontSize, plus 45.0 for padding // text width based on fontSize, plus 45.0 for padding
var textWidth = var textWidth =
renderParagraph.getMinIntrinsicWidth(fontSize).ceilToDouble() + 45.0; renderParagraph.getMinIntrinsicWidth(fontSize!).ceilToDouble() + 45.0;
// button width is min 120.0 and max 240.0 // button width is min 120.0 and max 240.0
_width = textWidth > 120.0 && textWidth < 240.0 _width = textWidth > 120.0 && textWidth < 240.0
@ -196,14 +197,14 @@ class _AnimatedButtonState extends State<AnimatedButton>
color: _colorAnimation.value, color: _colorAnimation.value,
child: child, child: child,
shadowColor: _color, shadowColor: _color,
elevation: !_isLoading elevation: (_isLoading == false)
? (_hover ? (_hover == true
? buttonTheme.highlightElevation ? buttonTheme.highlightElevation ?? 0.0
: buttonTheme.elevation) : buttonTheme.elevation ?? 0.0)
: 0, : 0.0,
), ),
child: InkWell( child: InkWell(
onTap: !_isLoading ? widget.onPressed : null, onTap: !_isLoading ? widget!.onPressed : null,
splashColor: buttonTheme.splashColor, splashColor: buttonTheme.splashColor,
customBorder: buttonTheme.shape, customBorder: buttonTheme.shape,
onHighlightChanged: (value) => setState(() => _hover = value), onHighlightChanged: (value) => setState(() => _hover = value),
@ -235,7 +236,7 @@ class _AnimatedButtonState extends State<AnimatedButton>
child: AnimatedBuilder( child: AnimatedBuilder(
animation: _ringThicknessAnimation, animation: _ringThicknessAnimation,
builder: (context, child) => Ring( builder: (context, child) => Ring(
color: widget.loadingColor, color: widget!.loadingColor,
size: _height, size: _height,
thickness: _ringThicknessAnimation.value, thickness: _ringThicknessAnimation.value,
), ),
@ -259,8 +260,8 @@ class _AnimatedButtonState extends State<AnimatedButton>
class Ring extends StatelessWidget { class Ring extends StatelessWidget {
Ring({ Ring({
Key key, Key? key,
this.color, required this.color,
this.size = 40.0, this.size = 40.0,
this.thickness = 2.0, this.thickness = 2.0,
this.value = 1.0, this.value = 1.0,
@ -294,9 +295,9 @@ enum AnimatedTextRotation { up, down }
/// https://medium.com/flutter-community/flutter-challenge-3d-bottom-navigation-bar-48952a5fd996 /// https://medium.com/flutter-community/flutter-challenge-3d-bottom-navigation-bar-48952a5fd996
class AnimatedText extends StatefulWidget { class AnimatedText extends StatefulWidget {
AnimatedText({ AnimatedText({
Key key, Key? key,
@required this.text, required this.text,
this.style, required this.style,
this.textRotation = AnimatedTextRotation.up, this.textRotation = AnimatedTextRotation.up,
}) : super(key: key); }) : super(key: key);
@ -315,8 +316,8 @@ class _AnimatedTextState extends State<AnimatedText>
var _layoutHeight = 0.0; var _layoutHeight = 0.0;
final _textKey = GlobalKey(); final _textKey = GlobalKey();
Animation<double> _animation; late Animation<double> _animation;
AnimationController _controller; late AnimationController _controller;
double get radius => _layoutHeight / 2; double get radius => _layoutHeight / 2;
@ -337,7 +338,7 @@ class _AnimatedTextState extends State<AnimatedText>
_oldText = widget.text; _oldText = widget.text;
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance.addPostFrameCallback((_) {
setState(() => _layoutHeight = getWidgetSize(_textKey)?.height); setState(() => _layoutHeight = getWidgetSize(_textKey)!.height);
}); });
} }
@ -458,8 +459,8 @@ class _AnimatedTextState extends State<AnimatedText>
double lerp(double start, double end, double percent) => double lerp(double start, double end, double percent) =>
(start + percent * (end - start)); (start + percent * (end - start));
Size getWidgetSize(GlobalKey key) { Size? getWidgetSize(GlobalKey key) {
final RenderBox renderBox = key.currentContext?.findRenderObject(); return key.currentContext!.size;
return renderBox?.size; //return renderBox?.size;
} }
} }

@ -3,32 +3,34 @@ import 'dart:io';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart' as googlemap;
// import 'package:flutter_hms_gms_availability/flutter_hms_gms_availability.dart'; // import 'package:flutter_hms_gms_availability/flutter_hms_gms_availability.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:huawei_hmsavailability/huawei_hmsavailability.dart'; import 'package:huawei_hmsavailability/huawei_hmsavailability.dart';
import 'package:huawei_map/components/callbacks.dart';
import 'package:huawei_map/components/cameraPosition.dart' as cameraposition;
import 'package:huawei_map/map.dart' as hmsMap; import 'package:huawei_map/map.dart' as hmsMap;
class AppMap extends StatefulWidget { class AppMap extends StatefulWidget {
CameraPositionCallback onCameraMove; late CameraPositionCallback? onCameraMove;
Map initialCamera; late Map initialCamera;
AppMapState _state; AppMapState? _state;
Function onMapCreated; late Function? onMapCreated;
Function onCameraIdle; late Function? onCameraIdle;
AppMap(this.initialCamera, { this.onCameraMove, this.onMapCreated, this.onCameraIdle}); AppMap(this.initialCamera, { this.onCameraMove, this.onMapCreated, this.onCameraIdle});
@override @override
State<StatefulWidget> createState() => _state = AppMapState(); State<StatefulWidget> createState() => _state = AppMapState();
moveTo({@required CameraPosition cameraPostion}) { moveTo({ required CameraPosition cameraPostion}) {
if (_state.isHuawei) { if (_state!.isHuawei) {
final cameraJson = cameraPostion.toMap(); final cameraJson = cameraPostion?.toMap();
final camera = hmsMap.CameraPosition.fromMap(cameraJson); final camera = hmsMap.CameraPosition.fromMap(cameraJson);
_state._huaweiMapController.animateCamera(hmsMap.CameraUpdate.newCameraPosition(camera)); _state?._huaweiMapController.animateCamera(hmsMap.CameraUpdate.newCameraPosition(camera));
} else { } else {
_state.googleMapController.animateCamera(CameraUpdate.newCameraPosition(cameraPostion)); _state?.googleMapController.animateCamera(googlemap.CameraUpdate.newCameraPosition(cameraPostion! as googlemap.CameraPosition));
} }
} }
} }
@ -36,13 +38,13 @@ class AppMap extends StatefulWidget {
class AppMapState extends State<AppMap> { class AppMapState extends State<AppMap> {
bool isHuawei = false; bool isHuawei = false;
Completer<GoogleMapController> _googleMapControllerComp = Completer(); Completer<googlemap.GoogleMapController> _googleMapControllerComp = Completer();
GoogleMapController googleMapController; late googlemap.GoogleMapController googleMapController;
Completer<hmsMap.HuaweiMapController> _huaweiMapControllerComp = Completer(); Completer<hmsMap.HuaweiMapController> _huaweiMapControllerComp = Completer();
hmsMap.HuaweiMapController _huaweiMapController; late hmsMap.HuaweiMapController _huaweiMapController;
HmsApiAvailability hmsApiAvailability; late HmsApiAvailability hmsApiAvailability;
checkIsHuawei() async { checkIsHuawei() async {
await hmsApiAvailability.isHMSAvailable().then((value) { await hmsApiAvailability.isHMSAvailable().then((value) {
@ -69,19 +71,22 @@ class AppMapState extends State<AppMap> {
Widget map() => isHuawei ? huaweiMap() : googleMap(); Widget map() => isHuawei ? huaweiMap() : googleMap();
Widget googleMap() { Widget googleMap() {
return GoogleMap( return googlemap.GoogleMap(
mapType: MapType.normal, mapType: googlemap.MapType.normal,
zoomControlsEnabled: true, zoomControlsEnabled: true,
myLocationButtonEnabled: true, myLocationButtonEnabled: true,
myLocationEnabled: true, myLocationEnabled: true,
initialCameraPosition: CameraPosition.fromMap(widget.initialCamera), initialCameraPosition: googlemap.CameraPosition.fromMap(widget.initialCamera),
onCameraMove: widget.onCameraMove, onCameraMove: widget.onCameraMove,
onMapCreated: (GoogleMapController controller) { onMapCreated: (googlemap.GoogleMapController controller) {
googleMapController = controller; googleMapController = controller;
_googleMapControllerComp.complete(controller); _googleMapControllerComp.complete(controller);
widget.onMapCreated(); widget.onMapCreated!();
},
onCameraIdle: () {
print("onCameraIdle");
widget.onCameraIdle!();
}, },
onCameraIdle: widget.onCameraIdle,
); );
} }
@ -92,15 +97,15 @@ class AppMapState extends State<AppMap> {
myLocationButtonEnabled: true, myLocationButtonEnabled: true,
myLocationEnabled: true, myLocationEnabled: true,
initialCameraPosition: hmsMap.CameraPosition.fromMap(widget.initialCamera), initialCameraPosition: hmsMap.CameraPosition.fromMap(widget.initialCamera),
onCameraMove: (camera) => widget.onCameraMove(CameraPosition.fromMap(camera.toMap())), onCameraMove: (camera) => widget.onCameraMove!(CameraPosition.fromMap(camera.toMap())),
onMapCreated: (controller) { onMapCreated: (controller) {
_huaweiMapController = controller; _huaweiMapController = controller;
_huaweiMapControllerComp.complete(controller); _huaweiMapControllerComp.complete(controller);
widget.onMapCreated(); widget.onMapCreated!();
}, },
onCameraIdle: () { onCameraIdle: () {
print("onCameraIdle"); print("onCameraIdle");
widget.onCameraIdle(); widget.onCameraIdle!();
}, },
); );
} }

@ -1,4 +1,4 @@
import 'package:badges/badges.dart'; import 'package:badges/badges.dart' as badge_import;
import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/locator.dart';
@ -106,10 +106,10 @@ class BottomNavigationItem extends StatelessWidget {
Positioned( Positioned(
right: 18.0, right: 18.0,
bottom: 28.0, bottom: 28.0,
child: Badge( child: badge_import.Badge(
toAnimate: false, toAnimate: false,
position: BadgePosition.topEnd(), position: badge_import.BadgePosition.topEnd(),
shape: BadgeShape.circle, shape: badge_import.BadgeShape.circle,
badgeColor: secondaryColor.withOpacity(1.0), badgeColor: secondaryColor.withOpacity(1.0),
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
badgeContent: Container( badgeContent: Container(

@ -1,22 +1,23 @@
import 'package:carousel_pro/carousel_pro.dart';
import 'package:carousel_pro_nullsafety/carousel_pro_nullsafety.dart';
import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart'; import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class CarouselSlider extends StatelessWidget { class CarouselSlider extends StatelessWidget {
const CarouselSlider({ const CarouselSlider({
@required this.imagesUrlList, required this.imagesUrlList,
@required this.width, required this.width,
@required this.height, required this.height,
this.onImageChange, this.onImageChange,
this.autoPlay = false, this.autoPlay = false,
Key key, Key? key,
}) : super(key: key); }) : super(key: key);
final List imagesUrlList; final List imagesUrlList;
final double height; final double height;
final double width; final double width;
final bool autoPlay; final bool autoPlay;
final Function onImageChange; final void Function(int?, int)? onImageChange;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Carousel( return Carousel(
@ -37,7 +38,7 @@ class CarouselSlider extends StatelessWidget {
return Builder(builder: (BuildContext context) { return Builder(builder: (BuildContext context) {
return Container( return Container(
child: Image.network(image, loadingBuilder: (BuildContext context, child: Image.network(image, loadingBuilder: (BuildContext context,
Widget child, ImageChunkEvent loadingProgress) { Widget child, ImageChunkEvent? loadingProgress) {
if (loadingProgress == null) return child; if (loadingProgress == null) return child;
return Center( return Center(
child: SizedBox( child: SizedBox(

@ -5,8 +5,8 @@ import 'package:flutter/material.dart';
import '../../../../core/model/labs/LabOrderResult.dart'; import '../../../../core/model/labs/LabOrderResult.dart';
class LineChartCurved extends StatefulWidget { class LineChartCurved extends StatefulWidget {
final String title; final String? title;
final List<LabOrderResult> labResult; final List<LabOrderResult>? labResult;
LineChartCurved({this.title, this.labResult}); LineChartCurved({this.title, this.labResult});
@ -15,8 +15,8 @@ class LineChartCurved extends StatefulWidget {
} }
class LineChartCurvedState extends State<LineChartCurved> { class LineChartCurvedState extends State<LineChartCurved> {
bool isShowingMainData; bool? isShowingMainData;
List<int> xAxixs = List(); List<int> xAxixs = [];
int indexes = 0; int indexes = 0;
@override @override
@ -27,10 +27,10 @@ class LineChartCurvedState extends State<LineChartCurved> {
} }
getXaxix() { getXaxix() {
indexes = widget.labResult.length ~/ 3.5; indexes = widget.labResult!.length ~/ 3.5;
for (int index = 0; index < widget.labResult.length; index++) { for (int index = 0; index < widget.labResult!.length; index++) {
int mIndex = indexes * index; int mIndex = indexes * index;
if (mIndex < widget.labResult.length) { if (mIndex < widget.labResult!.length) {
xAxixs.add(mIndex); xAxixs.add(mIndex);
} }
} }
@ -49,7 +49,7 @@ class LineChartCurvedState extends State<LineChartCurved> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Text( Text(
widget.title, widget.title!,
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16), style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16),
), ),
SizedBox(height: 16), SizedBox(height: 16),

@ -4,6 +4,7 @@ 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/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/new_design/doctor_header.dart'; import 'package:diplomaticquarterapp/widgets/new_design/doctor_header.dart';
import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart'; import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
@ -35,7 +36,7 @@ class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectViewModel = Provider.of(context); projectViewModel = Provider.of(context);
return BaseView<LabsViewModel>( return BaseView<LabsViewModel>(
onModelReady: (model) => model.getPatientLabResult(patientLabOrder: widget.patientLabOrder), onModelReady: (model) => model.getPatientLabResult(isVidaPlus: Utils.isVidaPlusProject(projectViewModel, num.parse(widget.patientLabOrder.projectID)), patientLabOrder: widget.patientLabOrder),
builder: (_, model, w) => NetworkBaseView( builder: (_, model, w) => NetworkBaseView(
baseViewModel: model, baseViewModel: model,
child: Column( child: Column(

@ -8,27 +8,27 @@ import 'package:flutter/material.dart';
import 'package:flutter_countdown_timer/countdown_timer_controller.dart'; import 'package:flutter_countdown_timer/countdown_timer_controller.dart';
import 'package:flutter_countdown_timer/current_remaining_time.dart'; import 'package:flutter_countdown_timer/current_remaining_time.dart';
import 'package:flutter_countdown_timer/flutter_countdown_timer.dart'; import 'package:flutter_countdown_timer/flutter_countdown_timer.dart';
import 'package:flutter_rating_bar/flutter_rating_bar.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:rating_bar/rating_bar.dart';
import '../../my_rich_text.dart'; import '../../my_rich_text.dart';
class DoctorCard extends StatelessWidget { class DoctorCard extends StatelessWidget {
final String name; final String? name;
final String subName; final String? subName;
final double rating; final double? rating;
final DateTime date; final DateTime? date;
final String profileUrl; final String? profileUrl;
final String billNo; final String? billNo;
final Function onTap; final VoidCallback? onTap;
final Function onEmailTap; final VoidCallback? onEmailTap;
final bool isInOutPatient; final bool? isInOutPatient;
final bool isShowInOutPatient; final bool? isShowInOutPatient;
final bool isLiveCareAppointment; final bool? isLiveCareAppointment;
final bool isSortByClinic; final bool? isSortByClinic;
final String appointmentTime; final String? appointmentTime;
final bool isParentAppointment; final bool? isParentAppointment;
final int remainingTimeInMinutes; final int? remainingTimeInMinutes;
final String vaccineName; final String vaccineName;
final bool isSickLeave; final bool isSickLeave;
final int sickLeaveStatus; final int sickLeaveStatus;
@ -53,7 +53,7 @@ class DoctorCard extends StatelessWidget {
this.isSickLeave = false, this.isSickLeave = false,
this.sickLeaveStatus = 0}); this.sickLeaveStatus = 0});
ProjectViewModel projectViewModel; ProjectViewModel? projectViewModel;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -84,29 +84,29 @@ class DoctorCard extends StatelessWidget {
height: double.infinity, height: double.infinity,
alignment: Alignment.center, alignment: Alignment.center,
padding: EdgeInsets.only(left: 2, right: 2), padding: EdgeInsets.only(left: 2, right: 2),
decoration: isShowInOutPatient decoration: isShowInOutPatient!
? BoxDecoration( ? BoxDecoration(
//Colors.red[900] Color(0xff404545) //Colors.red[900] Color(0xff404545)
color: isLiveCareAppointment color: isLiveCareAppointment!
? Color(0xff2E303A) ? Color(0xff2E303A)
: !isInOutPatient : !isInOutPatient!
? Color(0xffD02127) ? Color(0xffD02127)
: Color(0xffa9a089), : Color(0xffa9a089),
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(10), topLeft: projectViewModel!.isArabic ? Radius.circular(0) : Radius.circular(10),
bottomLeft: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(10), bottomLeft: projectViewModel!.isArabic ? Radius.circular(0) : Radius.circular(10),
topRight: projectViewModel.isArabic ? Radius.circular(10) : Radius.circular(0), topRight: projectViewModel!.isArabic ? Radius.circular(10) : Radius.circular(0),
bottomRight: projectViewModel.isArabic ? Radius.circular(10) : Radius.circular(0), bottomRight: projectViewModel!.isArabic ? Radius.circular(10) : Radius.circular(0),
), ),
) )
: BoxDecoration(), : BoxDecoration(),
child: isShowInOutPatient child: isShowInOutPatient!
? RotatedBox( ? RotatedBox(
quarterTurns: 3, quarterTurns: 3,
child: Text( child: Text(
isLiveCareAppointment isLiveCareAppointment!
? TranslationBase.of(context).liveCare.toLowerCase().capitalizeFirstofEach ? TranslationBase.of(context).liveCare.toLowerCase().capitalizeFirstofEach
: !isInOutPatient : !isInOutPatient!
? TranslationBase.of(context).inPatient.toLowerCase().capitalizeFirstofEach ? TranslationBase.of(context).inPatient.toLowerCase().capitalizeFirstofEach
: TranslationBase.of(context).outpatient.toLowerCase().capitalizeFirstofEach, : TranslationBase.of(context).outpatient.toLowerCase().capitalizeFirstofEach,
style: TextStyle(fontSize: 10, fontWeight: FontWeight.w700, color: Colors.white, letterSpacing: -0.2, height: 16 / 10), style: TextStyle(fontSize: 10, fontWeight: FontWeight.w700, color: Colors.white, letterSpacing: -0.2, height: 16 / 10),
@ -146,7 +146,7 @@ class DoctorCard extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
Text( Text(
DateUtil.getDayMonthYearDateFormatted(date), DateUtil.getDayMonthYearDateFormatted(date!),
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(
@ -163,8 +163,8 @@ class DoctorCard extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
LargeAvatar( LargeAvatar(
name: name, name: name!,
url: profileUrl, url: profileUrl!,
width: 48, width: 48,
height: 48, height: 48,
), ),
@ -175,33 +175,45 @@ 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).branch : TranslationBase.of(context).clinic + ":", subName, projectViewModel.isArabic), MyRichText(isSortByClinic! ? TranslationBase.of(context).branch : TranslationBase.of(context).clinic + ":", subName!, projectViewModel!.isArabic),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
if (rating == null && billNo != "") MyRichText(TranslationBase.of(context).invoiceNo, billNo ?? "", projectViewModel.isArabic), if (rating == null && billNo != "") MyRichText(TranslationBase.of(context).invoiceNo, billNo ?? "", projectViewModel!.isArabic),
if (vaccineName != "") MyRichText("", vaccineName ?? "", projectViewModel.isArabic), if (vaccineName != "") MyRichText("", vaccineName ?? "", projectViewModel!.isArabic),
if (rating != null) if (rating != null)
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
children: <Widget>[ children: <Widget>[
RatingBar.readOnly( // RatingBar.readOnly(
initialRating: rating, // initialRating: rating,
size: 16.0, // size: 16.0,
filledColor: Color(0XFFD02127), // filledColor: Color(0XFFD02127),
emptyColor: Color(0XFFD02127), // emptyColor: Color(0XFFD02127),
isHalfAllowed: true, // isHalfAllowed: true,
halfFilledIcon: Icons.star_half, // halfFilledIcon: Icons.star_half,
filledIcon: Icons.star, // filledIcon: Icons.star,
emptyIcon: Icons.star_border, // emptyIcon: Icons.star_border,
), // ),
RatingBar(
initialRating: rating!,
// size: 18.0,
// filledColor: Color(0XFFD02127),
// emptyColor: Color(0XFFD02127),
// isHalfAllowed: true,
// halfFilledIcon: Icons.star_half,
// filledIcon: Icons.star,
// emptyIcon: ,
//
ratingWidget: RatingWidget( full:Icon(Icons.star, color:Color(0XFFD02127)), half:Icon(Icons.star_half, color: Color(0XFFD02127)), empty: Icon(Icons.star_border,color: Color(0XFFD02127)) ,
), onRatingUpdate: (double value) { }),
], ],
), ),
if (remainingTimeInMinutes != null) if (remainingTimeInMinutes != null)
CountdownTimer( CountdownTimer(
controller: CountdownTimerController(endTime: DateTime.now().millisecondsSinceEpoch + (remainingTimeInMinutes * 1000) * 60), controller: CountdownTimerController(endTime: DateTime.now().millisecondsSinceEpoch + (remainingTimeInMinutes! * 1000) * 60),
widgetBuilder: (_, CurrentRemainingTime time) { widgetBuilder: (_, CurrentRemainingTime? time) {
return time != null return time != null
? Text( ? Text(
"${time.days ?? 0}:${time.hours ?? 0}:${time.min}:${time.sec}", "${time.days ?? 0}:${time.hours ?? 0}:${time.min}:${time.sec}",
@ -219,7 +231,7 @@ class DoctorCard extends StatelessWidget {
height: 48, height: 48,
child: Align( child: Align(
alignment: Alignment.bottomCenter, alignment: Alignment.bottomCenter,
child: (onEmailTap != null && projectViewModel.havePrivilege(17)) child: (onEmailTap != null && projectViewModel!.havePrivilege(17))
? InkWell( ? InkWell(
onTap: onEmailTap, onTap: onEmailTap,
child: Icon( child: Icon(

@ -11,11 +11,11 @@ class MedicalProfileItem extends StatelessWidget {
final bool hasBadge = false; final bool hasBadge = false;
final bool isPngImage; final bool isPngImage;
bool isEnable; bool isEnable;
Color imgColor; Color? imgColor;
final width; final width;
final height; final height;
MedicalProfileItem({@required this.imagePath, @required this.title, @required this.subTitle, hasBadge, this.isEnable = true, this.imgColor, this.isPngImage = false, this.width, this.height}); MedicalProfileItem({required this.imagePath, required this.title, required this.subTitle, hasBadge, this.isEnable = true, this.imgColor, this.isPngImage = false, this.width, this.height});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {

@ -35,7 +35,7 @@ class TimeLineView extends StatefulWidget {
class _TimeLineViewState extends State<TimeLineView> { class _TimeLineViewState extends State<TimeLineView> {
List<AppoitmentAllHistoryResultList> tempList = []; List<AppoitmentAllHistoryResultList> tempList = [];
List<DateObj> dateObjs = []; List<DateObj> dateObjs = [];
DateObj selectedDateObj = null; late DateObj selectedDateObj;
final authService = new auth.AuthProvider(); final authService = new auth.AuthProvider();
@override @override
@ -148,8 +148,8 @@ class _TimeLineViewState extends State<TimeLineView> {
); );
}).toList(), }).toList(),
onChanged: (r) { onChanged: (r) {
selectedDateObj = r; selectedDateObj = r!;
applyFilter(r.year == 0 ? true : false); applyFilter(r?.year == 0 ? true : false);
setState(() {}); setState(() {});
}, },
underline: Container( underline: Container(
@ -244,7 +244,7 @@ class _TimeLineViewState extends State<TimeLineView> {
height: MediaQuery.of(context).size.width / 14, height: MediaQuery.of(context).size.width / 14,
width: MediaQuery.of(context).size.width / (widget.isArabic ? 4 : 6), width: MediaQuery.of(context).size.width / (widget.isArabic ? 4 : 6),
child: CustomTextButton( child: CustomTextButton(
shape: cardRadiusNew(8), // shape: cardRadiusNew(8),
elevation: 0, elevation: 0,
backgroundColor: Color(0xFFFBF2E31), backgroundColor: Color(0xFFFBF2E31),
onPressed: () { onPressed: () {
@ -307,10 +307,10 @@ class _TimeLineViewState extends State<TimeLineView> {
} }
class TimelineNewWidget extends StatelessWidget { class TimelineNewWidget extends StatelessWidget {
bool isLast; bool? isLast;
final AppoitmentAllHistoryResultList appoitmentAllHistoryResul; final AppoitmentAllHistoryResultList? appoitmentAllHistoryResul;
TimelineNewWidget({Key key, this.appoitmentAllHistoryResul, this.isLast}); TimelineNewWidget({Key? key, this.appoitmentAllHistoryResul, this.isLast});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -327,7 +327,7 @@ class TimelineNewWidget extends StatelessWidget {
children: [ children: [
Text( Text(
DateUtil.getDayMonthYearLangDateFormatted( DateUtil.getDayMonthYearLangDateFormatted(
DateUtil.convertStringToDate(appoitmentAllHistoryResul.appointmentDate), DateUtil.convertStringToDate(appoitmentAllHistoryResul!.appointmentDate),
projectViewModel.isArabic ? "ar" : "en", projectViewModel.isArabic ? "ar" : "en",
), ),
style: TextStyle( style: TextStyle(
@ -337,7 +337,7 @@ class TimelineNewWidget extends StatelessWidget {
), ),
), ),
mWidth(8), mWidth(8),
isLast ? Container() : barView(), isLast! ? Container() : barView(),
], ],
), ),
), ),
@ -349,20 +349,20 @@ class TimelineNewWidget extends StatelessWidget {
context, context,
FadePage( FadePage(
page: AppointmentDetails( page: AppointmentDetails(
appo: appoitmentAllHistoryResul, appo: appoitmentAllHistoryResul!,
parentIndex: 2, parentIndex: 2,
))); )));
}, },
name: appoitmentAllHistoryResul.doctorNameObj, name: appoitmentAllHistoryResul!.doctorNameObj,
disableProfileView: false, disableProfileView: false,
url: appoitmentAllHistoryResul.doctorImageURL, url: appoitmentAllHistoryResul!.doctorImageURL,
width: 30, width: 30,
height: 30, height: 30,
isAppointmentAvatar: true, isAppointmentAvatar: true,
), ),
mHeight(6), mHeight(6),
Text( Text(
appoitmentAllHistoryResul.doctorNameObj, appoitmentAllHistoryResul!.doctorNameObj,
style: TextStyle( style: TextStyle(
color: CustomColors.white, color: CustomColors.white,
fontSize: 10, fontSize: 10,
@ -371,7 +371,7 @@ class TimelineNewWidget extends StatelessWidget {
), ),
), ),
Text( Text(
appoitmentAllHistoryResul.clinicName, appoitmentAllHistoryResul!.clinicName,
style: TextStyle( style: TextStyle(
color: CustomColors.grey2, color: CustomColors.grey2,
fontSize: 10, fontSize: 10,

@ -11,10 +11,10 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class TimeLineWidget extends StatelessWidget { class TimeLineWidget extends StatelessWidget {
final bool isUp; final bool? isUp;
final AppoitmentAllHistoryResultList appoitmentAllHistoryResul; final AppoitmentAllHistoryResultList? appoitmentAllHistoryResul;
TimeLineWidget({Key key, this.isUp, this.appoitmentAllHistoryResul}); TimeLineWidget({Key? key, this.isUp, this.appoitmentAllHistoryResul});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -33,7 +33,7 @@ class TimeLineWidget extends StatelessWidget {
), ),
), ),
), ),
if (isUp) if (isUp!)
Positioned( Positioned(
top: projectViewModel.isArabic ? 15 : 18, top: projectViewModel.isArabic ? 15 : 18,
child: Container( child: Container(
@ -41,7 +41,7 @@ class TimeLineWidget extends StatelessWidget {
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
Texts( Texts(
appoitmentAllHistoryResul.doctorNameObj, appoitmentAllHistoryResul?.doctorNameObj,
color: Colors.white, color: Colors.white,
fontSize: 10.5, fontSize: 10.5,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
@ -57,13 +57,12 @@ class TimeLineWidget extends StatelessWidget {
context, context,
FadePage( FadePage(
page: AppointmentDetails( page: AppointmentDetails(
appo: appoitmentAllHistoryResul, appo: appoitmentAllHistoryResul!,
), ),
), ),
); );
}, },
name: appoitmentAllHistoryResul.doctorNameObj, name: appoitmentAllHistoryResul!.doctorImageURL,
url: appoitmentAllHistoryResul.doctorImageURL,
width: 30, width: 30,
height: 30, height: 30,
), ),
@ -77,7 +76,7 @@ class TimeLineWidget extends StatelessWidget {
height: 15, height: 15,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.yellow[700], color: Colors.yellow[700],
border: Border.all(color: Colors.yellow[700], width: 2), border: Border.all(color: Colors.yellow[700]!, width: 2),
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
Radius.circular(25.0), Radius.circular(25.0),
@ -88,13 +87,13 @@ class TimeLineWidget extends StatelessWidget {
height: 4, height: 4,
), ),
Texts( Texts(
DateUtil.getMonthDayYearLangDateFormatted(DateUtil.convertStringToDate(appoitmentAllHistoryResul.appointmentDate), projectViewModel.isArabic ? "ar" : "en"), DateUtil.getMonthDayYearLangDateFormatted(DateUtil.convertStringToDate(appoitmentAllHistoryResul!.appointmentDate), projectViewModel.isArabic ? "ar" : "en"),
color: Colors.white, color: Colors.white,
fontSize: 12.5, fontSize: 12.5,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
), ),
Texts( Texts(
appoitmentAllHistoryResul.clinicName, appoitmentAllHistoryResul!.clinicName,
color: Colors.white, color: Colors.white,
fontSize: 12.5, fontSize: 12.5,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
@ -111,13 +110,13 @@ class TimeLineWidget extends StatelessWidget {
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
Texts( Texts(
appoitmentAllHistoryResul.clinicName.trim(), appoitmentAllHistoryResul!.clinicName.trim(),
color: Colors.white, color: Colors.white,
fontSize: 12.5, fontSize: 12.5,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
), ),
Texts( Texts(
DateUtil.getMonthDayYearLangDateFormatted(DateUtil.convertStringToDate(appoitmentAllHistoryResul.appointmentDate), projectViewModel.isArabic ? "ar" : "en"), DateUtil.getMonthDayYearLangDateFormatted(DateUtil.convertStringToDate(appoitmentAllHistoryResul!.appointmentDate), projectViewModel.isArabic ? "ar" : "en"),
color: Colors.white, color: Colors.white,
fontSize: 12.5, fontSize: 12.5,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
@ -130,7 +129,7 @@ class TimeLineWidget extends StatelessWidget {
height: 15, height: 15,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.yellow[700], color: Colors.yellow[700],
border: Border.all(color: Colors.yellow[700], width: 2), border: Border.all(color: Colors.yellow[700]!, width: 2),
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
Radius.circular(25.0), Radius.circular(25.0),
@ -148,11 +147,11 @@ class TimeLineWidget extends StatelessWidget {
context, context,
FadePage( FadePage(
page: AppointmentDetails( page: AppointmentDetails(
appo: appoitmentAllHistoryResul, appo: appoitmentAllHistoryResul!,
))); )));
}, },
name: appoitmentAllHistoryResul.doctorNameObj, name: appoitmentAllHistoryResul!.doctorNameObj,
url: appoitmentAllHistoryResul.doctorImageURL, url: appoitmentAllHistoryResul!.doctorImageURL,
width: 30, width: 30,
height: 30, height: 30,
), ),
@ -160,7 +159,7 @@ class TimeLineWidget extends StatelessWidget {
height: 3, height: 3,
), ),
Texts( Texts(
appoitmentAllHistoryResul.doctorNameObj.trim(), appoitmentAllHistoryResul!.doctorNameObj.trim(),
color: Colors.white, color: Colors.white,
fontSize: 10.5, fontSize: 10.5,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,

@ -2,20 +2,20 @@ import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class ServicesContainer extends StatelessWidget { class ServicesContainer extends StatelessWidget {
final String title; final String? title;
final String imageLocation; final String? imageLocation;
final Function onTap; final VoidCallback? onTap;
ServicesContainer({this.title, this.imageLocation, this.onTap}); ServicesContainer({this.title, this.imageLocation, this.onTap});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return InkWell( return InkWell(
onTap: () => onTap(), onTap: () => onTap!(),
child: Container( child: Container(
height: 60, height: 60,
margin: EdgeInsets.all(8), margin: EdgeInsets.all(8),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Theme.of(context).textTheme.headline2.color, color: Theme.of(context).textTheme.headline2!.color,
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(7), borderRadius: BorderRadius.circular(7),
), ),
@ -28,7 +28,7 @@ class ServicesContainer extends StatelessWidget {
Row( Row(
children: [ children: [
Image.asset( Image.asset(
imageLocation, imageLocation!,
height: 30, height: 30,
width: 40, width: 40,
), ),

@ -3,38 +3,38 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class Texts extends StatefulWidget { class Texts extends StatefulWidget {
final String text; final String? text;
final String variant; final String? variant;
final Color color; final Color? color;
final bool bold; final bool? bold;
final bool regular; final bool? regular;
final bool medium; final bool? medium;
final int maxLength; final int? maxLength;
final bool italic; final bool? italic;
final TextAlign textAlign; final TextAlign? textAlign;
final int maxLines; final int? maxLines;
final bool readMore; final bool? readMore;
final String style; final String? style;
final bool allowExpand; final bool? allowExpand;
final double fontSize; final double? fontSize;
final FontWeight fontWeight; final FontWeight? fontWeight;
final double margin; final double? margin;
final double marginTop; final double? marginTop;
final double marginRight; final double? marginRight;
final double marginBottom; final double? marginBottom;
final double marginLeft; final double? marginLeft;
final TextDecoration decoration; final TextDecoration? decoration;
final double heightFactor; final double? heightFactor;
Texts(this.text, Texts(this.text,
{Key key, {Key? key,
this.variant, this.variant,
this.color, this.color,
this.bold, this.bold,
this.regular, this.regular,
this.medium, this.medium,
this.allowExpand = true, this.allowExpand = true,
this.italic: false, this.italic= false,
this.textAlign, this.textAlign,
this.maxLength = 60, this.maxLength = 60,
this.maxLines, this.maxLines,
@ -63,9 +63,9 @@ class _TextsState extends State<Texts> {
void didUpdateWidget(Texts oldWidget) { void didUpdateWidget(Texts oldWidget) {
setState(() { setState(() {
if (widget.style == "overline") if (widget.style == "overline")
text = widget.text.toUpperCase(); text = widget.text!.toUpperCase();
else { else {
text = widget.text; text = widget.text!;
} }
}); });
super.didUpdateWidget(oldWidget); super.didUpdateWidget(oldWidget);
@ -73,11 +73,11 @@ class _TextsState extends State<Texts> {
@override @override
void initState() { void initState() {
hidden = widget.readMore; hidden = widget.readMore!;
if (widget.style == "overline") if (widget.style == "overline")
text = widget.text.toUpperCase(); text = widget.text!.toUpperCase();
else { else {
text = widget.text; text = widget.text!;
} }
super.initState(); super.initState();
} }
@ -119,7 +119,7 @@ class _TextsState extends State<Texts> {
} }
} }
FontWeight _getFontWeight() { FontWeight? _getFontWeight() {
if (widget.bold ?? false) { if (widget.bold ?? false) {
return FontWeight.w900; return FontWeight.w900;
} else if (widget.regular ?? false) { } else if (widget.regular ?? false) {
@ -169,7 +169,7 @@ class _TextsState extends State<Texts> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
TextStyle _getFontStyle() { TextStyle? _getFontStyle() {
switch (widget.style) { switch (widget.style) {
case "headline2": case "headline2":
return Theme.of(context).textTheme.headline2; return Theme.of(context).textTheme.headline2;
@ -184,7 +184,7 @@ class _TextsState extends State<Texts> {
case "bodyText2": case "bodyText2":
return Theme.of(context).textTheme.bodyText2; return Theme.of(context).textTheme.bodyText2;
case "bodyText_15": case "bodyText_15":
return Theme.of(context).textTheme.bodyText2.copyWith(fontSize: 15.0); return Theme.of(context).textTheme.bodyText2!.copyWith(fontSize: 15.0);
case "bodyText1": case "bodyText1":
return Theme.of(context).textTheme.bodyText1; return Theme.of(context).textTheme.bodyText1;
case "caption": case "caption":
@ -209,37 +209,37 @@ class _TextsState extends State<Texts> {
? text ? text
: (text.substring( : (text.substring(
0, 0,
text.length > widget.maxLength text.length > widget.maxLength!
? widget.maxLength ? widget.maxLength
: text.length)), : text.length)),
textAlign: widget.textAlign, textAlign: widget.textAlign,
overflow: widget.maxLines != null overflow: widget.maxLines != null
? ((widget.maxLines > 1) ? ((widget.maxLines! > 1)
? TextOverflow.fade ? TextOverflow.fade
: TextOverflow.ellipsis) : TextOverflow.ellipsis)
: null, : null,
maxLines: widget.maxLines ?? null, maxLines: widget.maxLines ?? null,
style: widget.style != null style: widget.style != null
? _getFontStyle().copyWith( ? _getFontStyle()!.copyWith(
fontStyle: widget.italic ? FontStyle.italic : null, fontStyle: widget.italic! ? FontStyle.italic : null,
color: widget.color != null color: widget.color != null
? widget.color ? widget.color
: Theme.of(context).textTheme.bodyText1.color, : Theme.of(context).textTheme.bodyText1!.color,
fontWeight: widget.fontWeight ?? _getFontWeight(), fontWeight: widget.fontWeight ?? _getFontWeight(),
) )
: TextStyle( : TextStyle(
height: widget.heightFactor, height: widget.heightFactor,
decoration: widget.decoration, decoration: widget.decoration,
fontStyle: widget.italic ? FontStyle.italic : null, fontStyle: widget.italic! ? FontStyle.italic : null,
color: widget.color ?? color: widget.color ??
Theme.of(context).textTheme.bodyText1.color, Theme.of(context).textTheme.bodyText1!.color,
fontSize: widget.fontSize ?? _getFontSize(), fontSize: widget.fontSize ?? _getFontSize(),
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' : 'Poppins'), projectViewModel.isArabic ? 'Cairo' : 'Poppins'),
), ),
if (widget.readMore && text.length > widget.maxLength && hidden) if (widget.readMore! && text.length > widget.maxLength! && hidden)
Positioned( Positioned(
bottom: 0, bottom: 0,
left: 0, left: 0,
@ -256,9 +256,9 @@ class _TextsState extends State<Texts> {
) )
], ],
), ),
if (widget.allowExpand && if (widget.allowExpand! &&
widget.readMore && widget.readMore! &&
text.length > widget.maxLength) text.length > widget.maxLength!)
Padding( Padding(
padding: EdgeInsets.only(top: 8.0, right: 8.0, bottom: 8.0), padding: EdgeInsets.only(top: 8.0, right: 8.0, bottom: 8.0),
child: InkWell( child: InkWell(
@ -269,7 +269,7 @@ class _TextsState extends State<Texts> {
}, },
child: Text( child: Text(
hidden ? "Read More" : "Read less", hidden ? "Read More" : "Read less",
style: _getFontStyle().copyWith( style: _getFontStyle()!.copyWith(
color: Theme.of(context).primaryColor, color: Theme.of(context).primaryColor,
fontWeight: FontWeight.w800, fontWeight: FontWeight.w800,
fontFamily: projectViewModel.isArabic ? 'Poppins' : 'Poppins', fontFamily: projectViewModel.isArabic ? 'Poppins' : 'Poppins',

@ -7,12 +7,12 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class ConfirmWithMessageDialog extends StatelessWidget { class ConfirmWithMessageDialog extends StatelessWidget {
final String title; final String? title;
final String message; final String? message;
final String okTitle; final String? okTitle;
final VoidCallback onTap; final VoidCallback? onTap;
const ConfirmWithMessageDialog({Key key, this.title, @required this.message, this.okTitle, this.onTap}) : super(key: key); const ConfirmWithMessageDialog({Key? key, this.title, @required this.message, this.okTitle, this.onTap}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -50,7 +50,7 @@ class ConfirmWithMessageDialog extends StatelessWidget {
], ],
), ),
Text( Text(
message, message!,
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff808080), letterSpacing: -0.48), style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff808080), letterSpacing: -0.48),
), ),
SizedBox(height: 28), SizedBox(height: 28),
@ -71,7 +71,7 @@ class ConfirmWithMessageDialog extends StatelessWidget {
okTitle ?? TranslationBase.of(context).ok, okTitle ?? TranslationBase.of(context).ok,
() { () {
Navigator.pop(context); Navigator.pop(context);
onTap(); onTap!();
}, },
textColor: Colors.white, textColor: Colors.white,
color: CustomColors.green, color: CustomColors.green,

@ -11,11 +11,11 @@ class AlertDialogBox {
final Function okFunction; final Function okFunction;
AlertDialogBox( AlertDialogBox(
{@required this.context, {required this.context,
this.title, this.title,
@required this.confirmMessage, @required this.confirmMessage,
@required this.okText, @required this.okText,
@required this.okFunction}); required this.okFunction});
showAlertDialog(BuildContext context) { showAlertDialog(BuildContext context) {
Widget continueButton = Widget continueButton =

@ -6,17 +6,17 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class ConfirmDialog { class ConfirmDialog {
final BuildContext context; final BuildContext? context;
final title; final title;
final confirmMessage; final confirmMessage;
final okText; final okText;
final cancelText; final cancelText;
final Function okFunction; final VoidCallback okFunction;
final Function cancelFunction; final Function? cancelFunction;
final isDissmissable; final isDissmissable;
ConfirmDialog({@required this.context, this.title, @required this.confirmMessage, @required this.okText, @required this.cancelText, @required this.okFunction, @required this.cancelFunction, this.isDissmissable = true}); ConfirmDialog({@required this.context, this.title, @required this.confirmMessage, @required this.okText, @required this.cancelText, required this.okFunction, @required this.cancelFunction, this.isDissmissable = true});
showAlertDialog(BuildContext context) { showAlertDialog(BuildContext context) {
Dialog alert = Dialog( Dialog alert = Dialog(
@ -28,8 +28,8 @@ class ConfirmDialog {
confirmMessage, confirmMessage,
okText, okText,
cancelText, cancelText,
cancelFunction: cancelFunction, cancelFunction: cancelFunction!,
okFunction: okFunction, okFunction: okFunction!,
), ),
), ),
); );
@ -50,13 +50,13 @@ class ConfirmDialog {
} }
class Mdialog extends StatelessWidget { class Mdialog extends StatelessWidget {
String title; String? title;
String description; String? description;
final Function okFunction; final VoidCallback? okFunction;
final Function cancelFunction; final Function? cancelFunction;
final okText; final okText;
final cancelText; final cancelText;
BuildContext _context; BuildContext? _context;
Mdialog(this._context, this.title, this.description, this.okText, this.cancelText, {this.okFunction, this.cancelFunction}); Mdialog(this._context, this.title, this.description, this.okText, this.cancelText, {this.okFunction, this.cancelFunction});
@ -72,7 +72,7 @@ class Mdialog extends StatelessWidget {
children: [ children: [
Text( Text(
// title != null ? title : TranslationBase.of(context).confirm, // title != null ? title : TranslationBase.of(context).confirm,
title, title!,
style: TextStyle( style: TextStyle(
fontSize: 24, fontSize: 24,
letterSpacing: -0.94, letterSpacing: -0.94,
@ -81,7 +81,7 @@ class Mdialog extends StatelessWidget {
), ),
Text( Text(
// this.confirmMessage, // this.confirmMessage,
description, description!,
style: TextStyle( style: TextStyle(
fontSize: 12, fontSize: 12,
letterSpacing: -0.48, letterSpacing: -0.48,
@ -95,8 +95,8 @@ class Mdialog extends StatelessWidget {
Expanded( Expanded(
child: InkWell( child: InkWell(
onTap: () { onTap: () {
Navigator.of(_context).pop(); Navigator.of(_context!).pop();
cancelFunction(); cancelFunction!();
}, },
child: Container( child: Container(
decoration: containerRadius(CustomColors.lightGreyColor, 12), decoration: containerRadius(CustomColors.lightGreyColor, 12),

@ -7,8 +7,8 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class ConfirmSendEmailDialog extends StatefulWidget { class ConfirmSendEmailDialog extends StatefulWidget {
final String email; final String? email;
final GestureTapCallback onTapSendEmail; final GestureTapCallback? onTapSendEmail;
ConfirmSendEmailDialog({this.email, this.onTapSendEmail}); ConfirmSendEmailDialog({this.email, this.onTapSendEmail});
@ -68,7 +68,7 @@ class _ConfirmSendEmailDialogState extends State<ConfirmSendEmailDialog> {
children: [ children: [
Expanded( Expanded(
child: Text( child: Text(
widget.email, widget.email!,
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48), style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48),
), ),
), ),
@ -112,7 +112,7 @@ class _ConfirmSendEmailDialogState extends State<ConfirmSendEmailDialog> {
TranslationBase.of(context).send, TranslationBase.of(context).send,
() { () {
Navigator.pop(context); Navigator.pop(context);
widget.onTapSendEmail(); widget.onTapSendEmail!();
}, },
color: Color(0xff359846), color: Color(0xff359846),
), ),

@ -4,12 +4,12 @@ import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class CovidConsentDialog extends StatelessWidget { class CovidConsentDialog extends StatelessWidget {
final String title; final String? title;
final String message; final String? message;
final String okTitle; final String? okTitle;
final VoidCallback onTap; final VoidCallback? onTap;
const CovidConsentDialog({Key key, this.title, @required this.message, this.okTitle, this.onTap}) : super(key: key); const CovidConsentDialog({Key? key, this.title, @required this.message, this.okTitle, this.onTap}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -47,7 +47,7 @@ class CovidConsentDialog extends StatelessWidget {
], ],
), ),
Text( Text(
message, message!,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff808080), letterSpacing: -0.48), style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff808080), letterSpacing: -0.48),
), ),
SizedBox(height: 28), SizedBox(height: 28),
@ -68,7 +68,7 @@ class CovidConsentDialog extends StatelessWidget {
okTitle ?? TranslationBase.of(context).ok, okTitle ?? TranslationBase.of(context).ok,
() { () {
Navigator.pop(context); Navigator.pop(context);
onTap(); onTap!();
}, },
textColor: Colors.white, textColor: Colors.white,
color: CustomColors.green, color: CustomColors.green,

@ -5,14 +5,14 @@ import 'package:flutter/material.dart';
class RadioGroupDialog extends StatefulWidget { class RadioGroupDialog extends StatefulWidget {
final BuildContext context; final BuildContext? context;
final title; final title;
final List<IdNamePair> list; final List<IdNamePair>? list;
final okText; final okText;
final cancelText; final cancelText;
final Function(IdNamePair) okFunction; final Function(IdNamePair)? okFunction;
final Function cancelFunction; final Function? cancelFunction;
IdNamePair selectedValue; IdNamePair? selectedValue;
RadioGroupDialog( RadioGroupDialog(
{@required this.context, {@required this.context,
@ -33,7 +33,7 @@ class RadioGroupState extends State<RadioGroupDialog> {
@override @override
void initState() { void initState() {
super.initState(); super.initState();
widget.selectedValue = widget.selectedValue ?? widget.list[0]; widget.selectedValue = widget.selectedValue ?? widget.list![0];
} }
@override @override
@ -50,7 +50,7 @@ class RadioGroupState extends State<RadioGroupDialog> {
}); });
Widget continueButton = Widget continueButton =
TextButton(child: Text(this.widget.okText), onPressed: () { TextButton(child: Text(this.widget.okText), onPressed: () {
this.widget.okFunction(widget.selectedValue); this.widget.okFunction!(widget.selectedValue!);
Navigator.of(context).pop(); Navigator.of(context).pop();
}); });
@ -79,9 +79,9 @@ class RadioGroupState extends State<RadioGroupDialog> {
Container( Container(
child: Column( child: Column(
children: children:
widget.list.map((data) => RadioListTile( widget.list!.map((data) => RadioListTile(
title: Text("${data.name}"), title: Text("${data.name}"),
groupValue: widget.selectedValue.id, groupValue: widget.selectedValue!.id,
value: data.id, value: data.id,
onChanged: (val) { onChanged: (val) {
setState(() { setState(() {

@ -10,20 +10,20 @@ class RadioSelectionDialogModel {
} }
class RadioSelectionDialog extends StatefulWidget { class RadioSelectionDialog extends StatefulWidget {
final Function(int) onValueSelected; final Function(int)? onValueSelected;
final List<RadioSelectionDialogModel> listData; final List<RadioSelectionDialogModel>? listData;
final int selectedIndex; final int? selectedIndex;
final bool isScrollable; final bool? isScrollable;
final bool isShowSearch; final bool? isShowSearch;
const RadioSelectionDialog({Key key, this.onValueSelected, this.listData, this.selectedIndex, this.isScrollable = false, this.isShowSearch = false}) : super(key: key); const RadioSelectionDialog({Key? key, this.onValueSelected, this.listData, this.selectedIndex, this.isScrollable = false, this.isShowSearch = false}) : super(key: key);
@override @override
State createState() => new RadioSelectionDialogState(); State createState() => new RadioSelectionDialogState();
} }
class RadioSelectionDialogState extends State<RadioSelectionDialog> { class RadioSelectionDialogState extends State<RadioSelectionDialog> {
int selectedIndex; late int selectedIndex;
List<RadioSelectionDialogModel> tempListData = []; List<RadioSelectionDialogModel> tempListData = [];
TextEditingController controller = new TextEditingController(); TextEditingController controller = new TextEditingController();
@ -37,8 +37,8 @@ class RadioSelectionDialogState extends State<RadioSelectionDialog> {
addAllData() { addAllData() {
tempListData.clear(); tempListData.clear();
for (int i = 0; i < widget.listData.length; i++) { for (int i = 0; i < widget.listData!.length; i++) {
tempListData.add(widget.listData[i]); tempListData.add(widget.listData![i]);
} }
setState(() {}); setState(() {});
} }
@ -83,7 +83,7 @@ class RadioSelectionDialogState extends State<RadioSelectionDialog> {
TranslationBase.of(context).pleaseSelectFromBelowOptions, TranslationBase.of(context).pleaseSelectFromBelowOptions,
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56), style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56),
), ),
widget.isShowSearch widget.isShowSearch!
? Padding( ? Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: TextField( child: TextField(
@ -91,9 +91,9 @@ class RadioSelectionDialogState extends State<RadioSelectionDialog> {
onChanged: (v) { onChanged: (v) {
if (v.length > 0) { if (v.length > 0) {
tempListData.clear(); tempListData.clear();
for (int i = 0; i < widget.listData.length; i++) { for (int i = 0; i < widget.listData!.length; i++) {
if (widget.listData[i].title.toLowerCase().contains(v.toLowerCase())) { if (widget.listData![i].title.toLowerCase().contains(v.toLowerCase())) {
tempListData.add(widget.listData[i]); tempListData.add(widget.listData![i]);
} }
} }
} else { } else {
@ -111,14 +111,14 @@ class RadioSelectionDialogState extends State<RadioSelectionDialog> {
), ),
) )
: Container(), : Container(),
SizedBox(height: widget.isScrollable ? 12 : 0), SizedBox(height: widget.isScrollable! ? 12 : 0),
SizedBox( SizedBox(
height: widget.isScrollable ? MediaQuery.of(context).size.height * .4 : null, height: widget.isScrollable! ? MediaQuery.of(context).size.height * .4 : null,
child: ListView.separated( child: ListView.separated(
physics: widget.isScrollable ? BouncingScrollPhysics() : NeverScrollableScrollPhysics(), physics: widget.isScrollable! ? BouncingScrollPhysics() : NeverScrollableScrollPhysics(),
// shrinkWrap: !widget.isScrollable, // shrinkWrap: !widget.isScrollable,
shrinkWrap: !widget.isScrollable, shrinkWrap: !widget.isScrollable!,
padding: EdgeInsets.only(bottom: widget.isScrollable ? 21 : 42, top: 10), padding: EdgeInsets.only(bottom: widget.isScrollable! ? 21 : 42, top: 10),
itemBuilder: (context, index) { itemBuilder: (context, index) {
return InkWell( return InkWell(
onTap: () { onTap: () {
@ -137,7 +137,7 @@ class RadioSelectionDialogState extends State<RadioSelectionDialog> {
groupValue: selectedIndex, groupValue: selectedIndex,
onChanged: (value) { onChanged: (value) {
setState(() { setState(() {
selectedIndex = value; selectedIndex = value!;
}); });
}, },
), ),
@ -157,7 +157,7 @@ class RadioSelectionDialogState extends State<RadioSelectionDialog> {
separatorBuilder: (context, index) => SizedBox(height: 10), separatorBuilder: (context, index) => SizedBox(height: 10),
itemCount: tempListData.length), itemCount: tempListData.length),
), ),
SizedBox(height: widget.isScrollable ? 12 : 0), SizedBox(height: widget.isScrollable! ? 12 : 0),
Row( Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
@ -166,7 +166,7 @@ class RadioSelectionDialogState extends State<RadioSelectionDialog> {
TranslationBase.of(context).save, TranslationBase.of(context).save,
() { () {
Navigator.pop(context); Navigator.pop(context);
widget.onValueSelected(selectedIndex); widget.onValueSelected!(selectedIndex);
}, },
color: Color(0xff349745), color: Color(0xff349745),
), ),

@ -5,11 +5,11 @@ import 'package:flutter/material.dart';
// ignore: must_be_immutable // ignore: must_be_immutable
class SelectLocationDialog extends StatefulWidget { class SelectLocationDialog extends StatefulWidget {
final List<AddressInfo> addresses; final List<AddressInfo>? addresses;
final Function(AddressInfo) onValueSelected; final Function(AddressInfo)? onValueSelected;
AddressInfo selectedAddress; AddressInfo? selectedAddress;
SelectLocationDialog({Key key, this.addresses, this.onValueSelected, this.selectedAddress}); SelectLocationDialog({Key? key, this.addresses, this.onValueSelected, this.selectedAddress});
@override @override
_SelectLocationDialogState createState() => _SelectLocationDialogState(); _SelectLocationDialogState createState() => _SelectLocationDialogState();
@ -19,9 +19,9 @@ class _SelectLocationDialogState extends State<SelectLocationDialog> {
@override @override
void initState() { void initState() {
super.initState(); super.initState();
widget.selectedAddress = widget.selectedAddress ?? widget.addresses[0]; widget.selectedAddress = widget.selectedAddress ?? widget.addresses![0];
for(int i=0;i<widget.addresses.length;i++){ for(int i=0;i<widget.addresses!.length;i++){
print(widget.addresses[i].latLong); print(widget.addresses![i].latLong);
} }
} }
@ -46,7 +46,7 @@ class _SelectLocationDialogState extends State<SelectLocationDialog> {
children: [ children: [
Divider(), Divider(),
...List.generate( ...List.generate(
widget.addresses.length, widget.addresses!.length,
(index) => Column( (index) => Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -60,19 +60,19 @@ class _SelectLocationDialogState extends State<SelectLocationDialog> {
child: InkWell( child: InkWell(
onTap: () { onTap: () {
setState(() { setState(() {
widget.selectedAddress = widget.addresses[index]; widget.selectedAddress = widget.addresses![index];
}); });
}, },
child: ListTile( child: ListTile(
title: Text( title: Text(
widget.addresses[index].address1, widget.addresses![index].address1,
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
letterSpacing: -0.46, letterSpacing: -0.46,
), ),
), ),
leading: Radio( leading: Radio(
value: widget.addresses[index], value: widget.addresses![index],
groupValue: widget.selectedAddress, groupValue: widget.selectedAddress,
activeColor: Colors.red[800], activeColor: Colors.red[800],
onChanged: (value) { onChanged: (value) {
@ -135,7 +135,7 @@ class _SelectLocationDialogState extends State<SelectLocationDialog> {
flex: 1, flex: 1,
child: InkWell( child: InkWell(
onTap: () { onTap: () {
widget.onValueSelected(widget.selectedAddress); widget.onValueSelected!(widget.selectedAddress!);
Navigator.pop(context); Navigator.pop(context);
}, },
child: Padding( child: Padding(

@ -7,13 +7,13 @@ class SelectionDialog<T> extends StatefulWidget{
final List<T> items; final List<T> items;
BuildContext context; BuildContext context;
SelectionDialog(this.context,{@required this.title, @required this.items}); SelectionDialog(this.context,{required this.title, required this.items});
@override @override
State<StatefulWidget> createState() => SelectionDialogState(); State<StatefulWidget> createState() => SelectionDialogState();
Future<T> show() async{ Future<Future<T?>> show() async{
return showDialog<T>(context: context, builder: (ctx){ return showDialog<T>(context: context, builder: (ctx){
return this; return this;
}); });

@ -72,19 +72,19 @@ class _AppDrawerState extends State<AppDrawer> {
checkUserData(); checkUserData();
} }
ProjectViewModel projectProvider; ProjectViewModel? projectProvider;
var sharedPref = new AppSharedPreferences(); var sharedPref = new AppSharedPreferences();
var familyFileProvider = FamilyFilesProvider(); var familyFileProvider = FamilyFilesProvider();
PharmacyModuleViewModel pharmacyModuleViewModel = locator<PharmacyModuleViewModel>(); PharmacyModuleViewModel pharmacyModuleViewModel = locator<PharmacyModuleViewModel>();
AuthenticatedUser user; AuthenticatedUser? user;
AuthenticatedUser mainUser; AuthenticatedUser? mainUser;
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>(); AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
VitalSignService _vitalSignService = locator<VitalSignService>(); VitalSignService _vitalSignService = locator<VitalSignService>();
AppointmentRateViewModel appointmentRateViewModel = locator<AppointmentRateViewModel>(); AppointmentRateViewModel appointmentRateViewModel = locator<AppointmentRateViewModel>();
PrivilegeService _privilegeService = locator<PrivilegeService>(); PrivilegeService _privilegeService = locator<PrivilegeService>();
ToDoCountProviderModel toDoProvider; ToDoCountProviderModel? toDoProvider;
String booldType; String? booldType;
String notificationCount; String? notificationCount;
final authService = new AuthProvider(); final authService = new AuthProvider();
String pharmacyLiveCareQRCode = ""; String pharmacyLiveCareQRCode = "";
@ -142,12 +142,12 @@ class _AppDrawerState extends State<AppDrawer> {
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
Text( Text(
(user != null && projectProvider.isLogin) ? user.firstName + ' ' + user.lastName : TranslationBase.of(context).cantSeeProfile, (user != null && projectProvider!.isLogin) ? user!.firstName + ' ' + user!.lastName : TranslationBase.of(context).cantSeeProfile,
style: TextStyle(color: Color(0xff2E303A), fontWeight: FontWeight.bold, fontSize: 20, letterSpacing: -1.2, height: 35 / 20), style: TextStyle(color: Color(0xff2E303A), fontWeight: FontWeight.bold, fontSize: 20, letterSpacing: -1.2, height: 35 / 20),
), ),
Text( Text(
(user != null && projectProvider.isLogin) (user != null && projectProvider!.isLogin)
? TranslationBase.of(context).fileNumber + ": " + user.patientID.toString() ? TranslationBase.of(context).fileNumber + ": " + user!.patientID.toString()
: TranslationBase.of(context).loginRegisterNow, : TranslationBase.of(context).loginRegisterNow,
style: TextStyle( style: TextStyle(
color: Color(0xff2E303A), color: Color(0xff2E303A),
@ -168,7 +168,7 @@ class _AppDrawerState extends State<AppDrawer> {
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[ children: <Widget>[
(user != null && projectProvider.isLogin) (user != null && projectProvider!.isLogin)
? Container() ? Container()
: InkWell( : InkWell(
child: DrawerItem( child: DrawerItem(
@ -179,30 +179,30 @@ class _AppDrawerState extends State<AppDrawer> {
projectProvider: projectProvider, projectProvider: projectProvider,
), ),
onTap: () { onTap: () {
sharedPref.setBool(IS_ROBOT_INIT, null); sharedPref.setBool(IS_ROBOT_INIT, false);
sharedPref.remove(CLINICS_LIST); sharedPref.remove(CLINICS_LIST);
if (projectProvider.isArabic) { if (projectProvider!.isArabic) {
projectProvider.changeLanguage('en'); projectProvider!.changeLanguage('en');
locator<GAnalytics>().hamburgerMenu.logMenuItemClick('change language to english'); locator<GAnalytics>().hamburgerMenu.logMenuItemClick('change language to english');
} else { } else {
projectProvider.changeLanguage('ar'); projectProvider!.changeLanguage('ar');
locator<GAnalytics>().hamburgerMenu.logMenuItemClick('change language to arabic'); locator<GAnalytics>().hamburgerMenu.logMenuItemClick('change language to arabic');
} }
var themeNotifier = Provider.of<ThemeNotifier>(context, listen: false); var themeNotifier = Provider.of<ThemeNotifier>(context, listen: false);
themeNotifier.setTheme(defaultTheme(fontName: projectProvider.isArabic ? 'Cairo' : 'Poppins')); themeNotifier.setTheme(defaultTheme(fontName: projectProvider!.isArabic ? 'Cairo' : 'Poppins'));
}, },
), ),
(user != null && projectProvider.isLogin) (user != null && projectProvider!.isLogin)
? Column( ? Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[ children: <Widget>[
(user.isFamily == null || user.isFamily == false) (user!.isFamily == null || user!.isFamily == false)
? InkWell( ? InkWell(
child: DrawerItem(TranslationBase.of(context).family, SvgPicture.asset("assets/images/new/family_files.svg"), child: DrawerItem(TranslationBase.of(context).family, SvgPicture.asset("assets/images/new/family_files.svg"),
isImageIcon: true, isImageIcon: true,
bottomLine: false, bottomLine: false,
textColor: Theme.of(context).textTheme.bodyText1.color, textColor: Theme.of(context).textTheme.bodyText1!.color,
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), projectProvider: projectProvider),
@ -224,12 +224,12 @@ class _AppDrawerState extends State<AppDrawer> {
return Padding(padding: EdgeInsets.all(10), child: Text('')); return Padding(padding: EdgeInsets.all(10), child: Text(''));
default: default:
if (snapshot.hasError) if (snapshot.hasError)
return Padding(padding: EdgeInsets.all(10), child: Text(snapshot.error)); return Padding(padding: EdgeInsets.all(10), child: Text(snapshot.error.toString()));
else else
return Container( return Container(
child: Column( child: Column(
children: [ children: [
user.isFamily == true user!.isFamily == true
? Container( ? Container(
padding: EdgeInsets.only(bottom: 5, left: 4), padding: EdgeInsets.only(bottom: 5, left: 4),
child: InkWell( child: InkWell(
@ -248,14 +248,14 @@ class _AppDrawerState extends State<AppDrawer> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
AppText( AppText(
mainUser.firstName + ' ' + mainUser.lastName, mainUser!.firstName + ' ' + mainUser!.lastName,
color: Color(0xff2E303A), //Theme.of(context).textTheme.bodyText1.color, color: Color(0xff2E303A), //Theme.of(context).textTheme.bodyText1.color,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 12, fontSize: 12,
letterSpacing: -0.33, letterSpacing: -0.33,
), ),
AppText( AppText(
TranslationBase.of(context).fileno + ": " + mainUser.patientID.toString(), TranslationBase.of(context).fileno + ": " + mainUser!.patientID.toString(),
color: Color(0xff989898), color: Color(0xff989898),
fontSize: 12, fontSize: 12,
letterSpacing: -0.33, letterSpacing: -0.33,
@ -276,7 +276,7 @@ class _AppDrawerState extends State<AppDrawer> {
Column( Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: snapshot.data.getAllSharedRecordsByStatusList.map<Widget>((result) { children: snapshot.data!.getAllSharedRecordsByStatusList.map<Widget>((result) {
return result.status == 3 return result.status == 3
? Container( ? Container(
padding: EdgeInsets.only(bottom: 5), padding: EdgeInsets.only(bottom: 5),
@ -288,7 +288,7 @@ class _AppDrawerState extends State<AppDrawer> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
child: Icon(Icons.person, color: result.responseID == user.patientID ? Colors.transparent : Colors.transparent), child: Icon(Icons.person, color: result.responseID == user!.patientID ? Colors.transparent : Colors.transparent),
), ),
Expanded( Expanded(
flex: 7, flex: 7,
@ -299,14 +299,14 @@ class _AppDrawerState extends State<AppDrawer> {
children: <Widget>[ children: <Widget>[
AppText( AppText(
result.patientName, result.patientName,
color: result.responseID == user.patientID ? Color(0xffC5272D) : Color(0xff2B353E), color: result.responseID == user!.patientID ? Color(0xffC5272D) : Color(0xff2B353E),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 11, fontSize: 11,
letterSpacing: -0.33, letterSpacing: -0.33,
), ),
AppText( AppText(
TranslationBase.of(context).fileno + ": " + result.responseID.toString(), TranslationBase.of(context).fileno + ": " + result.responseID.toString(),
color: result.responseID == user.patientID ? Color(0xffC5272D) : Color(0xff989898), color: result.responseID == user!.patientID ? Color(0xffC5272D) : Color(0xff989898),
fontSize: 11, fontSize: 11,
letterSpacing: -0.33, letterSpacing: -0.33,
), ),
@ -331,17 +331,17 @@ class _AppDrawerState extends State<AppDrawer> {
mHeight(20), mHeight(20),
InkWell( InkWell(
child: DrawerItem(TranslationBase.of(context).arabicChange, child: DrawerItem(TranslationBase.of(context).arabicChange,
Padding(child: Image.asset('assets/images/lang.png'), padding: EdgeInsets.only(left: 3, right: 3, top: 3, bottom: projectProvider.isArabic ? 3 : 0)), Padding(child: Image.asset('assets/images/lang.png'), padding: EdgeInsets.only(left: 3, right: 3, top: 3, bottom: projectProvider!.isArabic ? 3 : 0)),
isImageIcon: true, bottomLine: false, letterSpacing: -0.84, fontSize: 14, fontHeight: projectProvider.isArabic ? 1 : 0.8, projectProvider: projectProvider), isImageIcon: true, bottomLine: false, letterSpacing: -0.84, fontSize: 14, fontHeight: projectProvider!.isArabic ? 1 : 0.8, projectProvider: projectProvider),
onTap: () { onTap: () {
sharedPref.remove(APPOINTMENT_HISTORY_MEDICAL); sharedPref.remove(APPOINTMENT_HISTORY_MEDICAL);
sharedPref.remove(CLINICS_LIST); sharedPref.remove(CLINICS_LIST);
sharedPref.setBool(IS_ROBOT_INIT, null); sharedPref.setBool(IS_ROBOT_INIT, false);
if (projectProvider.isArabic) { if (projectProvider!.isArabic) {
projectProvider.changeLanguage('en'); projectProvider!.changeLanguage('en');
locator<GAnalytics>().hamburgerMenu.logMenuItemClick('change language to english'); locator<GAnalytics>().hamburgerMenu.logMenuItemClick('change language to english');
} else { } else {
projectProvider.changeLanguage('ar'); projectProvider!.changeLanguage('ar');
locator<GAnalytics>().hamburgerMenu.logMenuItemClick('change language to arabic'); locator<GAnalytics>().hamburgerMenu.logMenuItemClick('change language to arabic');
} }
}, },
@ -370,7 +370,7 @@ class _AppDrawerState extends State<AppDrawer> {
letterSpacing: -0.84, letterSpacing: -0.84,
fontSize: 14, fontSize: 14,
projectProvider: projectProvider, projectProvider: projectProvider,
count: toDoProvider.notificationsCount != "0" && !projectProvider.isLoginChild count: toDoProvider!.notificationsCount != "0" && !projectProvider!.isLoginChild
? new Container( ? new Container(
padding: EdgeInsets.all(4), padding: EdgeInsets.all(4),
margin: EdgeInsets.all(2), margin: EdgeInsets.all(2),
@ -383,10 +383,10 @@ class _AppDrawerState extends State<AppDrawer> {
minHeight: 20, minHeight: 20,
), ),
child: new Text( child: new Text(
toDoProvider.notificationsCount.toString(), toDoProvider!.notificationsCount.toString(),
style: new TextStyle( style: new TextStyle(
color: Colors.white, color: Colors.white,
fontSize: projectProvider.isArabic ? 8 : 9, fontSize: projectProvider!.isArabic ? 8 : 9,
), ),
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),
@ -399,11 +399,11 @@ class _AppDrawerState extends State<AppDrawer> {
onTap: () { onTap: () {
//NotificationsPage //NotificationsPage
// Navigator.of(context).pop(); // Navigator.of(context).pop();
if (!projectProvider.isLoginChild) Navigator.push(context, FadePage(page: NotificationsPage())); if (!projectProvider!.isLoginChild) Navigator.push(context, FadePage(page: NotificationsPage()));
locator<GAnalytics>().hamburgerMenu.logMenuItemClick('notifications'); locator<GAnalytics>().hamburgerMenu.logMenuItemClick('notifications');
}, },
), ),
if (projectProvider.havePrivilege(3)) if (projectProvider!.havePrivilege(3))
InkWell( InkWell(
child: DrawerItem(TranslationBase.of(context).appsetting, SvgPicture.asset("assets/images/new/app_setting.svg"), child: DrawerItem(TranslationBase.of(context).appsetting, SvgPicture.asset("assets/images/new/app_setting.svg"),
isImageIcon: true, bottomLine: false, letterSpacing: -0.84, fontSize: 14, projectProvider: projectProvider), isImageIcon: true, bottomLine: false, letterSpacing: -0.84, fontSize: 14, projectProvider: projectProvider),
@ -445,7 +445,7 @@ class _AppDrawerState extends State<AppDrawer> {
InkWell( InkWell(
child: DrawerItem(TranslationBase.of(context).privacyPolicy, Icons.web, letterSpacing: -0.84, fontSize: 14, bottomLine: false), child: DrawerItem(TranslationBase.of(context).privacyPolicy, Icons.web, letterSpacing: -0.84, fontSize: 14, bottomLine: false),
onTap: () { onTap: () {
if (projectProvider.isArabic) if (projectProvider!.isArabic)
launch("https://hmg.com/ar/Pages/Privacy.aspx"); launch("https://hmg.com/ar/Pages/Privacy.aspx");
else else
launch("https://hmg.com/en/Pages/Privacy.aspx"); launch("https://hmg.com/en/Pages/Privacy.aspx");
@ -546,7 +546,7 @@ class _AppDrawerState extends State<AppDrawer> {
} }
readQRCode() async { readQRCode() async {
pharmacyLiveCareQRCode = (await BarcodeScanner.scan())?.rawContent; pharmacyLiveCareQRCode = (await BarcodeScanner.scan()).rawContent;
print(pharmacyLiveCareQRCode); print(pharmacyLiveCareQRCode);
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
LiveCareService service = new LiveCareService(); LiveCareService service = new LiveCareService();
@ -597,12 +597,12 @@ class _AppDrawerState extends State<AppDrawer> {
cancelText: TranslationBase.of(context).cancel_nocaps, cancelText: TranslationBase.of(context).cancel_nocaps,
okFunction: () async { okFunction: () async {
authenticatedUserObject.logout(); authenticatedUserObject.logout();
projectProvider.isLogin = false; projectProvider!.isLogin = false;
await authenticatedUserObject.getUser(); await authenticatedUserObject.getUser();
_vitalSignService.heightCm = ""; _vitalSignService.heightCm = "";
_vitalSignService.weightKg = ""; _vitalSignService.weightKg = "";
await _privilegeService.getPrivilege(); await _privilegeService.getPrivilege();
projectProvider.setPrivilegeModelList(privilege: _privilegeService.privilegeModelList); projectProvider!.setPrivilegeModelList(privilege: _privilegeService.privilegeModelList);
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);
@ -653,6 +653,7 @@ class _AppDrawerState extends State<AppDrawer> {
return familyFileProvider.getSharedRecordByStatus(); return familyFileProvider.getSharedRecordByStatus();
} }
} }
return familyFileProvider.getSharedRecordByStatus();
} }
switchUser(user, context) { switchUser(user, context) {
@ -747,12 +748,12 @@ class _AppDrawerState extends State<AppDrawer> {
} }
getToDoCount() { getToDoCount() {
toDoProvider.setState(0, true, toDoProvider.notificationsCount); toDoProvider!.setState(0, true, toDoProvider!.notificationsCount);
ClinicListService service = new ClinicListService(); ClinicListService service = new ClinicListService();
service.getActiveAppointmentNo(context).then((res) { service.getActiveAppointmentNo(context).then((res) {
print(res['AppointmentActiveNumber']); print(res['AppointmentActiveNumber']);
if (res['MessageStatus'] == 1 && res['AppointmentActiveNumber'] != null) { if (res['MessageStatus'] == 1 && res['AppointmentActiveNumber'] != null) {
toDoProvider.setState(res['AppointmentActiveNumber'], true, toDoProvider.notificationsCount); toDoProvider!.setState(res['AppointmentActiveNumber'], true, toDoProvider!.notificationsCount);
} else {} } else {}
}).catchError((err) { }).catchError((err) {
print(err); print(err);

@ -7,19 +7,19 @@ import 'package:flutter/material.dart';
/// ///
class DrawerItem extends StatefulWidget { class DrawerItem extends StatefulWidget {
final String title; final String? title;
final String subTitle; final String? subTitle;
final icon; final icon;
final Color textColor; final Color? textColor;
final Color iconColor; final Color? iconColor;
final bool bottomLine; final bool? bottomLine;
final bool sideArrow; final bool? sideArrow;
final Widget count; final Widget? count;
final bool isImageIcon; final bool? isImageIcon;
final double fontHeight; final double? fontHeight;
final double letterSpacing; final double? letterSpacing;
final double fontSize; final double? fontSize;
final ProjectViewModel projectProvider; 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.projectProvider}); {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});
@ -37,7 +37,7 @@ class _DrawerItemState extends State<DrawerItem> {
border: Border( border: Border(
bottom: BorderSide( bottom: BorderSide(
// <--- left side // <--- left side
color: Colors.grey[200], color: Colors.grey[200]!,
width: 1.0, width: 1.0,
), ),
)) ))
@ -52,7 +52,7 @@ class _DrawerItemState extends State<DrawerItem> {
? widget.icon ? widget.icon
: Icon( : Icon(
widget.icon, widget.icon,
color: widget.iconColor == null ? Theme.of(context).textTheme.bodyText1.color : widget.iconColor, color: widget.iconColor == null ? Theme.of(context).textTheme.bodyText1?.color : widget.iconColor,
size: SizeConfig.imageSizeMultiplier * 5, size: SizeConfig.imageSizeMultiplier * 5,
)), )),
Expanded( Expanded(
@ -61,7 +61,7 @@ class _DrawerItemState extends State<DrawerItem> {
Row( Row(
children: [ children: [
AppText( AppText(
widget.title, widget.title!,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: widget.fontSize, fontSize: widget.fontSize,
height: widget.fontHeight, height: widget.fontHeight,
@ -72,12 +72,12 @@ class _DrawerItemState extends State<DrawerItem> {
), ),
widget.subTitle != '' widget.subTitle != ''
? AppText( ? AppText(
widget.subTitle, widget.subTitle!,
fontSize: SizeConfig.textMultiplier * 2.5, fontSize: SizeConfig.textMultiplier * 2.5,
) )
: SizedBox(), : 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()), 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()),
], ],
), ),
)); ));

@ -6,8 +6,8 @@ import 'package:flutter/material.dart';
/// [error] the message we show to the user /// [error] the message we show to the user
class AppEmbeddedError extends StatelessWidget { class AppEmbeddedError extends StatelessWidget {
const AppEmbeddedError({ const AppEmbeddedError({
Key key, required Key key,
@required this.error, required this.error,
}) : super(key: key); }) : super(key: key);
final String error; final String error;

@ -3,7 +3,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart'; import 'package:flutter_svg/svg.dart';
class HabibLogoWidget extends StatelessWidget { class HabibLogoWidget extends StatelessWidget {
HabibLogoWidget({Key key}) : super(key: key); HabibLogoWidget({Key? key}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Row( return Row(

@ -14,7 +14,7 @@ class HospitalLocation extends StatelessWidget {
final bool showCity; final bool showCity;
final String waitingTime; final String waitingTime;
HospitalLocation(this.location, {Key key, this.showCity = false, this.waitingTime}) : super(key: key); HospitalLocation(this.location, {Key? key, this.showCity = false, required this.waitingTime}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -60,7 +60,7 @@ class HospitalLocation extends StatelessWidget {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
if (showCity) MyRichText(TranslationBase.of(context).city + ":", location.cityName?.trim().toString(), projectViewModel.isArabic), if (showCity) MyRichText(TranslationBase.of(context).city + ":", location.cityName!.trim().toString(), projectViewModel.isArabic),
MyRichText(TranslationBase.of(context).distance + ":", location.distanceInKilometers.toString() + " " + TranslationBase.of(context).km_ ?? "", projectViewModel.isArabic), MyRichText(TranslationBase.of(context).distance + ":", location.distanceInKilometers.toString() + " " + TranslationBase.of(context).km_ ?? "", projectViewModel.isArabic),
if (waitingTime != null) MyRichText(TranslationBase.of(context).waitingTime, waitingTime, projectViewModel.isArabic), if (waitingTime != null) MyRichText(TranslationBase.of(context).waitingTime, waitingTime, projectViewModel.isArabic),
], ],

@ -30,14 +30,14 @@ var _InAppBrowserOptions = InAppBrowserClassOptions(
ios: IOSInAppBrowserOptions(hideToolbarBottom: true, toolbarBottomBackgroundColor: Colors.white, closeButtonColor: Colors.white, presentationStyle: IOSUIModalPresentationStyle.OVER_FULL_SCREEN)); ios: IOSInAppBrowserOptions(hideToolbarBottom: true, toolbarBottomBackgroundColor: Colors.white, closeButtonColor: Colors.white, presentationStyle: IOSUIModalPresentationStyle.OVER_FULL_SCREEN));
class MyInAppBrowser extends InAppBrowser { class MyInAppBrowser extends InAppBrowser {
_PAYMENT_TYPE paymentType; _PAYMENT_TYPE? paymentType;
// static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL LIVE // static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL LIVE
static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL UAT static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL UAT
// static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT
static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE
// static String SERVICE_URL = 'https://uat.hmgwebservices.com/payfortforvidaplus/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL UAT VIDA PLUS // static String SERVICE_URL = 'https://uat.hmgwebservices.com/payfortforvidaplus/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL UAT VIDA PLUS
@ -55,18 +55,18 @@ class MyInAppBrowser extends InAppBrowser {
static List<String> errorURLS = ['PayfortCancel', 'errorpage', 'Failed', 'orderdetails', 'redirectToApplePay', 'mdlaboratories.com/?', 'cancel', 'canceled']; static List<String> errorURLS = ['PayfortCancel', 'errorpage', 'Failed', 'orderdetails', 'redirectToApplePay', 'mdlaboratories.com/?', 'cancel', 'canceled'];
final Function onExitCallback; final Function? onExitCallback;
final Function onLoadStartCallback; final Function? onLoadStartCallback;
final BuildContext context; final BuildContext? context;
AppSharedPreferences sharedPref = AppSharedPreferences(); AppSharedPreferences sharedPref = AppSharedPreferences();
AuthProvider authProvider = new AuthProvider(); AuthProvider authProvider = new AuthProvider();
InAppBrowser browser = new InAppBrowser(); InAppBrowser browser = new InAppBrowser();
// AuthenticatedUser authUser; // AuthenticatedUser authUser;
AppoitmentAllHistoryResultList appo; late AppoitmentAllHistoryResultList? appo;
String deviceToken; String deviceToken = "";
double lat = 0.0; double lat = 0.0;
double long = 0.0; double long = 0.0;
@ -80,17 +80,19 @@ class MyInAppBrowser extends InAppBrowser {
} }
@override @override
Future onLoadStart(Uri url) async { Future onLoadStart(Uri? url) async {
if (onLoadStartCallback != null) onLoadStartCallback(url.toString()); if (onLoadStartCallback != null) onLoadStartCallback!(url.toString());
} }
@override @override
Future onLoadStop(Uri url) async { Future onLoadStop(Uri? url) async {
print("\n\nStopped $url\n\n"); print("\n\nStopped $url\n\n");
} }
@override @override
void onLoadError(Uri url, int code, String message) { void onLoadError(Uri? url, int code, String message) {
print("Can't load $url.. Error: $message"); print("Can't load $url.. Error: $message");
} }
@ -100,7 +102,7 @@ class MyInAppBrowser extends InAppBrowser {
@override @override
void onExit() { void onExit() {
print("\n\nBrowser closed!\n\n"); print("\n\nBrowser closed!\n\n");
if (onExitCallback != null) onExitCallback(appo, isPaymentDone); if (onExitCallback != null) onExitCallback!(appo, isPaymentDone);
} }
@override @override
@ -125,7 +127,7 @@ class MyInAppBrowser extends InAppBrowser {
this.deviceToken = deviceToken; this.deviceToken = deviceToken;
} }
openPackagesPaymentBrowser({@required int customer_id, @required int order_id}) { openPackagesPaymentBrowser({required int customer_id, required int order_id}) {
paymentType = _PAYMENT_TYPE.PACKAGES; paymentType = _PAYMENT_TYPE.PACKAGES;
var full_url = '$PACKAGES_REQUEST_PAYMENT_URL?customer_id=$customer_id&order_id=$order_id'; var full_url = '$PACKAGES_REQUEST_PAYMENT_URL?customer_id=$customer_id&order_id=$order_id';
this.openUrlRequest(urlRequest: URLRequest(url: Uri.parse(full_url)), options: _InAppBrowserOptions); this.openUrlRequest(urlRequest: URLRequest(url: Uri.parse(full_url)), options: _InAppBrowserOptions);
@ -138,7 +140,7 @@ class MyInAppBrowser extends InAppBrowser {
// await getPatientData(); // await getPatientData();
if (paymentMethod == "ApplePay") { if (paymentMethod == "ApplePay") {
getDeviceToken(); getDeviceToken();
MyChromeSafariBrowser safariBrowser = new MyChromeSafariBrowser(new MyInAppBrowser(), onExitCallback: browser.onExit, onLoadStartCallback: this.browser.onLoadStart, appo: this.appo); MyChromeSafariBrowser safariBrowser = new MyChromeSafariBrowser(new MyInAppBrowser(), onExitCallback: browser.onExit, onLoadStartCallback: this.browser.onLoadStart, appo: this.appo!);
if (context != null) GifLoaderDialogUtils.showMyDialog(context); if (context != null) GifLoaderDialogUtils.showMyDialog(context);
@ -242,7 +244,7 @@ class MyInAppBrowser extends InAppBrowser {
openPharmacyPaymentBrowser(OrderDetailModel order, double amount, String orderDesc, String transactionID, String emailId, String paymentMethod, String patientName, dynamic patientID, openPharmacyPaymentBrowser(OrderDetailModel order, double amount, String orderDesc, String transactionID, String emailId, String paymentMethod, String patientName, dynamic patientID,
AuthenticatedUser authenticatedUser, InAppBrowser browser) { AuthenticatedUser authenticatedUser, InAppBrowser browser) {
this.browser = browser; this.browser = browser;
MyChromeSafariBrowser safariBrowser = new MyChromeSafariBrowser(new MyInAppBrowser(), onExitCallback: browser.onExit, onLoadStartCallback: this.browser.onLoadStart, appo: this.appo); MyChromeSafariBrowser safariBrowser = new MyChromeSafariBrowser(new MyInAppBrowser(), onExitCallback: browser.onExit, onLoadStartCallback: this.browser.onLoadStart, appo: this.appo!);
// getPatientData(); // getPatientData();
generatePharmacyURL(order, amount, orderDesc, transactionID, emailId, paymentMethod, patientName, patientID, authenticatedUser).then((value) { generatePharmacyURL(order, amount, orderDesc, transactionID, emailId, paymentMethod, patientName, patientID, authenticatedUser).then((value) {
if (order.customValuesXml.contains("ApplePay")) { if (order.customValuesXml.contains("ApplePay")) {
@ -469,7 +471,7 @@ class MyChromeSafariBrowser extends ChromeSafariBrowser {
final Function onLoadStartCallback; final Function onLoadStartCallback;
AppoitmentAllHistoryResultList appo; AppoitmentAllHistoryResultList appo;
MyChromeSafariBrowser(browserFallback, {@required this.onExitCallback, @required this.onLoadStartCallback, @required this.appo}); MyChromeSafariBrowser(browserFallback, {required this.onExitCallback, required this.onLoadStartCallback, required this.appo});
@override @override
void onOpened() { void onOpened() {

@ -1,72 +1,72 @@
import 'package:flutter/animation.dart'; // import 'package:flutter/animation.dart';
import 'package:flutter/foundation.dart'; // import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart'; // import 'package:flutter/material.dart';
//
/// Custom switch widget // /// Custom switch widget
/// [value] switch is active or not // /// [value] switch is active or not
/// [onChanged] function to be executed after sometime // /// [onChanged] function to be executed after sometime
/// [activeColor] color of active status // /// [activeColor] color of active status
/// [inactiveColor] color of inactive status // /// [inactiveColor] color of inactive status
class CustomSwitch extends StatefulWidget { // class CustomSwitch extends StatefulWidget {
final bool value; // final bool value;
final AsyncCallback onChanged; // final AsyncCallback onChanged;
final Color activeColor; // final Color activeColor;
final Color inactiveColor; // final Color inactiveColor;
//
CustomSwitch({Key key, this.value, this.onChanged, this.activeColor, this.inactiveColor}) : super(key: key); // CustomSwitch({Key key, this.value, this.onChanged, this.activeColor, this.inactiveColor}) : super(key: key);
//
@override // @override
_CustomSwitchState createState() => _CustomSwitchState(); // _CustomSwitchState createState() => _CustomSwitchState();
} // }
//
class _CustomSwitchState extends State<CustomSwitch> with SingleTickerProviderStateMixin { // class _CustomSwitchState extends State<CustomSwitch> with SingleTickerProviderStateMixin {
Animation _circleAnimation; // Animation _circleAnimation;
AnimationController _animationController; // AnimationController _animationController;
//
@override // @override
void initState() { // void initState() {
super.initState(); // super.initState();
_animationController = AnimationController(vsync: this, duration: Duration(milliseconds: 500)); // _animationController = AnimationController(vsync: this, duration: Duration(milliseconds: 500));
_circleAnimation = Tween(begin: 0.0, end: 22.0).animate(CurvedAnimation(parent: _animationController, curve: Curves.easeOutQuint, reverseCurve: Curves.easeInQuint)); // _circleAnimation = Tween(begin: 0.0, end: 22.0).animate(CurvedAnimation(parent: _animationController, curve: Curves.easeOutQuint, reverseCurve: Curves.easeInQuint));
if (widget.value) _animationController.forward(); // if (widget.value) _animationController.forward();
} // }
//
@override // @override
Widget build(BuildContext context) { // Widget build(BuildContext context) {
return AnimatedBuilder( // return AnimatedBuilder(
animation: _animationController, // animation: _animationController,
builder: (context, child) { // builder: (context, child) {
bool _switchStatus = _circleAnimation.status == AnimationStatus.dismissed || _circleAnimation.status == AnimationStatus.reverse; // bool _switchStatus = _circleAnimation.status == AnimationStatus.dismissed || _circleAnimation.status == AnimationStatus.reverse;
return GestureDetector( // return GestureDetector(
onTap: Feedback.wrapForTap(() async { // onTap: Feedback.wrapForTap(() async {
if (widget.value) { // if (widget.value) {
_animationController.reverse(); // _animationController.reverse();
} else { // } else {
_animationController.forward(); // _animationController.forward();
} // }
await widget.onChanged(); // await widget.onChanged();
}, context), // }, context),
child: AnimatedContainer( // child: AnimatedContainer(
duration: Duration(milliseconds: 200), // duration: Duration(milliseconds: 200),
width: 50.0, // width: 50.0,
height: 25.0, // height: 25.0,
decoration: BoxDecoration(borderRadius: BorderRadius.circular(20.0), color: _switchStatus ? widget.inactiveColor : widget.activeColor), // decoration: BoxDecoration(borderRadius: BorderRadius.circular(20.0), color: _switchStatus ? widget.inactiveColor : widget.activeColor),
child: Padding( // child: Padding(
padding: EdgeInsets.only(top: 4.0, bottom: 4.0, right: 6.0, left: 6.0), // padding: EdgeInsets.only(top: 4.0, bottom: 4.0, right: 6.0, left: 6.0),
child: Row( // child: Row(
children: <Widget>[ // children: <Widget>[
Container(width: _circleAnimation.value), // Container(width: _circleAnimation.value),
Container( // Container(
width: 16.0, // width: 16.0,
height: 16.0, // height: 16.0,
decoration: BoxDecoration(boxShadow: [BoxShadow(color: Colors.grey[800].withOpacity(0.15), offset: Offset(0, 4.0), blurRadius: 5.0)], shape: BoxShape.circle, color: Colors.white), // decoration: BoxDecoration(boxShadow: [BoxShadow(color: Colors.grey[800].withOpacity(0.15), offset: Offset(0, 4.0), blurRadius: 5.0)], shape: BoxShape.circle, color: Colors.white),
) // )
], // ],
), // ),
), // ),
), // ),
); // );
}, // },
); // );
} // }
} // }

@ -1,26 +1,26 @@
import 'package:diplomaticquarterapp/widgets/Buttons/button.dart'; // import 'package:diplomaticquarterapp/widgets/Buttons/button.dart';
import 'package:flutter/cupertino.dart'; // import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; // import 'package:flutter/material.dart';
//
class ButtonActions extends StatelessWidget { // class ButtonActions extends StatelessWidget {
final VoidCallback onPositive; // final VoidCallback onPositive;
//
const ButtonActions({ // const ButtonActions({
Key key, // Key key,
@required this.onPositive, // @required this.onPositive,
}) : super(key: key); // }) : super(key: key);
//
@override // @override
Widget build(BuildContext context) { // Widget build(BuildContext context) {
return Container( // return Container(
margin: EdgeInsets.only(bottom: 12.0), // margin: EdgeInsets.only(bottom: 12.0),
child: FractionallySizedBox( // child: FractionallySizedBox(
widthFactor: 0.6, // widthFactor: 0.6,
child: Button( // child: Button(
onTap: onPositive, // onTap: onPositive,
label: "Confirm", // label: "Confirm",
), // ),
), // ),
); // );
} // }
} // }

File diff suppressed because it is too large Load Diff

@ -37,262 +37,262 @@ class NumberTextInputFormatter extends TextInputFormatter {
final _mobileFormatter = NumberTextInputFormatter(); final _mobileFormatter = NumberTextInputFormatter();
class TextFields extends StatefulWidget { // class TextFields extends StatefulWidget {
TextFields( // TextFields(
{Key key, // {Key? key,
this.type, // this.type,
this.hintText, // this.hintText,
this.suffixIcon, // this.suffixIcon,
this.autoFocus, // this.autoFocus,
this.onChanged, // this.onChanged,
this.initialValue, // this.initialValue,
this.minLines, // this.minLines,
this.maxLines, // this.maxLines,
this.inputFormatters, // this.inputFormatters,
this.padding, // this.padding,
this.focus = false, // this.focus = false,
this.maxLengthEnforced = true, // this.maxLengthEnforced = true,
this.suffixIconColor, // this.suffixIconColor,
this.inputAction, // this.inputAction,
this.onSubmit, // this.onSubmit,
this.keepPadding = true, // this.keepPadding = true,
this.textCapitalization = TextCapitalization.none, // this.textCapitalization = TextCapitalization.none,
this.controller, // this.controller,
this.keyboardType, // this.keyboardType,
this.validator, // this.validator,
this.borderOnlyError = false, // this.borderOnlyError = false,
this.onSaved, // this.onSaved,
this.onSuffixTap, // this.onSuffixTap,
this.readOnly: false, // this.readOnly= false,
this.maxLength, // this.maxLength,
this.prefixIcon, // this.prefixIcon,
this.bare = false, // this.bare = false,
this.onTap, // this.onTap,
this.fontSize = 16.0, // this.fontSize = 16.0,
this.fontWeight = FontWeight.w700, // this.fontWeight = FontWeight.w700,
this.fillColor, // this.fillColor,
this.hintColor}) // this.hintColor})
: super(key: key); // : super(key: key);
//
final String hintText; // final String? hintText;
final String initialValue; // final String? initialValue;
final String type; // final String? type;
final bool autoFocus; // final bool? autoFocus;
final IconData suffixIcon; // final IconData? suffixIcon;
final Color suffixIconColor; // final Color? suffixIconColor;
final Icon prefixIcon; // final Icon? prefixIcon;
final VoidCallback onTap; // final VoidCallback? onTap;
final TextEditingController controller; // final TextEditingController? controller;
final TextInputType keyboardType; // final TextInputType? keyboardType;
final FormFieldValidator validator; // final FormFieldValidator? validator;
final Function onSaved; // final Function? onSaved;
final Function onSuffixTap; // final Function? onSuffixTap;
final Function onChanged; // final Function? onChanged;
final Function onSubmit; // final Function? onSubmit;
final bool readOnly; // final bool? readOnly;
final int maxLength; // final int? maxLength;
final int minLines; // final int? minLines;
final int maxLines; // final int? maxLines;
final bool maxLengthEnforced; // final bool? maxLengthEnforced;
final bool bare; // final bool? bare;
final TextInputAction inputAction; // final TextInputAction? inputAction;
final double fontSize; // final double? fontSize;
final FontWeight fontWeight; // final FontWeight? fontWeight;
final bool keepPadding; // final bool? keepPadding;
final TextCapitalization textCapitalization; // final TextCapitalization? textCapitalization;
final List<TextInputFormatter> inputFormatters; // final List<TextInputFormatter>? inputFormatters;
final EdgeInsets padding; // final EdgeInsets? padding;
final bool focus; // final bool? focus;
final bool borderOnlyError; // final bool? borderOnlyError;
final Color hintColor; // final Color? hintColor;
final Color fillColor; // final Color? fillColor;
//
@override // @override
_TextFieldsState createState() => _TextFieldsState(); // _TextFieldsState createState() => _TextFieldsState();
} // }
//
class _TextFieldsState extends State<TextFields> { // class _TextFieldsState extends State<TextFields> {
final FocusNode _focusNode = FocusNode(); // final FocusNode _focusNode = FocusNode();
bool focus = false; // bool? focus = false;
bool view = false; // bool? view = false;
//
@override // @override
void initState() { // void initState() {
super.initState(); // super.initState();
_focusNode.addListener(() { // _focusNode.addListener(() {
setState(() { // setState(() {
focus = _focusNode.hasFocus; // focus = _focusNode.hasFocus;
}); // });
}); // });
} // }
//
@override // @override
void didUpdateWidget(TextFields oldWidget) { // void didUpdateWidget(TextFields oldWidget) {
if (widget.focus) _focusNode.requestFocus(); // if (widget.focus != null) _focusNode.requestFocus();
super.didUpdateWidget(oldWidget); // super.didUpdateWidget(oldWidget);
} // }
//
@override // @override
void dispose() { // void dispose() {
_focusNode.dispose(); // _focusNode.dispose();
super.dispose(); // super.dispose();
} // }
//
Widget _buildSuffixIcon() { // Widget _buildSuffixIcon() {
switch (widget.type) { // switch (widget.type) {
case "password": // case "password":
return Padding( // return Padding(
padding: const EdgeInsets.only(right: 8.0), // padding: const EdgeInsets.only(right: 8.0),
child: view // child: view!
? InkWell( // ? InkWell(
onTap: () { // onTap: () {
this.setState( // this.setState(
() { // () {
view = false; // view = false;
}, // },
); // );
}, // },
child: Icon( // child: Icon(
Icons.remove_red_eye_sharp, // Icons.remove_red_eye_sharp,
size: 24.0, // size: 24.0,
color: Color.fromRGBO(78, 62, 253, 1.0), // color: Color.fromRGBO(78, 62, 253, 1.0),
), // ),
) // )
: InkWell( // : InkWell(
onTap: () { // onTap: () {
this.setState(() { // this.setState(() {
view = true; // view = true;
}); // });
}, // },
child: Icon(Icons.remove_red_eye_sharp, // child: Icon(Icons.remove_red_eye_sharp,
size: 24.0, color: Colors.grey[500]), // size: 24.0, color: Colors.grey[500]),
), // ),
); // );
default: // default:
if (widget.suffixIcon != null) // if (widget.suffixIcon != null)
return InkWell( // return InkWell(
onTap: widget.onSuffixTap, // onTap: widget.onSuffixTap,
child: Icon(widget.suffixIcon, // child: Icon(widget.suffixIcon,
size: 22.0, // size: 22.0,
color: widget.suffixIconColor != null // color: widget.suffixIconColor != null
? widget.suffixIconColor // ? widget.suffixIconColor
: Colors.grey[500]), // : Colors.grey[500]),
); // );
else // else
return null; // return null;
} // }
} // }
//
bool _determineReadOnly() { // bool _determineReadOnly() {
if (widget.readOnly != null && widget.readOnly) { // if (widget.readOnly != null && widget.readOnly!) {
_focusNode.unfocus(); // _focusNode.unfocus();
return true; // return true;
} else { // } else {
return false; // return false;
} // }
} // }
//
@override // @override
Widget build(BuildContext context) { // Widget build(BuildContext context) {
return (AnimatedContainer( // return (AnimatedContainer(
duration: Duration(milliseconds: 300), // duration: Duration(milliseconds: 300),
decoration: widget.bare // decoration: widget.bare!
? null // ? null
: BoxDecoration(boxShadow: [ // : BoxDecoration(boxShadow: [
// // BoxShadow(
// // color: Color.fromRGBO(70, 68, 167, focus ? 0.20 : 0),
// // offset: Offset(0.0, 13.0),
// // blurRadius: focus ? 34.0 : 12.0)
// BoxShadow( // BoxShadow(
// color: Color.fromRGBO(70, 68, 167, focus ? 0.20 : 0), // color: Color.fromRGBO(110, 68, 80, focus ? 0.20 : 0),
// offset: Offset(0.0, 13.0), // offset: Offset(0.0, 13.0),
// blurRadius: focus ? 34.0 : 12.0) // blurRadius: focus ? 34.0 : 12.0)
BoxShadow( // ]),
color: Color.fromRGBO(110, 68, 80, focus ? 0.20 : 0), // child: TextFormField(
offset: Offset(0.0, 13.0), // keyboardAppearance: Theme.of(context).brightness,
blurRadius: focus ? 34.0 : 12.0) // scrollPhysics: BouncingScrollPhysics(),
]), // textCapitalization: widget.textCapitalization,
child: TextFormField( // onFieldSubmitted: widget.inputAction == TextInputAction.next
keyboardAppearance: Theme.of(context).brightness, // ? (widget.onSubmit != null
scrollPhysics: BouncingScrollPhysics(), // ? widget.onSubmit
textCapitalization: widget.textCapitalization, // : (val) {
onFieldSubmitted: widget.inputAction == TextInputAction.next // _focusNode.nextFocus();
? (widget.onSubmit != null // })
? widget.onSubmit // : widget.onSubmit,
: (val) { // textInputAction: widget.inputAction,
_focusNode.nextFocus(); // minLines: widget.minLines ?? 1,
}) // maxLines: widget.maxLines ?? 1,
: widget.onSubmit, // // maxLengthEnforcement: widget.maxLengthEnforced,
textInputAction: widget.inputAction, // initialValue: widget.initialValue,
minLines: widget.minLines ?? 1, // onChanged: widget.onChanged,
maxLines: widget.maxLines ?? 1, // focusNode: _focusNode,
// maxLengthEnforcement: widget.maxLengthEnforced, // maxLength: widget.maxLength ?? null,
initialValue: widget.initialValue, // controller: widget.controller,
onChanged: widget.onChanged, // keyboardType: widget.keyboardType,
focusNode: _focusNode, // readOnly: _determineReadOnly(),
maxLength: widget.maxLength ?? null, // obscureText: widget.type == "password" && !view ? true : false,
controller: widget.controller, // autofocus: widget.autoFocus ?? false,
keyboardType: widget.keyboardType, // validator: widget.validator,
readOnly: _determineReadOnly(), // onSaved: widget.onSaved,
obscureText: widget.type == "password" && !view ? true : false, // style: Theme.of(context)
autofocus: widget.autoFocus ?? false, // .textTheme
validator: widget.validator, // .bodyText1
onSaved: widget.onSaved, // .copyWith(fontSize: widget.fontSize, fontWeight: widget.fontWeight),
style: Theme.of(context) // inputFormatters: widget.keyboardType == TextInputType.phone
.textTheme // ? <TextInputFormatter>[
.bodyText1 // FilteringTextInputFormatter.digitsOnly,
.copyWith(fontSize: widget.fontSize, fontWeight: widget.fontWeight), // _mobileFormatter,
inputFormatters: widget.keyboardType == TextInputType.phone // ]
? <TextInputFormatter>[ // : widget.inputFormatters,
FilteringTextInputFormatter.digitsOnly, // decoration: InputDecoration(
_mobileFormatter, // counterText: "",
] // hintText: widget.hintText,
: widget.inputFormatters, // hintStyle: TextStyle(
decoration: InputDecoration( // fontSize: widget.fontSize,
counterText: "", // fontWeight: widget.fontWeight,
hintText: widget.hintText, // color: widget.hintColor ?? Theme.of(context).hintColor,
hintStyle: TextStyle( // ),
fontSize: widget.fontSize, // contentPadding: widget.padding != null
fontWeight: widget.fontWeight, // ? widget.padding
color: widget.hintColor ?? Theme.of(context).hintColor, // : EdgeInsets.symmetric(
), // vertical: (widget.bare && !widget.keepPadding) ? 0.0 : 10.0,
contentPadding: widget.padding != null // horizontal: 16.0),
? widget.padding // filled: true,
: EdgeInsets.symmetric( // fillColor: widget.bare
vertical: (widget.bare && !widget.keepPadding) ? 0.0 : 10.0, // ? Colors.transparent
horizontal: 16.0), // : Theme.of(context).backgroundColor,
filled: true, // suffixIcon: _buildSuffixIcon(),
fillColor: widget.bare // prefixIcon: widget.prefixIcon,
? Colors.transparent // errorStyle: TextStyle(
: Theme.of(context).backgroundColor, // fontSize: 14.0,
suffixIcon: _buildSuffixIcon(), // fontWeight: widget.fontWeight,
prefixIcon: widget.prefixIcon, // height: widget.borderOnlyError ? 0.0 : null),
errorStyle: TextStyle( // errorBorder: OutlineInputBorder(
fontSize: 14.0, // borderSide: BorderSide(
fontWeight: widget.fontWeight, // color: Theme.of(context)
height: widget.borderOnlyError ? 0.0 : null), // .errorColor
errorBorder: OutlineInputBorder( // .withOpacity(widget.bare ? 0.0 : 0.5),
borderSide: BorderSide( // width: 1.0),
color: Theme.of(context) // borderRadius: BorderRadius.circular(widget.bare ? 0.0 : 8.0)),
.errorColor // focusedErrorBorder: OutlineInputBorder(
.withOpacity(widget.bare ? 0.0 : 0.5), // borderSide: BorderSide(
width: 1.0), // color: Theme.of(context)
borderRadius: BorderRadius.circular(widget.bare ? 0.0 : 8.0)), // .errorColor
focusedErrorBorder: OutlineInputBorder( // .withOpacity(widget.bare ? 0.0 : 0.5),
borderSide: BorderSide( // width: 1.0),
color: Theme.of(context) // borderRadius: BorderRadius.circular(widget.bare ? 0.0 : 8.0)),
.errorColor // focusedBorder: OutlineInputBorder(
.withOpacity(widget.bare ? 0.0 : 0.5), // borderSide: BorderSide(color: Colors.grey, width: 1.0),
width: 1.0), // borderRadius: BorderRadius.circular(widget.bare ? 0.0 : 8.0)),
borderRadius: BorderRadius.circular(widget.bare ? 0.0 : 8.0)), // disabledBorder: OutlineInputBorder(
focusedBorder: OutlineInputBorder( // borderSide: BorderSide(color: Colors.grey, width: 1.0),
borderSide: BorderSide(color: Colors.grey, width: 1.0), // borderRadius: BorderRadius.circular(widget.bare ? 0.0 : 8.0)),
borderRadius: BorderRadius.circular(widget.bare ? 0.0 : 8.0)), // enabledBorder: OutlineInputBorder(
disabledBorder: OutlineInputBorder( // borderSide: BorderSide(color: Colors.grey, width: 1.0),
borderSide: BorderSide(color: Colors.grey, width: 1.0), // borderRadius: BorderRadius.circular(widget.bare ? 0.0 : 8.0),
borderRadius: BorderRadius.circular(widget.bare ? 0.0 : 8.0)), // ),
enabledBorder: OutlineInputBorder( // ),
borderSide: BorderSide(color: Colors.grey, width: 1.0), // ),
borderRadius: BorderRadius.circular(widget.bare ? 0.0 : 8.0), // ));
), // }
), // }
),
));
}
}

@ -6,10 +6,10 @@ import 'package:flutter/material.dart';
import 'package:shimmer/shimmer.dart'; import 'package:shimmer/shimmer.dart';
class ShimmerLoadingWidget extends StatefulWidget { class ShimmerLoadingWidget extends StatefulWidget {
Future<void> Function() onPreProccess; Future<void> Function()? onPreProccess;
Widget Function() loadingWidget; Widget Function()? loadingWidget;
Widget Function() realWidget; Widget Function()? realWidget;
Function() onFinish; Function()? onFinish;
ShimmerLoadingWidget({this.onPreProccess, this.loadingWidget, this.realWidget, this.onFinish}); ShimmerLoadingWidget({this.onPreProccess, this.loadingWidget, this.realWidget, this.onFinish});
void loadWidget() {} void loadWidget() {}
@ -23,15 +23,15 @@ class _ShimmerLoadingWidgetState extends State<ShimmerLoadingWidget> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
Stream<bool> preProccess = (() async* { Stream preProccess = (() async* {
await super.widget.onPreProccess(); await super.widget.onPreProccess!();
})(); })();
// TODO: implement build // TODO: implement build
return StreamBuilder( return StreamBuilder(
stream: preProccess, stream: preProccess,
builder: (context, snapshot) { builder: (context, snapshot) {
Widget widget; Widget? widget;
if (snapshot.hasError) { if (snapshot.hasError) {
widget = Texts( widget = Texts(
"Error happened", "Error happened",
@ -46,16 +46,18 @@ class _ShimmerLoadingWidgetState extends State<ShimmerLoadingWidget> {
case ConnectionState.active: case ConnectionState.active:
break; break;
case ConnectionState.waiting: case ConnectionState.waiting:
widget = Shimmer.fromColors(child: super.widget.loadingWidget(), baseColor: Colors.red, highlightColor: Colors.yellow); widget = Shimmer.fromColors(child: super.widget.loadingWidget!(), baseColor: Colors.red, highlightColor: Colors.yellow);
break; break;
case ConnectionState.done: case ConnectionState.done:
widget = super.widget.realWidget(); widget = super.widget.realWidget!();
if (super.widget.onFinish != null) super.widget.onFinish(); if (super.widget.onFinish != null) super.widget.onFinish!();
break; break;
default:
widget = SizedBox();
} }
} }
return widget; return widget!;
}); });
} }
} }

@ -9,10 +9,10 @@ import 'package:provider/provider.dart';
import '../../Constants.dart'; import '../../Constants.dart';
class PhoneNumberSelectorWidget extends StatefulWidget { class PhoneNumberSelectorWidget extends StatefulWidget {
final Function onNumberChange; final Function? onNumberChange;
final Function onCountryChange; final Function? onCountryChange;
final String mobileNo; final String? mobileNo;
PhoneNumberSelectorWidget({Key key, this.onNumberChange, this.onCountryChange, this.mobileNo}) : super(key: key); PhoneNumberSelectorWidget({Key? key, this.onNumberChange, this.onCountryChange, this.mobileNo}) : super(key: key);
@override @override
_PhoneNumberSelectorWidgetState createState() { _PhoneNumberSelectorWidgetState createState() {
@ -24,7 +24,7 @@ class _PhoneNumberSelectorWidgetState extends State<PhoneNumberSelectorWidget> {
var _selectedType = '+966'; var _selectedType = '+966';
String countryCode = '966'; String countryCode = '966';
List<Countries> counties = []; List<Countries> counties = [];
ProjectViewModel projectProvider; ProjectViewModel? projectProvider;
@override @override
void initState() { void initState() {
for (var element in countriesData) counties.add(Countries.fromJson(element)); for (var element in countriesData) counties.add(Countries.fromJson(element));
@ -43,7 +43,7 @@ class _PhoneNumberSelectorWidgetState extends State<PhoneNumberSelectorWidget> {
String countryName = ""; String countryName = "";
for (var element in counties) { for (var element in counties) {
if (element.code == countryCode) { if (element.code == countryCode) {
countryName = projectProvider.isArabic == true ? element.nameAr : element.name; countryName = projectProvider?.isArabic == true ? element.nameAr : element.name;
} }
} }
@ -56,7 +56,7 @@ class _PhoneNumberSelectorWidgetState extends State<PhoneNumberSelectorWidget> {
); );
} }
Widget inputWidget(String _labelText, String _hintText, {String prefix, bool isEnable = true, bool hasSelection = false}) { Widget inputWidget(String _labelText, String _hintText, {String? prefix, bool isEnable = true, bool hasSelection = false}) {
return Container( return Container(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15), padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center, alignment: Alignment.center,
@ -90,7 +90,7 @@ class _PhoneNumberSelectorWidgetState extends State<PhoneNumberSelectorWidget> {
enabled: isEnable, enabled: isEnable,
scrollPadding: EdgeInsets.zero, scrollPadding: EdgeInsets.zero,
keyboardType: TextInputType.number, keyboardType: TextInputType.number,
onChanged: (value) => widget.onNumberChange(value), onChanged: (value) => widget.onNumberChange!(value),
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
height: 21 / 14, height: 21 / 14,
@ -135,14 +135,14 @@ class _PhoneNumberSelectorWidgetState extends State<PhoneNumberSelectorWidget> {
), ),
itemBuilder: (_) => <PopupMenuItem<String>>[ itemBuilder: (_) => <PopupMenuItem<String>>[
if (hasSelection) if (hasSelection)
for (var country in counties) PopupMenuItem<String>(child: Text(projectProvider.isArabic == true ? country.nameAr : country.name), value: country.code) for (var country in counties) PopupMenuItem<String>(child: Text(projectProvider!.isArabic == true ? country.nameAr : country.name), value: country.code)
], ],
onSelected: (countryCode) { onSelected: (countryCode) {
setState(() { setState(() {
this.countryCode = countryCode; this.countryCode = countryCode;
_selectedType = countryCode; _selectedType = countryCode;
}); });
widget.onCountryChange(countryCode); widget.onCountryChange!(countryCode);
}, },
)); ));
} }
@ -156,9 +156,9 @@ class MobileNo extends StatefulWidget {
final double marginRight; final double marginRight;
final double marginBottom; final double marginBottom;
final double marginLeft; final double marginLeft;
final TextEditingController controller; final TextEditingController? controller;
final Function onNumberChange; final Function? onNumberChange;
final Function onCountryChange; final Function? onCountryChange;
MobileNo({this.disabled = false, this.marginTop = 0, this.marginRight = 0, this.marginBottom = 0, this.controller, this.marginLeft = 0, this.onNumberChange, this.onCountryChange, this.margin = 0}); MobileNo({this.disabled = false, this.marginTop = 0, this.marginRight = 0, this.marginBottom = 0, this.controller, this.marginLeft = 0, this.onNumberChange, this.onCountryChange, this.margin = 0});
@ -170,7 +170,7 @@ class _MobileNo extends State<MobileNo> {
var _selectedType = '+966'; var _selectedType = '+966';
String countryCode = '+966'; String countryCode = '+966';
List<Countries> counties = []; List<Countries> counties = [];
ProjectViewModel projectProvider; ProjectViewModel? projectProvider;
@override @override
void initState() { void initState() {
countriesData.forEach((element) { countriesData.forEach((element) {
@ -194,7 +194,7 @@ class _MobileNo extends State<MobileNo> {
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
border: Border.all( border: Border.all(
color: Colors.grey[400], color: Colors.grey[400]!,
width: 1.0, width: 1.0,
), ),
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
@ -209,16 +209,16 @@ class _MobileNo extends State<MobileNo> {
iconSize: 40, iconSize: 40,
elevation: 16, elevation: 16,
onChanged: (value) => { onChanged: (value) => {
widget.onCountryChange(value), widget.onCountryChange!(value),
setState(() { setState(() {
countryCode = value; countryCode = value!;
_selectedType = value; _selectedType = value!;
}) })
}, },
items: counties.map<DropdownMenuItem<String>>((Countries value) { items: counties.map<DropdownMenuItem<String>>((Countries value) {
return DropdownMenuItem<String>( return DropdownMenuItem<String>(
value: value.code, value: value.code,
child: Text(projectProvider.isArabic == true ? value.nameAr : value.name), child: Text(projectProvider!.isArabic == true ? value.nameAr : value.name),
); );
}).toList()), }).toList()),
), ),
@ -263,7 +263,7 @@ class _MobileNo extends State<MobileNo> {
// onChanged: (value) { // onChanged: (value) {
// widget.controller.text = countryCode; // widget.controller.text = countryCode;
// }, // },
onChanged: (value) => widget.onNumberChange(value), onChanged: (value) => widget.onNumberChange!(value),
decoration: InputDecoration(counterText: "", border: InputBorder.none, hintText: '5xxxxxxxx'), decoration: InputDecoration(counterText: "", border: InputBorder.none, hintText: '5xxxxxxxx'),
), ),

@ -4,7 +4,7 @@ class MyRichText extends StatelessWidget {
final String title; final String title;
final String value; final String value;
final bool isArabic; final bool isArabic;
MyRichText(this.title,this.value,this.isArabic,{Key key}) : super(key: key); MyRichText(this.title,this.value,this.isArabic,{Key? key}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {

@ -10,9 +10,9 @@ import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.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/my_rich_text.dart'; import 'package:diplomaticquarterapp/widgets/my_rich_text.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_rating_bar/flutter_rating_bar.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:rating_bar/rating_bar.dart';
class DoctorHeader extends StatelessWidget { class DoctorHeader extends StatelessWidget {
final HeaderModel headerModel; final HeaderModel headerModel;
@ -20,23 +20,23 @@ class DoctorHeader extends StatelessWidget {
final VoidCallback onRatingAndReviewTap; final VoidCallback onRatingAndReviewTap;
final bool showConfirmMessageDialog; final bool showConfirmMessageDialog;
final String buttonTitle; final String buttonTitle;
final String buttonIcon; final String? buttonIcon;
final bool isNeedToShowButton; final bool isNeedToShowButton;
final bool isShowName; final bool isShowName;
DoctorHeader( DoctorHeader(
{Key key, {Key? key,
@required this.headerModel, required this.headerModel,
@required this.buttonTitle, required this.buttonTitle,
@required this.onTap, required this.onTap,
this.isNeedToShowButton = true, this.isNeedToShowButton = true,
this.isShowName = false, this.isShowName = false,
this.buttonIcon, this.buttonIcon,
this.showConfirmMessageDialog = true, this.showConfirmMessageDialog = true,
@required this.onRatingAndReviewTap}) required this.onRatingAndReviewTap})
: super(key: key); : super(key: key);
ProjectViewModel projectViewModel; late ProjectViewModel projectViewModel;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -127,15 +127,25 @@ class DoctorHeader extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
SizedBox(width: 21), SizedBox(width: 21),
RatingBar.readOnly( // RatingBar.readOnly(
// initialRating: headerModel.actualDoctorRate + 0.0,
// size: 15.0,
// filledColor: Color(0XFFD02127),
// emptyColor: Color(0XFFD02127),
// isHalfAllowed: true,
// halfFilledIcon: Icons.star_half,
// filledIcon: Icons.star,
// emptyIcon: Icons.star_border,
// ),
RatingBar(
initialRating: headerModel.actualDoctorRate + 0.0, initialRating: headerModel.actualDoctorRate + 0.0,
size: 15.0, //size: 15.0,
filledColor: Color(0XFFD02127), // filledColor: ,
emptyColor: Color(0XFFD02127), // emptyColor: ,
isHalfAllowed: true, // isHalfAllowed: true,
halfFilledIcon: Icons.star_half, // halfFilledIcon: Icons.star_half,
filledIcon: Icons.star, // filledIcon: ,
emptyIcon: Icons.star_border, ratingWidget: RatingWidget(full: Icon(Icons.star, color:Colors.yellow[700], size: 15,), half: Icon(Icons.star_half, color:Colors.grey[500], size: 15), empty: Icon(Icons.star_half, color:Colors.grey[500], size: 15)), onRatingUpdate: (double value) { },
), ),
SizedBox(width: 6), SizedBox(width: 6),
Text( Text(
@ -200,7 +210,7 @@ class DoctorHeader extends StatelessWidget {
void getDoctorRatingsDetails(context) { void getDoctorRatingsDetails(context) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
List<DoctorRateDetails> doctorDetailsList = List(); List<DoctorRateDetails> doctorDetailsList = [];
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.getDoctorsRatingDetails(headerModel.doctorId, context).then((res) { service.getDoctorsRatingDetails(headerModel.doctorId, context).then((res) {
@ -269,15 +279,27 @@ class DoctorHeader extends StatelessWidget {
style: TextStyle(fontSize: 32.0, color: Colors.black, letterSpacing: -0.64, fontWeight: FontWeight.bold))), style: TextStyle(fontSize: 32.0, color: Colors.black, letterSpacing: -0.64, fontWeight: FontWeight.bold))),
Container( Container(
margin: EdgeInsets.symmetric(horizontal: 20.0), margin: EdgeInsets.symmetric(horizontal: 20.0),
child: RatingBar.readOnly( child:
initialRating: this.headerModel.decimalDoctorRate != null ? double.tryParse(this.headerModel.decimalDoctorRate) : this.headerModel.actualDoctorRate.toDouble(),
size: 35.0, // RatingBar.readOnly(
filledColor: Colors.yellow[700], // initialRating: this.headerModel.decimalDoctorRate != null ? double.tryParse(this.headerModel.decimalDoctorRate) : this.headerModel.actualDoctorRate.toDouble(),
emptyColor: Colors.grey[500], // size: 35.0,
isHalfAllowed: true, // filledColor: Colors.yellow[700],
halfFilledIcon: Icons.star_half, // emptyColor: Colors.grey[500],
filledIcon: Icons.star, // isHalfAllowed: true,
emptyIcon: Icons.star, // halfFilledIcon: Icons.star_half,
// filledIcon: Icons.star,
// emptyIcon: Icons.star,
// ),
RatingBar(
initialRating: this.headerModel!.decimalDoctorRate! != null ? double.tryParse(this.headerModel!.decimalDoctorRate!)! : this.headerModel!.actualDoctorRate!.toDouble(),
//size: 15.0,
// filledColor: ,
// emptyColor: ,
// isHalfAllowed: true,
// halfFilledIcon: Icons.star_half,
// filledIcon: ,
ratingWidget: RatingWidget(full: Icon(Icons.star, color:Colors.yellow[700], size: 15,), half: Icon(Icons.star_half, color:Colors.grey[500], size: 15), empty: Icon(Icons.star_half, color:Colors.grey[500], size: 15)), onRatingUpdate: (double value) { },
), ),
), ),
], ],
@ -298,7 +320,7 @@ class DoctorHeader extends StatelessWidget {
width: 100.0, width: 100.0,
margin: EdgeInsets.only(top: 10.0, left: 15.0, right: 15.0), margin: EdgeInsets.only(top: 10.0, left: 15.0, right: 15.0),
child: Text(TranslationBase.of(context).excellent, style: TextStyle(fontSize: 13.0, color: Colors.black, fontWeight: FontWeight.w600))), child: Text(TranslationBase.of(context).excellent, style: TextStyle(fontSize: 13.0, color: Colors.black, fontWeight: FontWeight.w600))),
getRatingLine(doctorDetailsList[0].ratio, Colors.green[700]), getRatingLine(doctorDetailsList[0].ratio, Colors.green[700]!),
], ],
), ),
Container( Container(
@ -407,7 +429,7 @@ class DoctorHeader extends StatelessWidget {
barrierDismissible: true, barrierDismissible: true,
barrierLabel: '', barrierLabel: '',
context: context, context: context,
pageBuilder: (context, animation1, animation2) {}); pageBuilder: (context, animation1, animation2) => SizedBox());
} }
double getRatingWidth(double patientNumber) { double getRatingWidth(double patientNumber) {

@ -11,7 +11,7 @@ class MyTabView extends StatelessWidget {
this.value, this.value,
this.groupValue, this.groupValue,
this.onPressed, { this.onPressed, {
Key key, Key? key,
}) : super(key: key); }) : super(key: key);
@override @override

@ -5,7 +5,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_nfc_kit/flutter_nfc_kit.dart'; import 'package:flutter_nfc_kit/flutter_nfc_kit.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
void showNfcReader(BuildContext context, {Function onNcfScan, VoidCallback onCancel}) { void showNfcReader(BuildContext context, {required Function onNcfScan, required VoidCallback onCancel}) {
showModalBottomSheet( showModalBottomSheet(
context: context, context: context,
enableDrag: false, enableDrag: false,
@ -23,8 +23,8 @@ void showNfcReader(BuildContext context, {Function onNcfScan, VoidCallback onCan
} }
class NfcLayout extends StatefulWidget { class NfcLayout extends StatefulWidget {
Function onNcfScan; Function? onNcfScan;
VoidCallback onCancel; VoidCallback? onCancel;
NfcLayout({this.onNcfScan, this.onCancel}); NfcLayout({this.onNcfScan, this.onCancel});
@ -34,8 +34,8 @@ class NfcLayout extends StatefulWidget {
class _NfcLayoutState extends State<NfcLayout> { class _NfcLayoutState extends State<NfcLayout> {
bool _reading = false; bool _reading = false;
Widget mainWidget; late Widget mainWidget;
String nfcId; late String nfcId;
@override @override
void initState() { void initState() {
@ -52,7 +52,7 @@ class _NfcLayoutState extends State<NfcLayout> {
}); });
Future.delayed(const Duration(milliseconds: 500), () async { Future.delayed(const Duration(milliseconds: 500), () async {
await FlutterNfcKit.finish(); await FlutterNfcKit.finish();
widget.onNcfScan(nfcId); widget.onNcfScan!(nfcId);
Navigator.pop(context); Navigator.pop(context);
}); });
nfcId = value.id; nfcId = value.id;
@ -114,7 +114,7 @@ class _NfcLayoutState extends State<NfcLayout> {
child: CustomTextButton( child: CustomTextButton(
elevation: 0, elevation: 0,
onPressed: () { onPressed: () {
widget.onCancel(); widget.onCancel!();
Navigator.pop(context); Navigator.pop(context);
}, },
child: Text("CANCEL"), child: Text("CANCEL"),

@ -16,9 +16,9 @@ class PackagesCartItemCard extends StatefulWidget {
final PackagesCartItemsResponseModel itemModel; final PackagesCartItemsResponseModel itemModel;
final StepperCallbackFuture shouldStepperChangeApply; final StepperCallbackFuture shouldStepperChangeApply;
final PackagesViewModel viewModel; final PackagesViewModel viewModel;
final Function getCartItems; final Function? getCartItems;
const PackagesCartItemCard({@required this.itemModel, @required this.shouldStepperChangeApply, @required this.viewModel, this.getCartItems, Key key}) : super(key: key); const PackagesCartItemCard({required this.itemModel, required this.shouldStepperChangeApply, required this.viewModel, this.getCartItems, Key? key}) : super(key: key);
@override @override
State<StatefulWidget> createState() => PackagesCartItemCardState(); State<StatefulWidget> createState() => PackagesCartItemCardState();
@ -51,7 +51,7 @@ class PackagesCartItemCardState extends State<PackagesCartItemCard> {
InkWell( InkWell(
onTap: () async { onTap: () async {
await widget.viewModel.service.deleteProductFromCart(widget.itemModel.id, context: context, showLoading: false); await widget.viewModel.service.deleteProductFromCart(widget.itemModel.id, context: context, showLoading: false);
widget.getCartItems(); widget.getCartItems!();
}, },
child: Padding( child: Padding(
padding: const EdgeInsets.only(right: 3, bottom: 3), padding: const EdgeInsets.only(right: 3, bottom: 3),
@ -112,7 +112,7 @@ Widget _itemDescription(String desc) => Text(
), ),
); );
Widget _itemPrice(double price, {@required BuildContext context}) { Widget _itemPrice(double price, {required BuildContext context}) {
final prc = (price ?? 0.0).toStringAsFixed(2); final prc = (price ?? 0.0).toStringAsFixed(2);
return Text( return Text(
'$prc ${TranslationBase.of(context).sar}', '$prc ${TranslationBase.of(context).sar}',

@ -5,19 +5,19 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_rating_bar/flutter_rating_bar.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
import 'package:rating_bar/rating_bar.dart';
bool wide = true; bool wide = true;
class PackagesItemCard extends StatefulWidget { class PackagesItemCard extends StatefulWidget {
final double itemWidth; final double? itemWidth;
final double itemHeight; final double? itemHeight;
final double itemContentPadding; final double? itemContentPadding;
final PackagesResponseModel itemModel; final PackagesResponseModel itemModel;
final Function(PackagesResponseModel product) onCartClick; final Function(PackagesResponseModel product) onCartClick;
const PackagesItemCard({this.itemWidth, this.itemHeight, @required this.itemModel, @required this.itemContentPadding, @required this.onCartClick, Key key}) : super(key: key); const PackagesItemCard({this.itemWidth, this.itemHeight, required this.itemModel, required this.itemContentPadding, required this.onCartClick, Key? key}) : super(key: key);
@override @override
State<StatefulWidget> createState() => PackagesItemCardState(); State<StatefulWidget> createState() => PackagesItemCardState();
@ -99,16 +99,18 @@ class PackagesItemCardState extends State<PackagesItemCard> {
style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.bold, color: Color(0xff2B353E), letterSpacing: -0.48), style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.bold, color: Color(0xff2B353E), letterSpacing: -0.48),
), ),
), ),
RatingBar.readOnly( RatingBar(
initialRating: 4.5, // todo ask haroon about parameter for rating initialRating: 4.5, // todo ask haroon about parameter for rating
size: 18.0, // size: 18.0,
filledColor: Color(0XFFD02127), // filledColor: Color(0XFFD02127),
emptyColor: Color(0XFFD02127), // emptyColor: Color(0XFFD02127),
isHalfAllowed: true, // isHalfAllowed: true,
halfFilledIcon: Icons.star_half, // halfFilledIcon: Icons.star_half,
filledIcon: Icons.star, // filledIcon: Icons.star,
emptyIcon: Icons.star_border, // emptyIcon: ,
), //
ratingWidget: RatingWidget( full:Icon(Icons.star, color:Color(0XFFD02127)), half:Icon(Icons.star_half, color: Color(0XFFD02127)), empty: Icon(Icons.star_border,color: Color(0XFFD02127)) ,
), onRatingUpdate: (double value) { }),
], ],
), ),
if(widget.onCartClick != null) if(widget.onCartClick != null)
@ -166,16 +168,16 @@ class PackagesItemCardState extends State<PackagesItemCard> {
margin: const EdgeInsets.only(top: 0.0), margin: const EdgeInsets.only(top: 0.0),
child: Text(widget.itemModel.price.toString().trim() + " " + TranslationBase.of(context).sar, child: Text(widget.itemModel.price.toString().trim() + " " + TranslationBase.of(context).sar,
style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.bold, letterSpacing: -0.56))), style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.bold, letterSpacing: -0.56))),
RatingBar.readOnly( // RatingBar.readOnly(
initialRating: 4.5, // initialRating: 4.5,
size: 18.0, // size: 18.0,
filledColor: Color(0XFFD02127), // filledColor: Color(0XFFD02127),
emptyColor: Color(0XFFD02127), // emptyColor: Color(0XFFD02127),
isHalfAllowed: true, // isHalfAllowed: true,
halfFilledIcon: Icons.star_half, // halfFilledIcon: Icons.star_half,
filledIcon: Icons.star, // filledIcon: Icons.star,
emptyIcon: Icons.star_border, // emptyIcon: Icons.star_border,
), // ),
], ],
), ),
InkWell( InkWell(

@ -15,9 +15,9 @@ bool wide = true;
class PackagesOrderHistoryItemCard extends StatefulWidget { class PackagesOrderHistoryItemCard extends StatefulWidget {
final PackagesResponseModel itemModel; final PackagesResponseModel itemModel;
final PackagesViewModel viewModel; final PackagesViewModel viewModel;
final Function getCartItems; final Function? getCartItems;
const PackagesOrderHistoryItemCard({@required this.itemModel, @required this.viewModel, this.getCartItems, Key key}) : super(key: key); const PackagesOrderHistoryItemCard({required this.itemModel, required this.viewModel, this.getCartItems, Key? key}) : super(key: key);
@override @override
State<StatefulWidget> createState() => PackagesOrderHistoryItemCardState(); State<StatefulWidget> createState() => PackagesOrderHistoryItemCardState();
@ -59,7 +59,7 @@ class PackagesOrderHistoryItemCardState extends State<PackagesOrderHistoryItemCa
} }
} }
Widget _cancelButton(BuildContext context, {@required PackagesResponseModel itemModel, VoidCallback onClick}) => InkWell( Widget _cancelButton(BuildContext context, {required PackagesResponseModel itemModel, VoidCallback? onClick}) => InkWell(
onTap:onClick, onTap:onClick,
child: Padding( child: Padding(
padding: const EdgeInsets.only(right: 3, bottom: 3), padding: const EdgeInsets.only(right: 3, bottom: 3),
@ -110,7 +110,7 @@ Widget _itemDescription(String desc) => Text(
), ),
); );
Widget _itemPrice(double price, {@required BuildContext context}) { Widget _itemPrice(double price, {required BuildContext context}) {
final prc = (price ?? 0.0).toStringAsFixed(2); final prc = (price ?? 0.0).toStringAsFixed(2);
return Text( return Text(
'$prc ${TranslationBase.of(context).sar}', '$prc ${TranslationBase.of(context).sar}',

@ -128,7 +128,7 @@ class _OffersAndPackagesWidgetState extends State<OffersAndPackagesWidget> {
// - - - - - - - - - - - - - - // - - - - - - - - - - - - - -
class OfferPackagesItemWidget extends StatefulWidget { class OfferPackagesItemWidget extends StatefulWidget {
final OfferPackagesItemModel model; final OfferPackagesItemModel model;
OfferPackagesItemWidget({@required this.model}); OfferPackagesItemWidget({required this.model});
@override @override
State<OfferPackagesItemWidget> createState() { State<OfferPackagesItemWidget> createState() {
@ -247,7 +247,7 @@ class OfferPackagesItemModel<T> {
OfferPackagesItemModel(this.bannerUrl, this.title, this.desc, this.item, this.action); OfferPackagesItemModel(this.bannerUrl, this.title, this.desc, this.item, this.action);
static List<OfferPackagesItemModel> dummy() { static List<OfferPackagesItemModel> dummy() {
List<OfferPackagesItemModel> list = List<OfferPackagesItemModel>(); List<OfferPackagesItemModel> list = [];
list.add(OfferPackagesItemModel<String>( list.add(OfferPackagesItemModel<String>(
"http://blog.naseej.com/hs-fs/hubfs/ellucian-banner-9.jpg?width=1486&height=782&name=ellucian-banner-9.jpg", "http://blog.naseej.com/hs-fs/hubfs/ellucian-banner-9.jpg?width=1486&height=782&name=ellucian-banner-9.jpg",
"Sample Title", "Sample Title",

@ -3,8 +3,8 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class OrderLogItem extends StatelessWidget { class OrderLogItem extends StatelessWidget {
final String title; final String? title;
final String value; final String? value;
OrderLogItem({ this.title, this.value}); OrderLogItem({ this.title, this.value});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -22,7 +22,7 @@ class OrderLogItem extends StatelessWidget {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Texts(title,color: Colors.grey,), Texts(title!,color: Colors.grey,),
SizedBox(height: 4,), SizedBox(height: 4,),
Texts(value??''), Texts(value??''),
], ],

@ -8,7 +8,7 @@ class StarRating extends StatelessWidget {
final int totalCount; final int totalCount;
final bool forceStars; final bool forceStars;
StarRating({Key key, this.totalAverage: 0.0, this.size: 16.0, this.totalCount=5, this.forceStars = false}) : super(key: key); StarRating({Key? key, this.totalAverage= 0.0, this.size= 16.0, this.totalCount=5, this.forceStars = false}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -31,7 +31,7 @@ class StarRating extends StatelessWidget {
if (totalCount!=null) if (totalCount!=null)
SizedBox(width: 5.0), SizedBox(width: 5.0),
if (totalCount!=null) if (totalCount!=null)
Texts("("+totalCount.toString()+")", style: "overline", color: Colors.grey[400],) Texts("("+totalCount.toString()+")", style: "overline", color: Colors.grey[400]!,)
] ]
); );
} }

@ -12,10 +12,10 @@ import 'package:provider/provider.dart';
/// [title] the widget title /// [title] the widget title
/// [collapsed] The widget shown in the collapsed state /// [collapsed] The widget shown in the collapsed state
class AppExpandableNotifier extends StatefulWidget { class AppExpandableNotifier extends StatefulWidget {
final Widget headerWidget; final Widget? headerWidget;
final Widget bodyWidget; final Widget? bodyWidget;
final String title; final String? title;
final Widget collapsed; final Widget? collapsed;
final bool isExpand; final bool isExpand;
bool expandFlag = false; bool expandFlag = false;
bool hasCounter = false; bool hasCounter = false;
@ -29,7 +29,7 @@ class AppExpandableNotifier extends StatefulWidget {
} }
class _AppExpandableNotifier extends State<AppExpandableNotifier> { class _AppExpandableNotifier extends State<AppExpandableNotifier> {
ProjectViewModel projectViewModel; late ProjectViewModel projectViewModel;
@override @override
void initState() { void initState() {
@ -70,7 +70,7 @@ class _AppExpandableNotifier extends State<AppExpandableNotifier> {
scrollOnExpand: true, scrollOnExpand: true,
scrollOnCollapse: false, scrollOnCollapse: false,
child: ExpandablePanel( child: ExpandablePanel(
hasIcon: false, // hasIcon: false,
theme: const ExpandableThemeData( theme: const ExpandableThemeData(
headerAlignment: ExpandablePanelHeaderAlignment.center, headerAlignment: ExpandablePanelHeaderAlignment.center,
tapBodyToCollapse: true, tapBodyToCollapse: true,
@ -139,7 +139,7 @@ class _AppExpandableNotifier extends State<AppExpandableNotifier> {
), ),
), ),
collapsed: widget.collapsed ?? Container(), collapsed: widget.collapsed ?? Container(),
expanded: widget.bodyWidget, expanded: widget.bodyWidget!,
builder: (_, collapsed, expanded) { builder: (_, collapsed, expanded) {
return Expandable( return Expandable(
controller: widget.controller, controller: widget.controller,

@ -14,23 +14,23 @@ import 'not_auh_page.dart';
class PharmacyAppScaffold extends StatelessWidget { class PharmacyAppScaffold extends StatelessWidget {
final String appBarTitle; final String appBarTitle;
final Widget body; final Widget body;
final Widget bottomSheet; final Widget? bottomSheet;
final bool isLoading; final bool isLoading;
final bool isShowAppBar; final bool isShowAppBar;
final bool hasAppBarParam; final bool? hasAppBarParam;
final BaseViewModel baseViewModel; final BaseViewModel? baseViewModel;
final bool isBottomBar; final bool? isBottomBar;
final Widget floatingActionButton; final Widget? floatingActionButton;
final String title; final String? title;
final String description; final String? description;
final bool isShowDecPage; final bool isShowDecPage;
final Color backgroundColor; final Color? backgroundColor;
AuthenticatedUserObject authenticatedUserObject = AuthenticatedUserObject authenticatedUserObject =
locator<AuthenticatedUserObject>(); locator<AuthenticatedUserObject>();
PharmacyAppScaffold( PharmacyAppScaffold(
{@required this.body, {required this.body,
this.appBarTitle = '', this.appBarTitle = '',
this.isLoading = false, this.isLoading = false,
this.isShowAppBar = false, this.isShowAppBar = false,
@ -55,10 +55,10 @@ class PharmacyAppScaffold extends StatelessWidget {
? AppBar( ? AppBar(
elevation: 0, elevation: 0,
backgroundColor: Color(0xff5AB145), backgroundColor: Color(0xff5AB145),
textTheme: TextTheme( // textTheme: TextTheme(
headline6: // headline6:
TextStyle(color: Colors.white, fontWeight: FontWeight.bold), // TextStyle(color: Colors.white, fontWeight: FontWeight.bold),
), // ),
title: Text(authenticatedUserObject.isLogin title: Text(authenticatedUserObject.isLogin
? appBarTitle.toUpperCase() ? appBarTitle.toUpperCase()
: appBarTitle.toUpperCase()), : appBarTitle.toUpperCase()),
@ -74,7 +74,7 @@ class PharmacyAppScaffold extends StatelessWidget {
body: (!authenticatedUserObject.isLogin && isShowDecPage) body: (!authenticatedUserObject.isLogin && isShowDecPage)
? NotAutPage( ? NotAutPage(
title: appBarTitle, title: appBarTitle,
description: description, description: description!,
) )
: baseViewModel != null : baseViewModel != null
? NetworkBaseView( ? NetworkBaseView(

@ -1,5 +1,5 @@
import 'package:auto_size_text/auto_size_text.dart'; import 'package:auto_size_text/auto_size_text.dart';
import 'package:badges/badges.dart'; import 'package:badges/badges.dart' as badge_import;
import 'package:barcode_scan2/barcode_scan2.dart'; import 'package:barcode_scan2/barcode_scan2.dart';
import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
@ -39,49 +39,49 @@ import 'floating_button_search.dart';
import 'network_base_view.dart'; import 'network_base_view.dart';
import 'not_auh_page.dart'; import 'not_auh_page.dart';
VoidCallback _onCartClick; VoidCallback? _onCartClick;
class AppScaffold extends StatefulWidget { class AppScaffold extends StatefulWidget {
final String appBarTitle; final String appBarTitle;
final Widget body; final Widget body;
final Widget bottomSheet; final Widget? bottomSheet;
final Widget bottomNavigationBar; final Widget? bottomNavigationBar;
final bool isLoading; final bool isLoading;
final bool isShowAppBar; final bool isShowAppBar;
final bool showNewAppBar; final bool showNewAppBar;
final bool showNewAppBarTitle; final bool showNewAppBarTitle;
final bool hasAppBarParam; final bool? hasAppBarParam;
final BaseViewModel baseViewModel; final BaseViewModel? baseViewModel;
final bool isBottomBar; final bool isBottomBar;
final Widget floatingActionButton; final Widget? floatingActionButton;
final bool isPharmacy; final bool isPharmacy;
final bool isOfferPackages; final bool isOfferPackages;
final bool showPharmacyCart; final bool showPharmacyCart;
final bool showOfferPackagesCart; final bool showOfferPackagesCart;
final String title; final String? title;
final String description; final String? description;
final bool isShowDecPage; final bool isShowDecPage;
final List<String> infoList; final List<String>? infoList;
final Color backgroundColor; final Color? backgroundColor;
final double preferredSize; final double preferredSize;
final bool showHomeAppBarIcon; final bool showHomeAppBarIcon;
final List<Widget> appBarIcons; final List<Widget>? appBarIcons;
final List<ImagesInfo> imagesInfo; final List<ImagesInfo>? imagesInfo;
final bool isHelp; final bool isHelp;
final bool isLocalLoader; final bool isLocalLoader;
final Function backButtonTab; final VoidCallbackAction? backButtonTab;
final String icon; final String? icon;
final bool showDropDown; final bool showDropDown;
final int dropdownIndexValue; final int? dropdownIndexValue;
List<String> dropDownList; List<String>? dropDownList;
final Function(int) dropDownIndexChange; final void Function(int?)? dropDownIndexChange;
Function onTap; VoidCallbackAction? onTap;
final bool isMainPharmacyPages; final bool isMainPharmacyPages;
final bool extendBody; final bool extendBody;
final ValueChanged<int> changeCurrentTab; final ValueChanged<int>? changeCurrentTab;
final int currentTab; final int? currentTab;
final bool isShowPharmacyAppbar; final bool isShowPharmacyAppbar;
final Widget customAppBar; final Widget? customAppBar;
AppScaffold setOnAppBarCartClick(VoidCallback onClick) { AppScaffold setOnAppBarCartClick(VoidCallback onClick) {
_onCartClick = onClick; _onCartClick = onClick;
@ -89,7 +89,7 @@ class AppScaffold extends StatefulWidget {
} }
AppScaffold( AppScaffold(
{@required this.body, {required this.body,
this.appBarTitle = '', this.appBarTitle = '',
this.isLoading = false, this.isLoading = false,
this.isShowAppBar = false, this.isShowAppBar = false,
@ -137,7 +137,7 @@ class AppScaffold extends StatefulWidget {
class _AppScaffoldState extends State<AppScaffold> { class _AppScaffoldState extends State<AppScaffold> {
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>(); AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
AppBarWidget appBar; late AppBarWidget appBar;
@override @override
void initState() { void initState() {
@ -216,6 +216,8 @@ class _AppScaffoldState extends State<AppScaffold> {
PharmacyPagesViewModel pagesViewModel = Provider.of(context); PharmacyPagesViewModel pagesViewModel = Provider.of(context);
bool isUserNotLogin = (!Provider.of<ProjectViewModel>(context, listen: false).isLogin && widget.isShowDecPage); bool isUserNotLogin = (!Provider.of<ProjectViewModel>(context, listen: false).isLogin && widget.isShowDecPage);
return Scaffold( return Scaffold(
backgroundColor: widget.backgroundColor ?? CustomColors.appBackgroudGrey2Color, backgroundColor: widget.backgroundColor ?? CustomColors.appBackgroudGrey2Color,
@ -225,34 +227,40 @@ class _AppScaffoldState extends State<AppScaffold> {
// ? widget.customAppBar != null // ? widget.customAppBar != null
// ? widget.customAppBar // ? widget.customAppBar
appBar: isUserNotLogin appBar: isUserNotLogin!
? null ? null
: widget.isShowPharmacyAppbar : widget.isShowPharmacyAppbar!
? pharmacyAppbar() ? PreferredSize(
: (widget.showNewAppBar preferredSize: Size.fromHeight(70),
? NewAppBarWidget( child: pharmacyAppbar()!)
title: widget.appBarTitle, : (widget.showNewAppBar!
showTitle: widget.showNewAppBarTitle, ? PreferredSize(
showDropDown: widget.showDropDown, preferredSize: Size.fromHeight(70),
dropdownIndexValue: widget.dropdownIndexValue, child: NewAppBarWidget(
dropDownList: widget.dropDownList ?? [], title: widget.appBarTitle!,
showTitle: widget.showNewAppBarTitle!,
showDropDown: widget.showDropDown!,
dropdownIndexValue: widget.dropdownIndexValue!,
dropDownList: widget.dropDownList! ?? [],
dropDownIndexChange: widget.dropDownIndexChange, dropDownIndexChange: widget.dropDownIndexChange,
appBarIcons: widget.appBarIcons, appBarIcons: widget.appBarIcons!,
onTap: widget.onTap, onTap: widget.onTap!,
) ))
: (widget.isShowAppBar : (widget.isShowAppBar!
? widget.customAppBar != null ? widget.customAppBar != null
? widget.customAppBar ? PreferredSize(
preferredSize: Size.fromHeight(70),
child: widget.customAppBar!)
: appBar = AppBarWidget( : appBar = AppBarWidget(
appBarTitle: widget.appBarTitle, appBarTitle: widget.appBarTitle!,
appBarIcons: widget.appBarIcons, appBarIcons: widget.appBarIcons!,
showHomeAppBarIcon: widget.showHomeAppBarIcon, showHomeAppBarIcon: widget.showHomeAppBarIcon!,
isPharmacy: widget.isPharmacy, isPharmacy: widget.isPharmacy!,
showPharmacyCart: widget.showPharmacyCart, showPharmacyCart: widget.showPharmacyCart!,
isOfferPackages: widget.isOfferPackages, isOfferPackages: widget.isOfferPackages!,
showOfferPackagesCart: widget.showOfferPackagesCart, showOfferPackagesCart: widget.showOfferPackagesCart!,
isShowDecPage: widget.isShowDecPage, isShowDecPage: widget.isShowDecPage!,
backButtonTab: widget.backButtonTab, backButtonTab: widget.backButtonTab!,
) )
: null)), : null)),
bottomSheet: widget.bottomSheet, bottomSheet: widget.bottomSheet,
@ -262,7 +270,7 @@ class _AppScaffoldState extends State<AppScaffold> {
child: isUserNotLogin child: isUserNotLogin
? NotAutPage( ? NotAutPage(
title: widget.title ?? widget.appBarTitle, title: widget.title ?? widget.appBarTitle,
description: widget.description, description: widget.description!,
infoList: widget.infoList, infoList: widget.infoList,
imagesInfo: widget.imagesInfo, imagesInfo: widget.imagesInfo,
icon: widget.icon, icon: widget.icon,
@ -277,27 +285,31 @@ class _AppScaffoldState extends State<AppScaffold> {
bottomNavigationBar: widget.isBottomBar bottomNavigationBar: widget.isBottomBar
? BottomNavPharmacyBar( ? BottomNavPharmacyBar(
changeIndex: changeCurrentTab, changeIndex: changeCurrentTab,
index: widget.currentTab, index: widget.currentTab!,
) )
: null, : null,
floatingActionButton: widget.floatingActionButton, floatingActionButton: widget.floatingActionButton,
); );
} }
@override
Size get preferredSize => const Size.fromHeight(kToolbarHeight);
void changeCurrentTab(int value) { void changeCurrentTab(int value) {
if (widget.isMainPharmacyPages) { if (widget.isMainPharmacyPages) {
widget.changeCurrentTab(value); widget.changeCurrentTab!(value);
} else { } else {
Navigator.pushAndRemoveUntil( Navigator.pushAndRemoveUntil(
locator<NavigationService>().navigatorKey.currentContext, MaterialPageRoute(builder: (context) => LandingPagePharmacy(currentTab: value)), (Route<dynamic> r) => false); locator<NavigationService>().navigatorKey!.currentContext!, MaterialPageRoute(builder: (context) => LandingPagePharmacy(currentTab: value)), (Route<dynamic> r) => false);
} }
} }
void _scanQrAndGetProduct() async { void _scanQrAndGetProduct() async {
try { try {
String result = (await BarcodeScanner.scan())?.rawContent; String? result = (await BarcodeScanner.scan())?.rawContent!;
try { try {
String barcode = result; String barcode = result!;
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await BaseAppClient().getPharmacy("$GET_PHARMACY_PRODUCTs_BY_SKU$barcode", onSuccess: (dynamic response, int statusCode) { await BaseAppClient().getPharmacy("$GET_PHARMACY_PRODUCTs_BY_SKU$barcode", onSuccess: (dynamic response, int statusCode) {
print(response); print(response);
@ -323,17 +335,17 @@ class _AppScaffoldState extends State<AppScaffold> {
} }
} }
class NewAppBarWidget extends StatelessWidget with PreferredSizeWidget { class NewAppBarWidget extends StatelessWidget implements PreferredSizeWidget {
final bool showTitle; final bool showTitle;
final String title; final String title;
final bool showDropDown; final bool? showDropDown;
final int dropdownIndexValue; final int? dropdownIndexValue;
List<String> dropDownList; List<String>? dropDownList;
final Function(int) dropDownIndexChange; final void Function(int?)? dropDownIndexChange;
final List<Widget> appBarIcons; final List<Widget>? appBarIcons;
Function onTap; VoidCallbackAction? onTap;
NewAppBarWidget({Key key, this.showTitle = false, this.showDropDown = false, this.title = "", this.dropDownList, this.appBarIcons, this.dropdownIndexValue, this.dropDownIndexChange, this.onTap}) NewAppBarWidget({Key? key, this.showTitle = false, this.showDropDown = false, this.title = "", this.dropDownList, this.appBarIcons, this.dropdownIndexValue, this.dropDownIndexChange, this.onTap})
: super(key: key); : super(key: key);
@override @override
@ -346,7 +358,7 @@ class NewAppBarWidget extends StatelessWidget with PreferredSizeWidget {
// backgroundColor: Colors.red, // backgroundColor: Colors.red,
// automaticallyImplyLeading: false, // automaticallyImplyLeading: false,
leading: ArrowBack( leading: ArrowBack(
onTap: onTap, onTap: onTap!,
), ),
titleSpacing: -8, titleSpacing: -8,
// centerTitle: false, // centerTitle: false,
@ -361,7 +373,7 @@ class NewAppBarWidget extends StatelessWidget with PreferredSizeWidget {
fontSize: 24, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), fontWeight: FontWeight.w700, color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24), fontSize: 24, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), fontWeight: FontWeight.w700, color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
), ),
), ),
if (showDropDown) if (showDropDown!)
Container( Container(
decoration: containerRadius(Color(0xFFF7F7F7), 30), decoration: containerRadius(Color(0xFFF7F7F7), 30),
height: 30, height: 30,
@ -374,11 +386,11 @@ class NewAppBarWidget extends StatelessWidget with PreferredSizeWidget {
dropdownColor: CustomColors.lightGreyColor, dropdownColor: CustomColors.lightGreyColor,
value: dropdownIndexValue, value: dropdownIndexValue,
items: [ items: [
for (int i = 0; i < dropDownList.length; i++) for (int i = 0; i < dropDownList!.length; i++)
DropdownMenuItem<int>( DropdownMenuItem<int>(
value: i, value: i,
child: AutoSizeText( child: AutoSizeText(
dropDownList[i], dropDownList![i],
style: TextStyle( style: TextStyle(
fontSize: 12, fontSize: 12,
fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'),
@ -402,7 +414,7 @@ class NewAppBarWidget extends StatelessWidget with PreferredSizeWidget {
), ),
actions: <Widget>[ actions: <Widget>[
if (appBarIcons != null) if (appBarIcons != null)
...appBarIcons ...appBarIcons!
else else
IconButton( IconButton(
onPressed: () { onPressed: () {
@ -423,20 +435,20 @@ class NewAppBarWidget extends StatelessWidget with PreferredSizeWidget {
Size get preferredSize => Size(double.maxFinite, 60); Size get preferredSize => Size(double.maxFinite, 60);
} }
class AppBarWidget extends StatefulWidget with PreferredSizeWidget { class AppBarWidget extends StatefulWidget implements PreferredSizeWidget {
final AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>(); final AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
final String appBarTitle; final String? appBarTitle;
final bool showHomeAppBarIcon; final bool? showHomeAppBarIcon;
final List<Widget> appBarIcons; final List<Widget>? appBarIcons;
final bool isPharmacy; final bool isPharmacy;
final bool isOfferPackages; final bool isOfferPackages;
final bool showPharmacyCart; final bool showPharmacyCart;
final bool showOfferPackagesCart; final bool showOfferPackagesCart;
final bool isShowDecPage; final bool isShowDecPage;
final Function backButtonTab; final VoidCallbackAction? backButtonTab;
Function(String) badgeUpdater; Function(String)? badgeUpdater;
AppBarWidget( AppBarWidget(
{this.appBarTitle, {this.appBarTitle,
@ -477,12 +489,12 @@ class AppBarWidgetState extends State<AppBarWidget> {
return AppBar( return AppBar(
elevation: 0, elevation: 0,
backgroundColor: widget.isPharmacy ? Colors.green : Theme.of(context).appBarTheme.color, backgroundColor: widget.isPharmacy ? Colors.green : Theme.of(context).appBarTheme.backgroundColor,
textTheme: TextTheme( // textTheme: TextTheme(
headline6: TextStyle(color: Theme.of(context).textTheme.headline1.color, fontWeight: FontWeight.bold), // headline6: TextStyle(color: Theme.of(context).textTheme.headline1.color, fontWeight: FontWeight.bold),
), // ),
title: Text(widget.authenticatedUserObject.isLogin || !widget.isShowDecPage ? widget.appBarTitle.toUpperCase() : TranslationBase.of(context).serviceInformationTitle, title: Text(widget.authenticatedUserObject.isLogin || !widget.isShowDecPage ? widget.appBarTitle!.toUpperCase() : TranslationBase.of(context).serviceInformationTitle,
style: TextStyle(fontWeight: FontWeight.bold, color: Theme.of(context).textTheme.headline1.color, fontFamily: projectViewModel.isArabic ? 'Cairo' : 'WorkSans')), style: TextStyle(fontWeight: FontWeight.bold, color: Theme.of(context).textTheme.headline1!.color, fontFamily: projectViewModel.isArabic ? 'Cairo' : 'WorkSans')),
leading: Builder( leading: Builder(
builder: (BuildContext context) { builder: (BuildContext context) {
return ArrowBack( return ArrowBack(
@ -494,7 +506,7 @@ class AppBarWidgetState extends State<AppBarWidget> {
actions: <Widget>[ actions: <Widget>[
(widget.isPharmacy && widget.showPharmacyCart) (widget.isPharmacy && widget.showPharmacyCart)
? IconButton( ? IconButton(
icon: Badge( icon: badge_import.Badge(
badgeContent: Text( badgeContent: Text(
orderPreviewViewModel.cartResponse.quantityCount.toString(), orderPreviewViewModel.cartResponse.quantityCount.toString(),
style: TextStyle(color: Colors.white), style: TextStyle(color: Colors.white),
@ -507,8 +519,8 @@ class AppBarWidgetState extends State<AppBarWidget> {
: Container(), : Container(),
(widget.isOfferPackages && widget.showOfferPackagesCart) (widget.isOfferPackages && widget.showOfferPackagesCart)
? IconButton( ? IconButton(
icon: Badge( icon: badge_import.Badge(
position: BadgePosition.topStart(top: -15, start: -10), position: badge_import.BadgePosition.topStart(top: -15, start: -10),
badgeContent: Text( badgeContent: Text(
_badgeText, _badgeText,
style: TextStyle(fontSize: 9, color: Colors.white, fontWeight: FontWeight.normal), style: TextStyle(fontSize: 9, color: Colors.white, fontWeight: FontWeight.normal),
@ -517,10 +529,10 @@ class AppBarWidgetState extends State<AppBarWidget> {
color: Colors.white, color: Colors.white,
onPressed: () { onPressed: () {
// Cart Click Event // Cart Click Event
if (_onCartClick != null) _onCartClick(); if (_onCartClick != null) _onCartClick!();
}) })
: Container(), : Container(),
if (widget.showHomeAppBarIcon) if (widget.showHomeAppBarIcon!)
IconButton( IconButton(
icon: Icon(FontAwesomeIcons.home), icon: Icon(FontAwesomeIcons.home),
color: Colors.white, color: Colors.white,
@ -528,10 +540,10 @@ class AppBarWidgetState extends State<AppBarWidget> {
Navigator.pushAndRemoveUntil(context, MaterialPageRoute(builder: (context) => LandingPage()), (Route<dynamic> r) => false); Navigator.pushAndRemoveUntil(context, MaterialPageRoute(builder: (context) => LandingPage()), (Route<dynamic> r) => false);
// Cart Click Event // Cart Click Event
if (_onCartClick != null) _onCartClick(); if (_onCartClick != null) _onCartClick!();
}, },
), ),
if (widget.appBarIcons != null) ...widget.appBarIcons if (widget.appBarIcons != null) ...widget.appBarIcons!
], ],
); );
} }

@ -3,9 +3,9 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class ArrowBack extends StatelessWidget { class ArrowBack extends StatelessWidget {
final Function onTap; final VoidCallbackAction? onTap;
ArrowBack({Key key, this.onTap,}) : super(key: key); ArrowBack({Key? key, this.onTap,}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -13,7 +13,7 @@ class ArrowBack extends StatelessWidget {
return GestureDetector( return GestureDetector(
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,
onTap: Feedback.wrapForTap(() { onTap: Feedback.wrapForTap(() {
onTap != null ? onTap() : Navigator.maybePop(context); onTap != null ? onTap! : Navigator.maybePop(context);
}, context), }, context),
child: Icon( child: Icon(
Icons.arrow_back_ios, Icons.arrow_back_ios,

@ -50,7 +50,7 @@ class _SearchBot extends State<BottomBarSearch> {
// final SpeechToText speech = SpeechToText(); // final SpeechToText speech = SpeechToText();
String error = ''; String error = '';
String _currentLocaleId = ""; String _currentLocaleId = "";
String lastError; String? lastError;
double level = 0.0; double level = 0.0;
double minSoundLevel = 50000; double minSoundLevel = 50000;
@ -60,7 +60,7 @@ class _SearchBot extends State<BottomBarSearch> {
var selectedLang; var selectedLang;
bool isSearching = false; bool isSearching = false;
Map results = {}; Map results = {};
String lastStatus; String? lastStatus;
bool _isInit = true; bool _isInit = true;
TextEditingController searchController = TextEditingController(); TextEditingController searchController = TextEditingController();
@ -98,8 +98,8 @@ class _SearchBot extends State<BottomBarSearch> {
}); });
// await flutterTts.speak("Hello!"); // await flutterTts.speak("Hello!");
//Future.delayed(const Duration(seconds: 1), () { //Future.delayed(const Duration(seconds: 1), () {
// initSpeechState() initSpeechState()
// .then((value) => startVoiceSearch()); .then((value) => startVoiceSearch());
//}); //});
}, },
)), )),
@ -111,7 +111,7 @@ class _SearchBot extends State<BottomBarSearch> {
); );
} }
// startVoiceSearch() async { startVoiceSearch() async {
// speech.listen( // speech.listen(
// onResult: resultListener, // onResult: resultListener,
// listenFor: Duration(seconds: 10), // listenFor: Duration(seconds: 10),
@ -121,7 +121,7 @@ class _SearchBot extends State<BottomBarSearch> {
// partialResults: true, // partialResults: true,
// onDevice: true, // onDevice: true,
// listenMode: ListenMode.confirmation); // listenMode: ListenMode.confirmation);
// } }
// void resultListener(SpeechRecognitionResult result) { // void resultListener(SpeechRecognitionResult result) {
// // lastWords = "${result.recognizedWords} - ${result.finalResult}"; // // lastWords = "${result.recognizedWords} - ${result.finalResult}";
@ -161,17 +161,17 @@ class _SearchBot extends State<BottomBarSearch> {
].request(); ].request();
} }
// Future<void> initSpeechState() async { Future<void> initSpeechState() async {
// await speech.initialize(onError: errorListener, onStatus: statusListener); // await speech.initialize(onError: errorListener, onStatus: statusListener);
//
// _currentLocaleId = _currentLocaleId =
// TranslationBase.of(AppGlobal.context).locale.languageCode == 'en' TranslationBase.of(AppGlobal.context).locale.languageCode == 'en'
// ? 'en-GB' ? 'en-GB'
// : 'ar-SA'; // systemLocale.localeId; : 'ar-SA'; // systemLocale.localeId;
// flutterTts.setLanguage(_currentLocaleId); flutterTts.setLanguage(_currentLocaleId);
//
// // if (!mounted) return; // if (!mounted) return;
// } }
// void errorListener(SpeechRecognitionError error) { // void errorListener(SpeechRecognitionError error) {
// //setState(() { // //setState(() {

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save