merge-update-with-lab-changes
Sultan khan 2 years ago
parent abcf82346e
commit b45cbbcf29

@ -1,3 +1,3 @@
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_ORDER_HISTORY = '/api/orders/items';
var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara';
// var BASE_URL = 'http://10.50.100.198:4422/';
var BASE_URL = 'https://uat.hmgwebservices.com/';
// var BASE_URL = 'http://10.50.100.198:2018/';
var BASE_URL = 'https://uat.hmgwebservices.com/';
// var BASE_URL = 'https://hmgwebservices.com/';
// var BASE_URL = 'https://orash.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
// 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 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
// var BASE_PHARMACY_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
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 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 GENERAL_ID = 'Cs2020@2016\$2958';
var IP_ADDRESS = '10.20.10.20';
var VERSION_ID = 10.8;
var VERSION_ID = 10.9;
var SETUP_ID = '91877';
var LANGUAGE = 2;
// 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": "لا يمكنك تفعيل هذه الإجازة المرضية لأنك مريض مقبل."},
"dischargeDate": {"en": "Discharge Date", "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;
String genderDescription;
String invoiceNo;
String invoiceNo_VP;
bool isActiveDoctorProfile;
bool isDoctorAllowVedioCall;
bool isExecludeDoctor;
@ -68,6 +69,7 @@ class PatientLabOrders {
this.projectNameN,
this.qR,
this.setupID,
this.invoiceNo_VP,
this.speciality,this.isLiveCareAppointment});
PatientLabOrders.fromJson(Map<String, dynamic> json) {
@ -103,6 +105,7 @@ class PatientLabOrders {
projectNameN = json['ProjectNameN'];
qR = json['QR'];
setupID = json['SetupID'];
invoiceNo_VP = json['invoiceNo_VP'];
isLiveCareAppointment = json['IsLiveCareAppointment'];
// speciality = json['Speciality'].cast<String>();
}
@ -143,6 +146,7 @@ class PatientLabOrders {
data['SetupID'] = this.setupID;
data['Speciality'] = this.speciality;
data['IsLiveCareAppointment'] = this.isLiveCareAppointment;
data['invoiceNo_VP'] =this.invoiceNo_VP;
return data;
}
}

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

@ -23,8 +23,11 @@ class RequestSendLabReportEmail {
String doctorName;
String projectID;
String invoiceNo;
String invoiceNoVP;
String orderDate;
String orderNo;
bool isDownload;
int doctorID;
RequestSendLabReportEmail(
{this.versionID,
@ -51,8 +54,11 @@ class RequestSendLabReportEmail {
this.doctorName,
this.projectID,
this.invoiceNo,
this.invoiceNoVP,
this.orderDate,
this.orderNo});
this.orderNo,
this.isDownload,
this.doctorID});
RequestSendLabReportEmail.fromJson(Map<String, dynamic> json) {
versionID = json['VersionID'];
@ -79,8 +85,11 @@ class RequestSendLabReportEmail {
doctorName = json['DoctorName'];
projectID = json['ProjectID'];
invoiceNo = json['InvoiceNo'];
invoiceNoVP = json['InvoiceNo_VP'];
orderDate = json['OrderDate'];
orderNo = json['OrderNo'];
isDownload = json['IsDownload'];
doctorID = json['DoctorID'];
}
Map<String, dynamic> toJson() {
@ -109,8 +118,11 @@ class RequestSendLabReportEmail {
data['DoctorName'] = this.doctorName;
data['ProjectID'] = this.projectID;
data['InvoiceNo'] = this.invoiceNo;
data['InvoiceNo_VP'] = this.invoiceNoVP;
data['OrderDate'] = this.orderDate;
data['OrderNo'] = this.orderNo;
data['IsDownload'] = this.isDownload;
data['DoctorID'] = this.doctorID;
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 {
String setupID;
int projectID;
Null patientID;
dynamic patientID;
int invoiceLineItemNo;
int invoiceNo;
dynamic invoiceNo_VP;
int doctorID;
int clinicID;
DateTime orderDate;
@ -49,6 +50,7 @@ class FinalRadiology {
this.patientID,
this.invoiceLineItemNo,
this.invoiceNo,
this.invoiceNo_VP,
this.doctorID,
this.clinicID,
this.orderDate,
@ -92,6 +94,7 @@ class FinalRadiology {
patientID = json['PatientID'];
invoiceLineItemNo = json['InvoiceLineItemNo'];
invoiceNo = json['InvoiceNo'];
invoiceNo_VP = json['InvoiceNo_VP'];
doctorID = json['DoctorID'];
clinicID = json['ClinicID'];
orderDate = DateUtil.convertStringToDate(json['OrderDate']);
@ -141,6 +144,7 @@ class FinalRadiology {
data['PatientID'] = this.patientID;
data['InvoiceLineItemNo'] = this.invoiceLineItemNo;
data['InvoiceNo'] = this.invoiceNo;
data['InvoiceNo_VP'] = this.invoiceNo_VP;
data['DoctorID'] = this.doctorID;
data['ClinicID'] = this.clinicID;
data['OrderDate'] = this.orderDate;

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

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

@ -11,6 +11,8 @@ import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.da
class LabsService extends BaseService {
List<PatientLabOrders> patientLabOrdersList = List();
String labReportPDF = "";
Future getPatientLabOrdersList() async {
hasError = false;
Map<String, dynamic> body = Map();
@ -32,11 +34,14 @@ class LabsService extends BaseService {
List<LabResult> labResultList = 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;
_requestPatientLabSpecialResult.projectID = projectID;
_requestPatientLabSpecialResult.clinicID = clinicID;
_requestPatientLabSpecialResult.invoiceNo = invoiceNo;
_requestPatientLabSpecialResult.invoiceNo = isVidaPlus ? "0" : invoiceNo;
_requestPatientLabSpecialResult.invoiceNoVP = isVidaPlus ? invoiceNo : "0";
_requestPatientLabSpecialResult.orderNo = orderNo;
_requestPatientLabSpecialResult.setupID = setupID;
@ -51,10 +56,11 @@ class LabsService extends BaseService {
}, body: _requestPatientLabSpecialResult.toJson());
}
Future getPatientLabResult({PatientLabOrders patientLabOrder}) async {
Future getPatientLabResult({PatientLabOrders patientLabOrder, bool isVidaPlus}) async {
hasError = false;
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['isDentalAllowedBackend'] = false;
body['SetupID'] = patientLabOrder.setupID;
@ -174,7 +180,8 @@ class LabsService extends BaseService {
Future getPatientLabOrdersResults({PatientLabOrders patientLabOrder, String procedure}) async {
hasError = false;
Map<String, dynamic> body = Map();
body['InvoiceNo'] = patientLabOrder.invoiceNo;
body['InvoiceNo'] = "0";
body['InvoiceNo_VP'] = patientLabOrder.invoiceNo;
body['OrderNo'] = patientLabOrder.orderNo;
body['isDentalAllowedBackend'] = false;
body['SetupID'] = patientLabOrder.setupID;
@ -194,9 +201,10 @@ class LabsService extends BaseService {
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.invoiceNo = patientLabOrder.invoiceNo;
_requestSendLabReportEmail.invoiceNo = isVidaPlus ? "0" : patientLabOrder.invoiceNo;
_requestSendLabReportEmail.invoiceNoVP = isVidaPlus ? patientLabOrder.invoiceNo : "0";
_requestSendLabReportEmail.doctorName = patientLabOrder.doctorName;
_requestSendLabReportEmail.clinicName = patientLabOrder.clinicDescription;
_requestSendLabReportEmail.patientName = userObj.firstName + " " + userObj.lastName;
@ -208,8 +216,15 @@ class LabsService extends BaseService {
_requestSendLabReportEmail.projectName = patientLabOrder.projectName;
_requestSendLabReportEmail.setupID = patientLabOrder.setupID;
_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;
super.error = error;
}, body: _requestSendLabReportEmail.toJson());

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

@ -29,7 +29,7 @@ class ReportsService extends BaseService {
}
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;
await baseAppClient.post(REPORTS, onSuccess: (dynamic response, int statusCode) {
inpatientReportsList.clear();
@ -137,7 +137,7 @@ class ReportsService extends BaseService {
body['ProjectID'] = projectID;
body['Remarks'] = "";
body['ProcedureId'] = "";
body['RequestType'] = 2;
body['RequestType'] = 1;
body['Source'] = 2;
body['Status'] = 1;
body['CreatedBy'] = 102;

@ -1,19 +1,25 @@
import 'package:diplomaticquarterapp/config/config.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';
class PrivilegeService extends BaseService {
List<PrivilegeModel> privilegeModelList = List();
List<VidaPlusProjectListModel> vidaPlusProjectListModel = List();
Future getPrivilege() async {
Map<String, dynamic> body = Map();
body['PatientType'] = 4;
await baseAppClient.post(GET_PRIVILEGE,
onSuccess: (dynamic response, int statusCode) {
await baseAppClient.post(GET_PRIVILEGE, onSuccess: (dynamic response, int statusCode) {
response['ServicePrivilegeList'].forEach((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) {
hasError = true;
super.error = error;

@ -20,6 +20,8 @@ class LabsViewModel extends BaseViewModel {
List<LabOrderResult> get labOrdersResultsList => _labsService.labOrdersResultsList;
List<TimeSeriesSales2> timeSeries = [];
String get labReportPDF => _labsService.labReportPDF;
List<PatientLabOrdersList> _patientLabOrdersListClinic = List();
List<PatientLabOrdersList> _patientLabOrdersListHospital = List();
@ -46,7 +48,7 @@ class LabsViewModel extends BaseViewModel {
List<PatientLabOrdersList> patientLabOrdersHospital = _patientLabOrdersListHospital
.where(
(elementClinic) => elementClinic.filterName == element.projectName,
)
)
.toList();
if (patientLabOrdersHospital.length != 0) {
@ -72,9 +74,14 @@ class LabsViewModel extends BaseViewModel {
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);
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) {
error = _labsService.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);
await _labsService.getPatientLabResult(patientLabOrder: patientLabOrder);
await _labsService.getPatientLabResult(patientLabOrder: patientLabOrder, isVidaPlus: isVidaPlus);
if (_labsService.hasError) {
error = _labsService.error;
setState(ViewState.Error);
@ -135,11 +142,14 @@ class LabsViewModel extends BaseViewModel {
}
}
sendLabReportEmail({PatientLabOrders patientLabOrder, String mes, AuthenticatedUser userObj}) async {
await _labsService.sendLabReportEmail(patientLabOrder: patientLabOrder, userObj: userObj);
sendLabReportEmail({PatientLabOrders patientLabOrder, String mes, AuthenticatedUser userObj, bool isVidaPlus, bool isDownload = false}) async {
await _labsService.sendLabReportEmail(patientLabOrder: patientLabOrder, userObj: userObj, isVidaPlus: isVidaPlus, isDownload: isDownload);
if (_labsService.hasError) {
error = _labsService.error;
} else
AppToast.showSuccessToast(message: mes);
} else {
if (isDownload) {} else {
AppToast.showSuccessToast(message: mes);
}
}
}
}

@ -18,9 +18,14 @@ class RadiologyViewModel extends BaseViewModel {
List<FinalRadiologyList> get finalRadiologyList => filterType == FilterType.Clinic ? _finalRadiologyListClinic : _finalRadiologyListHospital;
bool _isRadiologyVIDAPlus = false;
bool get isRadiologyVIDAPlus => _isRadiologyVIDAPlus;
void getPatientRadOrders() async {
setState(ViewState.Busy);
await _radiologyService.getPatientRadOrders();
_isRadiologyVIDAPlus = _radiologyService.isRadiologyVIDAPlus;
if (_radiologyService.hasError) {
error = _radiologyService.error;
setState(ViewState.Error);
@ -43,9 +48,9 @@ class RadiologyViewModel extends BaseViewModel {
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);
await _radiologyService.getRadImageURL(invoiceNo: invoiceNo, lineItem: lineItem, projectId: projectId);
await _radiologyService.getRadImageURL(invoiceNo: invoiceNo, lineItem: lineItem, projectId: projectId, isVidaPlus: isVidaPlus);
if (_radiologyService.hasError) {
error = _radiologyService.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/shared_pref_kay.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/locator.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';
var isAppArabic = false;
class ProjectViewModel extends BaseViewModel {
class ProjectViewModel extends BaseViewModel {
GAnalytics get analytics => locator<GAnalytics>();
// Platform Bridge
@ -39,10 +40,14 @@ class ProjectViewModel extends BaseViewModel {
double _latitude;
double _longitude;
RegisterInfoResponse _registerInfo =RegisterInfoResponse();
RegisterInfoResponse _registerInfo = RegisterInfoResponse();
double get latitude => _latitude;
double get longitude => _longitude;
RegisterInfoResponse get registerInfo=> _registerInfo;
RegisterInfoResponse get registerInfo => _registerInfo;
dynamic get searchValue => searchvalue;
Locale get appLocal => _appLocale;
@ -54,9 +59,11 @@ class ProjectViewModel extends BaseViewModel {
bool isLoginChild = false;
List<PrivilegeModel> privilegeRootUser = List();
List<PrivilegeModel> privilegeChildUser = List();
List<VidaPlusProjectListModel> _vidaPlusProjectListModel = List();
List<PrivilegeModel> get privileges =>
isLoginChild ? privilegeChildUser : privilegeChildUser;
List<PrivilegeModel> get privileges => isLoginChild ? privilegeChildUser : privilegeChildUser;
List<VidaPlusProjectListModel> get vidaPlusProjectList => _vidaPlusProjectListModel;
List<LaserBodyPart> selectedBodyPartList = [];
@ -64,9 +71,7 @@ class ProjectViewModel extends BaseViewModel {
ProjectViewModel() {
loadSharedPrefLanguage();
subscription = Connectivity()
.onConnectivityChanged
.listen((ConnectivityResult result) {
subscription = Connectivity().onConnectivityChanged.listen((ConnectivityResult result) {
switch (result) {
case ConnectivityResult.wifi:
isInternetConnection = true;
@ -89,8 +94,7 @@ class ProjectViewModel extends BaseViewModel {
}
Future loadSharedPrefLanguage() async {
currentLanguage =
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
currentLanguage = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
_appLocale = Locale(currentLanguage);
isAppArabic = _isArabic = currentLanguage == 'ar';
notifyListeners();
@ -121,6 +125,11 @@ class ProjectViewModel extends BaseViewModel {
notifyListeners();
}
setVidaPlusProjectList(List<VidaPlusProjectListModel> vidaPlusProjectListModelInput) {
_vidaPlusProjectListModel = vidaPlusProjectListModelInput;
notifyListeners();
}
setPrivilege({privilegeList, bool isLoginChild = false}) {
List<PrivilegeModel> privilege = List();
@ -166,8 +175,9 @@ class ProjectViewModel extends BaseViewModel {
searchvalue = data;
notifyListeners();
}
setRegisterData(RegisterInfoResponse data){
_registerInfo =data;
setRegisterData(RegisterInfoResponse data) {
_registerInfo = data;
notifyListeners();
}
}

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

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

@ -1,6 +1,6 @@
class AncillaryOrdersListModel {
List<AncillaryOrderList> ancillaryOrderList;
Null errCode;
dynamic errCode;
String message;
int patientID;
String patientName;
@ -32,7 +32,7 @@ class AncillaryOrdersListModel {
errCode = json['ErrCode'];
message = json['Message'];
patientID = json['PatientID'];
patientName = json['PatientName'];
patientName = json['PatientName'] != null ? json['PatientName'] : "";
patientType = json['PatientType'];
projectID = json['ProjectID'];
projectName = json['ProjectName'];
@ -83,7 +83,7 @@ class AncillaryOrderList {
appointmentDate = json['AppointmentDate'];
appointmentNo = json['AppointmentNo'];
clinicID = json['ClinicID'];
clinicName = json['ClinicName'];
clinicName = json['ClinicName'] != null ? json['ClinicName'] : "";
doctorID = json['DoctorID'];
doctorName = json['DoctorName'];
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 orderDescription;
bool isInstallment;
int projectID;
num projectID;
String accessCode;
String sHARequestPhase;
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/Authentication/authenticated_user.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/base/base_view.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
@ -571,7 +572,6 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
} else {
checkPaymentStatus(appo);
}
}
checkTamaraPaymentStatus(String orderID, AppoitmentAllHistoryResultList appo) {
@ -633,18 +633,21 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
createAdvancePayment(res, AppoitmentAllHistoryResultList appo) {
DoctorsListService service = new DoctorsListService();
String paymentReference = res['Fort_id'].toString();
service.HIS_createAdvancePayment(
appo,
widget.projectID.toString(),
res['Amount'],
res['Fort_id'],
res['PaymentMethod'],
projectViewModel.user.patientType,
projectViewModel.user.firstName + " " + projectViewModel.user.lastName,
projectViewModel.user.patientID,
localContext)
// List<AncillaryOrdersProcedureList> ancillaryOrdersProcedureList = [];
// selectedProcList.forEach((element) {
// ancillaryOrdersProcedureList.add(new AncillaryOrdersProcedureList(procedureID: num.parse(element.procedureID), procedureDescription: element.procedureName));
// });
service.HIS_createAdvancePayment(appo, widget.projectID.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], projectViewModel.user.patientType,
projectViewModel.user.firstName + " " + projectViewModel.user.lastName, projectViewModel.user.patientID, localContext,
isAncillaryOrder: true)
.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) {
GifLoaderDialogUtils.hideDialog(localContext);
AppToast.showErrorToast(message: err);
@ -665,7 +668,6 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
autoGenerateInvoice() {
List<dynamic> selectedProcListAPI = [];
Map<dynamic, dynamic> selectedProcListAPIMap;
selectedProcList.forEach((element) {
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/patient_info_and_mobile_number.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/Authentication/authenticated_user.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/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:provider/provider.dart';
import 'dialogs/ConfirmSMSDialog.dart';
import 'new_text_Field.dart';
@ -31,11 +33,13 @@ class ConfirmPaymentPage extends StatelessWidget {
MyInAppBrowser browser;
AuthenticatedUser authenticatedUser;
AppSharedPreferences sharedPref = AppSharedPreferences();
ProjectViewModel projectViewModel;
ConfirmPaymentPage({this.advanceModel, this.patientInfoAndMobileNumber, this.selectedPaymentMethod, this.authenticatedUser});
@override
Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
void showSMSDialog() {
showDialog(
context: context,
@ -250,8 +254,13 @@ class ConfirmPaymentPage extends StatelessWidget {
GifLoaderDialogUtils.showMyDialog(AppGlobal.context);
service.createAdvancePayment(appo, appo.projectID.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], AppGlobal.context).then((res) {
GifLoaderDialogUtils.hideDialog(AppGlobal.context);
print(res['OnlineCheckInAppointments'][0]['AdvanceNumber']);
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) {
GifLoaderDialogUtils.hideDialog(AppGlobal.context);
AppToast.showErrorToast(message: err);

@ -59,6 +59,10 @@ class _BookConfirmState extends State<BookConfirm> {
AppSharedPreferences sharedPref = new AppSharedPreferences();
bool isInsured = false;
bool isEligible = false;
bool isCash = false;
@override
void initState() {
// widget.authUser = new AuthenticatedUser();
@ -331,9 +335,9 @@ class _BookConfirmState extends State<BookConfirm> {
AppToast.showSuccessToast(message: TranslationBase.of(context).bookedSuccess);
Future.delayed(new Duration(milliseconds: 500), () {
checkPatientNphiesEligibility(docObject, res['AppointmentNo'], context);
// getPatientShare(context, res['AppointmentNo'], docObject.clinicID, docObject.projectID, docObject);
// getToDoCount();
// checkPatientNphiesEligibility(docObject, res['AppointmentNo'], context);
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) {
@ -437,13 +441,40 @@ class _BookConfirmState extends State<BookConfirm> {
}
getPatientShare(context, String appointmentNo, int clinicID, int projectID, DoctorList docObject) {
String errorMsg = "";
GifLoaderDialogUtils.showMyDialog(context);
widget.service.getPatientShare(appointmentNo, clinicID, projectID, context).then((res) {
projectViewModel.selectedBodyPartList.clear();
projectViewModel.laserSelectionDuration = 0;
print(res);
widget.patientShareResponse = new PatientShareResponse.fromJson(res);
navigateToBookSuccess(context, docObject, widget.patientShareResponse);
widget.patientShareResponse = new PatientShareResponse.fromJson(res['OnlineCheckInAppointments'][0]);
isInsured = res["IsInsured"];
isEligible = res["IsEligible"];
isCash = res["IsCash"];
if (isCash) {
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) {
GifLoaderDialogUtils.hideDialog(context);
// AppToast.showErrorToast(message: err);

@ -1,6 +1,5 @@
import 'dart:io';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
@ -46,6 +45,7 @@ class BookSuccess extends StatefulWidget {
class _BookSuccessState extends State<BookSuccess> {
AppSharedPreferences sharedPref = AppSharedPreferences();
// AuthenticatedUser authUser;
ProjectViewModel projectViewModel;
@ -775,7 +775,13 @@ class _BookSuccessState extends State<BookSuccess> {
DoctorsListService service = new DoctorsListService();
String paymentReference = res['Fort_id'].toString();
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) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err);

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

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

@ -402,8 +402,12 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
DoctorsListService service = new DoctorsListService();
String paymentReference = res['Fort_id'].toString();
service.createAdvancePayment(appo, appo.projectID.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], context).then((res) {
print(res['OnlineCheckInAppointments'][0]['AdvanceNumber']);
addAdvancedNumberRequest(res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), paymentReference, appo.appointmentNo.toString());
addAdvancedNumberRequest(
Utils.isVidaPlusProject(projectViewModel, appo.projectID)
? res['OnlineCheckInAppointments'][0]['AdvanceNumber_VP'].toString()
: res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(),
paymentReference,
appo.appointmentNo.toString());
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err);

@ -79,6 +79,10 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
bool dataLoaded = false;
bool isInsured = false;
bool isEligible = false;
bool isCash = false;
@override
void initState() {
widget.patientShareResponse = new PatientShareResponse();
@ -543,8 +547,8 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
confirmAppointment(appo);
break;
case 20:
// getPatientShare(context, appo);
checkPatientNphiesEligibility(context, appo);
getPatientShare(context, appo);
// checkPatientNphiesEligibility(context, appo);
break;
case 30:
getAppoQR(context, appo);
@ -889,6 +893,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
}
getPatientShare(context, AppoitmentAllHistoryResultList appo) {
String errorMsg = "";
DoctorsListService service = new DoctorsListService();
if (appo.isLiveCareAppointment) {
getLiveCareAppointmentPatientShare(context, service, appo);
@ -896,8 +901,33 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
GifLoaderDialogUtils.showMyDialog(context);
service.getPatientShare(appo.appointmentNo.toString(), appo.clinicID, appo.projectID, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
widget.patientShareResponse = new PatientShareResponse.fromJson(res);
openPaymentDialog(appo, widget.patientShareResponse);
widget.patientShareResponse = new PatientShareResponse.fromJson(res['OnlineCheckInAppointments'][0]);
isInsured = res["IsInsured"];
isEligible = res["IsEligible"];
isCash = res["IsCash"];
if (isCash) {
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) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err);
@ -1181,7 +1211,14 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
String paymentReference = res['Fort_id'].toString();
service.createAdvancePayment(appo, appo.projectID.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], context).then((res) {
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) {
print(err);
GifLoaderDialogUtils.hideDialog(context);

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

@ -132,7 +132,15 @@ class _AttachInsuranceCardImageDialogState extends State<AttachInsuranceCardImag
),
Padding(
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,
() {
Navigator.pop(context);

@ -184,19 +184,24 @@ class InsurancePage extends StatelessWidget {
void updateManually(BuildContext context, String errorMsg, String patientIdentificationID, int patientID, String mobileNumber) {
ConfirmDialog dialog = new ConfirmDialog(
context: context,
// confirmMessage: errorMsg + ". " + TranslationBase.of(context).habibCallCenter,
// okText: TranslationBase.of(context).ok,
// cancelText: TranslationBase.of(context).cancel,
confirmMessage: errorMsg + ". " + TranslationBase.of(context).updateInsuranceManuallyDialog,
okText: TranslationBase.of(context).yes,
cancelText: TranslationBase.of(context).no,
okFunction: () => {
Navigator.pop(context),
Navigator.push(
context,
FadePage(
page: UpdateInsuranceManually(
context,
FadePage(
page: UpdateInsuranceManually(
patientIdentificationNo: patientIdentificationID,
patientID: patientID,
patientMobileNumber: mobileNumber,
)))
),
),
),
},
cancelFunction: () => {});
dialog.showAlertDialog(context);

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

@ -60,6 +60,7 @@ class AskDoctorPage extends StatelessWidget {
itemBuilder: (context, _index) {
DoctorList _doctor = _doctorList[_index];
DoctorList doctorList = DoctorList(
date: _doctor.date,
projectID: _doctor.projectID,
setupID: _doctor.setupID,
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/pages/base/base_view.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/others/app_expandable_notifier.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -27,7 +28,7 @@ class DoctorResponse extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 65,
height: 16,
),
AppExpandableNotifier(
headerWidget: Padding(
@ -61,14 +62,18 @@ class DoctorResponse extends StatelessWidget {
return InkWell(
onTap: () {
///go to page ViewDoctorResponsesPage
Navigator.push(
context,
FadePage(
page: ViewDoctorResponsesPage(
doctorResponse: doctor,
if (doctor.transactions != null && doctor.transactions.isNotEmpty) {
Navigator.push(
context,
FadePage(
page: ViewDoctorResponsesPage(
doctorResponse: doctor,
),
),
),
);
);
} else {
Utils.showErrorToast("There are no doctor responses for this request.");
}
},
child: Container(
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,
widget.advanceModel.patientName, widget.advanceModel.fileNumber, AppGlobal.context)
.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) {
GifLoaderDialogUtils.hideDialog(AppGlobal.context);
AppToast.showErrorToast(message: err);

@ -106,7 +106,7 @@ class MyBalancePage extends StatelessWidget {
),
),
Text(
TranslationBase.of(context).sar,
projectViewModel.user.outSA == 1 ? TranslationBase.of(context).aed : TranslationBase.of(context).sar,
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold,
@ -157,7 +157,7 @@ class MyBalancePage extends StatelessWidget {
),
),
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(
fontSize: 16,
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/viewModels/medical/labs_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.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/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/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.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';
class LaboratoryResultPage extends StatefulWidget {
@ -25,11 +34,13 @@ class _LaboratoryResultPageState extends State<LaboratoryResultPage> {
ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<LabsViewModel>(
onModelReady: (model) => model.getLaboratoryResult(
invoiceNo: widget.patientLabOrders.invoiceNo,
clinicID: widget.patientLabOrders.clinicID,
projectID: widget.patientLabOrders.projectID,
orderNo: widget.patientLabOrders.orderNo,
setupID: widget.patientLabOrders.setupID),
invoiceNo: widget.patientLabOrders.invoiceNo,
clinicID: widget.patientLabOrders.clinicID,
projectID: widget.patientLabOrders.projectID,
orderNo: widget.patientLabOrders.orderNo,
setupID: widget.patientLabOrders.setupID,
isVidaPlus: Utils.isVidaPlusProject(projectViewModel, num.parse(widget.patientLabOrders.projectID)),
),
builder: (_, model, w) => AppScaffold(
isShowAppBar: true,
appBarTitle: widget.patientLabOrders.doctorName,
@ -37,27 +48,73 @@ class _LaboratoryResultPageState extends State<LaboratoryResultPage> {
showNewAppBar: true,
showNewAppBarTitle: true,
backgroundColor: Color(0xffF8F8F8),
body: ListView.builder(
physics: BouncingScrollPhysics(),
padding: EdgeInsets.only(bottom: 12),
itemBuilder: (context, index) => LaboratoryResultWidget(
onTap: () async {
GifLoaderDialogUtils.showMyDialog(context);
await model.sendLabReportEmail(patientLabOrder: widget.patientLabOrders, mes: TranslationBase.of(context).sendSuc, userObj: projectViewModel.user);
GifLoaderDialogUtils.hideDialog(context);
},
billNo: widget.patientLabOrders.invoiceNo,
// details: model.patientLabSpecialResult[index].resultDataHTML,
details: model.patientLabSpecialResult.isEmpty ? null : getSpecialResults(model),
orderNo: widget.patientLabOrders.orderNo,
patientLabOrder: widget.patientLabOrders,
body: SingleChildScrollView(
child: Column(
children: [
ListView.builder(
physics: BouncingScrollPhysics(),
shrinkWrap: true,
padding: EdgeInsets.only(bottom: 12),
itemBuilder: (context, index) => LaboratoryResultWidget(
onTap: () 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)));
GifLoaderDialogUtils.hideDialog(context);
},
billNo: widget.patientLabOrders.invoiceNo,
// details: model.patientLabSpecialResult[index].resultDataHTML,
details: model.patientLabSpecialResult.isEmpty ? null : getSpecialResults(model),
orderNo: widget.patientLabOrders.orderNo,
patientLabOrder: widget.patientLabOrders,
),
itemCount: 1,
),
SizedBox(
height: 120.0,
)
],
),
itemCount: 1,
),
// 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 labResults = "";
model.patientLabSpecialResult.forEach((element) {

@ -1,12 +1,12 @@
import 'package:diplomaticquarterapp/config/config.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/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/models/header_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.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/widgets/buttons/defaultButton.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 {
final FinalRadiology finalRadiology;
bool isRadiologyVidaPlus;
RadiologyDetailsPage({Key key, this.finalRadiology});
RadiologyDetailsPage({Key key, this.finalRadiology, this.isRadiologyVidaPlus});
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
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(
appBarTitle: TranslationBase.of(context).report,
isShowAppBar: true,
@ -45,7 +50,7 @@ class RadiologyDetailsPage extends StatelessWidget {
finalRadiology.doctorID,
finalRadiology.doctorImageURL,
finalRadiology.speciality,
finalRadiology.invoiceNo.toString(),
Utils.isVidaPlusProject(projectViewModel, finalRadiology.projectID) ? finalRadiology.invoiceNo_VP.toString() : finalRadiology.invoiceNo.toString(),
finalRadiology.projectName,
finalRadiology.orderDate,
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/medical/radiology/radiology_details_page.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/new_design/my_tab_view.dart';
import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart';
@ -78,12 +79,14 @@ class RadiologyHomePage extends StatelessWidget {
FadePage(
page: RadiologyDetailsPage(
finalRadiology: radiology,
isRadiologyVidaPlus: Utils.isVidaPlusProject(projectViewModel, radiology.projectID),
),
),
),
isInOutPatient: radiology.isInOutPatient,
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,
subName: _isSortByClinic ? radiology.projectName : radiology.clinicDescription,
isLiveCareAppointment: radiology.isLiveCareAppointment,

@ -70,74 +70,73 @@ class _HomeReportPageState extends State<HomeReportPage> with SingleTickerProvid
body: Container(
child: Column(
children: [
TabBar(
controller: _tabController_new,
indicatorWeight: 3.0,
indicatorSize: TabBarIndicatorSize.tab,
labelColor: Color(0xff2B353E),
unselectedLabelColor: Color(0xff575757),
labelPadding: EdgeInsets.only(top: 15, bottom: 13, left: 20, right: 20),
labelStyle: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
letterSpacing: -0.48,
),
unselectedLabelStyle: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
letterSpacing: -0.48,
),
onTap: (int value) {
print(value);
setState(() {});
},
tabs: [
Text(
TranslationBase.of(context).outpatient,
style: TextStyle(fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins'),
),
Text(
TranslationBase.of(context).inPatient,
style: TextStyle(fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins'),
),
],
),
// TabBar(
// controller: _tabController_new,
// indicatorWeight: 3.0,
// indicatorSize: TabBarIndicatorSize.tab,
// labelColor: Color(0xff2B353E),
// unselectedLabelColor: Color(0xff575757),
// labelPadding: EdgeInsets.only(top: 15, bottom: 13, left: 20, right: 20),
// labelStyle: TextStyle(
// fontSize: 16,
// fontWeight: FontWeight.w600,
// letterSpacing: -0.48,
// ),
// unselectedLabelStyle: TextStyle(
// fontSize: 16,
// fontWeight: FontWeight.w600,
// letterSpacing: -0.48,
// ),
// onTap: (int value) {
// print(value);
// setState(() {});
// },
// tabs: [
// Text(
// TranslationBase.of(context).outpatient,
// style: TextStyle(fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins'),
// ),
// Text(
// TranslationBase.of(context).inPatient,
// style: TextStyle(fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins'),
// ),
// ],
// ),
if (model.user != null)
Expanded(
child:
TabBarView(
physics: BouncingScrollPhysics(),
controller: _tabController_new,
children: <Widget>[
child: TabBarView(
physics: BouncingScrollPhysics(),
controller: _tabController_new,
children: <Widget>[
Container(
child: Column(
children: [
Padding(
padding: EdgeInsets.all(21),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
myRadioButton(TranslationBase.of(context).requested, 0),
myRadioButton(TranslationBase.of(context).ready, 1),
myRadioButton(TranslationBase.of(context).cancelled, 2),
],
),
child: Column(
children: [
Padding(
padding: EdgeInsets.all(21),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
myRadioButton(TranslationBase.of(context).requested, 0),
myRadioButton(TranslationBase.of(context).ready, 1),
myRadioButton(TranslationBase.of(context).cancelled, 2),
],
),
),
Expanded(
child: IndexedStack(
index: _currentPage,
children: [
ReportListWidget(reportList: model.reportsOrderRequestList, emailAddress: model.user.emailAddress),
ReportListWidget(reportList: model.reportsOrderReadyList, emailAddress: model.user.emailAddress),
ReportListWidget(reportList: model.reportsOrderCanceledList, emailAddress: model.user.emailAddress),
],
),
)
],
),
Expanded(
child: IndexedStack(
index: _currentPage,
children: [
ReportListWidget(reportList: model.reportsOrderRequestList, emailAddress: model.user.emailAddress),
ReportListWidget(reportList: model.reportsOrderReadyList, emailAddress: model.user.emailAddress),
ReportListWidget(reportList: model.reportsOrderCanceledList, emailAddress: model.user.emailAddress),
],
),
)
],
),
),
// InPatient Medical Reports
Container(
),
// InPatient Medical Reports
Container(
child: model.admissionsMedicalReportList.isNotEmpty
? Column(
children: [
@ -249,20 +248,21 @@ class _HomeReportPageState extends State<HomeReportPage> with SingleTickerProvid
if (projectViewModel.havePrivilege(21)
// && _tabController_new.index == 0
)
Padding(
padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21),
child: DefaultButton(
TranslationBase.of(context).requestMedicalReport.toLowerCase().capitalizeFirstofEach,
() => Navigator.push(
context,
FadePage(
page: MedicalReports(),
),
).then((value) {
model.getReports();
}),
),
)
if (_tabController_new.index == 0)
Padding(
padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21),
child: DefaultButton(
TranslationBase.of(context).requestMedicalReport.toLowerCase().capitalizeFirstofEach,
() => Navigator.push(
context,
FadePage(
page: MedicalReports(),
),
).then((value) {
model.getReports();
}),
),
)
],
),
),

@ -117,23 +117,23 @@ class ReportListWidget extends StatelessWidget {
if (reportList[index].status == 2)
Row(
children: [
InkWell(
onTap: () {
getMedicalReportPDF(report);
},
child: Padding(
padding: const EdgeInsets.only(right: 11.0, left: 11.0),
child: Text(TranslationBase.of(context).viewReport,
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w600,
fontStyle: FontStyle.italic,
color: CustomColors.accentColor,
letterSpacing: -0.48,
height: 18 / 12,
decoration: TextDecoration.underline)),
),
),
// InkWell(
// onTap: () {
// getMedicalReportPDF(report);
// },
// child: Padding(
// padding: const EdgeInsets.only(right: 11.0, left: 11.0),
// child: Text(TranslationBase.of(context).viewReport,
// style: TextStyle(
// fontSize: 12,
// fontWeight: FontWeight.w600,
// fontStyle: FontStyle.italic,
// color: CustomColors.accentColor,
// letterSpacing: -0.48,
// height: 18 / 12,
// decoration: TextDecoration.underline)),
// ),
// ),
IconButton(
icon: Icon(Icons.email),
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/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart';
@ -95,11 +95,11 @@ class PaymentService extends StatelessWidget {
? Positioned(
left: 8,
top: 4,
child: Badge(
child: badge_import.Badge(
toAnimate: false,
elevation: 0,
position: BadgePosition.topEnd(),
shape: BadgeShape.circle,
position: badge_import.BadgePosition.topEnd(),
shape: badge_import.BadgeShape.circle,
badgeColor: secondaryColor.withOpacity(1.0),
borderRadius: BorderRadius.circular(8),
badgeContent: Container(
@ -111,11 +111,11 @@ class PaymentService extends StatelessWidget {
: Positioned(
right: 8,
top: 4,
child: Badge(
child: badge_import.Badge(
toAnimate: false,
elevation: 0,
position: BadgePosition.topEnd(),
shape: BadgeShape.circle,
position: badge_import.BadgePosition.topEnd(),
shape: badge_import.BadgeShape.circle,
badgeColor: secondaryColor.withOpacity(1.0),
borderRadius: BorderRadius.circular(8),
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/Authentication/authenticated_user.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/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
@ -484,7 +485,7 @@ class DoctorsListService extends BaseService {
dynamic localRes;
await baseAppClient.post(GET_PATIENT_SHARE, onSuccess: (response, statusCode) async {
localRes = response['OnlineCheckInAppointments'][0];
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
@ -961,6 +962,7 @@ class DoctorsListService extends BaseService {
Request req = appGlobal.getPublicRequest();
request = {
"AdvanceNumber": advanceNumber,
"AdvanceNumber_VP": advanceNumber,
"PaymentReferenceNumber": paymentReference,
"AppointmentID": appointmentID,
"VersionID": req.VersionID,
@ -1046,12 +1048,18 @@ class DoctorsListService extends BaseService {
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
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 = {
"RequestAncillaryOrderInvoice": [
{"MemberID": 102, "ProjectID": projectID, "AppointmentNo": appointmentID, "OrderNo": orderNo, "AncillaryOrderInvoiceProcList": selectedProcListAPI}
]
],
"ProcedureOrderIds": procedureOrderIDs
};
dynamic localRes;
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,
String patientName, dynamic patientID, BuildContext context) async {
String patientName, dynamic patientID, BuildContext context,
{bool isAncillaryOrder = false}) async {
Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
@ -1400,6 +1409,8 @@ class DoctorsListService extends BaseService {
"SessionID": "YckwoXhUmWBsnHKEKig",
"isDentalAllowedBackend": false,
"PatientTypeID": patientType,
"IsAncillaryOrder": isAncillaryOrder,
// "AncillaryProcedureList": ancillaryOrdersProcedureList,
"PatientType": patientType
};
dynamic localRes;
@ -1832,4 +1843,6 @@ class DoctorsListService extends BaseService {
return Future.value(localRes);
}
}

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

@ -2902,6 +2902,12 @@ class TranslationBase {
String get sickLeaveAdmittedPatient => localizedValues["sickLeaveAdmittedPatient"][locale.languageCode];
String get dischargeDate => localizedValues["dischargeDate"][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 '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:connectivity/connectivity.dart';
import 'package:crypto/crypto.dart' as crypto;
@ -241,11 +241,11 @@ class Utils {
? Positioned(
left: 8,
top: 4,
child: Badge(
child: badge_import.Badge(
toAnimate: false,
elevation: 0,
position: BadgePosition.topEnd(),
shape: BadgeShape.circle,
position: badge_import.BadgePosition.topEnd(),
shape: badge_import.BadgeShape.circle,
badgeColor: secondaryColor.withOpacity(1.0),
borderRadius: BorderRadius.circular(8),
badgeContent: Container(
@ -259,11 +259,11 @@ class Utils {
? Positioned(
right: 8,
top: 4,
child: Badge(
child: badge_import.Badge(
toAnimate: false,
elevation: 0,
position: BadgePosition.topEnd(),
shape: BadgeShape.circle,
position: badge_import.BadgePosition.topEnd(),
shape: badge_import.BadgeShape.circle,
badgeColor: secondaryColor.withOpacity(1.0),
borderRadius: BorderRadius.circular(8),
badgeContent: Container(
@ -614,11 +614,11 @@ class Utils {
? Positioned(
left: 8,
top: 4,
child: Badge(
child: badge_import.Badge(
toAnimate: false,
elevation: 0,
position: BadgePosition.topEnd(),
shape: BadgeShape.circle,
position: badge_import.BadgePosition.topEnd(),
shape: badge_import.BadgeShape.circle,
badgeColor: secondaryColor.withOpacity(1.0),
borderRadius: BorderRadius.circular(8),
badgeContent: Container(
@ -632,11 +632,11 @@ class Utils {
? Positioned(
right: 8,
top: 4,
child: Badge(
child: badge_import.Badge(
toAnimate: false,
elevation: 0,
position: BadgePosition.topEnd(),
shape: BadgeShape.circle,
position: badge_import.BadgePosition.topEnd(),
shape: badge_import.BadgeShape.circle,
badgeColor: secondaryColor.withOpacity(1.0),
borderRadius: BorderRadius.circular(8),
badgeContent: Container(
@ -810,6 +810,16 @@ class Utils {
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() {
}

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

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

@ -1,5 +1,6 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter_gifimage/flutter_gifimage.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter_gif/flutter_gif.dart';
class GifLoaderContainer extends StatefulWidget {
@override
@ -7,15 +8,16 @@ class GifLoaderContainer extends StatefulWidget {
}
class _GifLoaderContainerState extends State<GifLoaderContainer> with TickerProviderStateMixin {
GifController controller1;
late FlutterGifController controller;
@override
void initState() {
controller1 = GifController(vsync: this);
FlutterGifController controller= FlutterGifController(vsync: this);
WidgetsBinding.instance.addPostFrameCallback((_) {
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) {}
});
super.initState();
@ -23,7 +25,7 @@ class _GifLoaderContainerState extends State<GifLoaderContainer> with TickerProv
@override
void dispose() {
controller1.dispose();
controller.dispose();
super.dispose();
}
@ -34,7 +36,7 @@ class _GifLoaderContainerState extends State<GifLoaderContainer> with TickerProv
child: Container(
// margin: EdgeInsets.only(bottom: 40),
child: GifImage(
controller: controller1,
controller: controller,
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 {
AnimatedButton({
Key key,
@required this.text,
@required this.onPressed,
@required this.controller,
Key? key,
required this.text,
required this.onPressed,
required this.controller,
this.textColor,
this.loadingColor,
required this.loadingColor,
this.color,
}) : super(key: key);
final String text;
final Color color;
final Color textColor;
final Color? color;
final Color? textColor;
final Color loadingColor;
final Function onPressed;
final VoidCallback? onPressed;
final AnimationController controller;
@override
@ -28,18 +28,18 @@ class AnimatedButton extends StatefulWidget {
class _AnimatedButtonState extends State<AnimatedButton>
with SingleTickerProviderStateMixin {
Animation<double> _sizeAnimation;
Animation<double> _textOpacityAnimation;
Animation<double> _buttonOpacityAnimation;
Animation<double> _ringThicknessAnimation;
Animation<double> _ringOpacityAnimation;
Animation<Color> _colorAnimation;
late Animation<double> _sizeAnimation;
late Animation<double> _textOpacityAnimation;
late Animation<double> _buttonOpacityAnimation;
late Animation<double> _ringThicknessAnimation;
late Animation<double> _ringOpacityAnimation;
late Animation<Color?> _colorAnimation;
var _isLoading = false;
var _hover = false;
var _width = 120.0;
Color _color;
Color _loadingColor;
late Color _color;
late Color _loadingColor;
static const _height = 40.0;
static const _loadingCircleRadius = _height / 2;
@ -91,10 +91,11 @@ class _AnimatedButtonState extends State<AnimatedButton>
final theme = Theme.of(context);
final buttonTheme = theme.floatingActionButtonTheme;
_color = widget.color ?? buttonTheme.backgroundColor;
_loadingColor = widget.loadingColor ?? theme.accentColor;
_color = (widget.color ?? buttonTheme.backgroundColor)!;
_loadingColor = widget.loadingColor ?? theme.colorScheme.secondary;
_colorAnimation = ColorTween(
begin: _color,
end: _loadingColor,
).animate(
@ -137,14 +138,14 @@ class _AnimatedButtonState extends State<AnimatedButton>
/// sets width and size animation
void _updateWidth() {
final theme = Theme.of(context);
final fontSize = theme.textTheme.button.fontSize;
final fontSize = theme.textTheme.button!.fontSize;
final renderParagraph = RenderParagraph(
TextSpan(
text: widget.text,
style: TextStyle(
fontSize: fontSize,
fontWeight: theme.textTheme.button.fontWeight,
letterSpacing: theme.textTheme.button.letterSpacing,
fontWeight: theme.textTheme.button!.fontWeight,
letterSpacing: theme.textTheme.button!.letterSpacing,
),
),
textDirection: TextDirection.ltr,
@ -155,7 +156,7 @@ class _AnimatedButtonState extends State<AnimatedButton>
// text width based on fontSize, plus 45.0 for padding
var textWidth =
renderParagraph.getMinIntrinsicWidth(fontSize).ceilToDouble() + 45.0;
renderParagraph.getMinIntrinsicWidth(fontSize!).ceilToDouble() + 45.0;
// button width is min 120.0 and max 240.0
_width = textWidth > 120.0 && textWidth < 240.0
@ -196,14 +197,14 @@ class _AnimatedButtonState extends State<AnimatedButton>
color: _colorAnimation.value,
child: child,
shadowColor: _color,
elevation: !_isLoading
? (_hover
? buttonTheme.highlightElevation
: buttonTheme.elevation)
: 0,
elevation: (_isLoading == false)
? (_hover == true
? buttonTheme.highlightElevation ?? 0.0
: buttonTheme.elevation ?? 0.0)
: 0.0,
),
child: InkWell(
onTap: !_isLoading ? widget.onPressed : null,
onTap: !_isLoading ? widget!.onPressed : null,
splashColor: buttonTheme.splashColor,
customBorder: buttonTheme.shape,
onHighlightChanged: (value) => setState(() => _hover = value),
@ -235,7 +236,7 @@ class _AnimatedButtonState extends State<AnimatedButton>
child: AnimatedBuilder(
animation: _ringThicknessAnimation,
builder: (context, child) => Ring(
color: widget.loadingColor,
color: widget!.loadingColor,
size: _height,
thickness: _ringThicknessAnimation.value,
),
@ -259,8 +260,8 @@ class _AnimatedButtonState extends State<AnimatedButton>
class Ring extends StatelessWidget {
Ring({
Key key,
this.color,
Key? key,
required this.color,
this.size = 40.0,
this.thickness = 2.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
class AnimatedText extends StatefulWidget {
AnimatedText({
Key key,
@required this.text,
this.style,
Key? key,
required this.text,
required this.style,
this.textRotation = AnimatedTextRotation.up,
}) : super(key: key);
@ -315,8 +316,8 @@ class _AnimatedTextState extends State<AnimatedText>
var _layoutHeight = 0.0;
final _textKey = GlobalKey();
Animation<double> _animation;
AnimationController _controller;
late Animation<double> _animation;
late AnimationController _controller;
double get radius => _layoutHeight / 2;
@ -337,7 +338,7 @@ class _AnimatedTextState extends State<AnimatedText>
_oldText = widget.text;
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) =>
(start + percent * (end - start));
Size getWidgetSize(GlobalKey key) {
final RenderBox renderBox = key.currentContext?.findRenderObject();
return renderBox?.size;
Size? getWidgetSize(GlobalKey key) {
return key.currentContext!.size;
//return renderBox?.size;
}
}

@ -3,32 +3,34 @@ import 'dart:io';
import 'package:flutter/cupertino.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:google_maps_flutter/google_maps_flutter.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;
class AppMap extends StatefulWidget {
CameraPositionCallback onCameraMove;
Map initialCamera;
late CameraPositionCallback? onCameraMove;
late Map initialCamera;
AppMapState _state;
Function onMapCreated;
Function onCameraIdle;
AppMapState? _state;
late Function? onMapCreated;
late Function? onCameraIdle;
AppMap(this.initialCamera, {this.onCameraMove, this.onMapCreated, this.onCameraIdle});
AppMap(this.initialCamera, { this.onCameraMove, this.onMapCreated, this.onCameraIdle});
@override
State<StatefulWidget> createState() => _state = AppMapState();
moveTo({@required CameraPosition cameraPostion}) {
if (_state.isHuawei) {
final cameraJson = cameraPostion.toMap();
moveTo({ required CameraPosition cameraPostion}) {
if (_state!.isHuawei) {
final cameraJson = cameraPostion?.toMap();
final camera = hmsMap.CameraPosition.fromMap(cameraJson);
_state._huaweiMapController.animateCamera(hmsMap.CameraUpdate.newCameraPosition(camera));
_state?._huaweiMapController.animateCamera(hmsMap.CameraUpdate.newCameraPosition(camera));
} 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> {
bool isHuawei = false;
Completer<GoogleMapController> _googleMapControllerComp = Completer();
GoogleMapController googleMapController;
Completer<googlemap.GoogleMapController> _googleMapControllerComp = Completer();
late googlemap.GoogleMapController googleMapController;
Completer<hmsMap.HuaweiMapController> _huaweiMapControllerComp = Completer();
hmsMap.HuaweiMapController _huaweiMapController;
late hmsMap.HuaweiMapController _huaweiMapController;
HmsApiAvailability hmsApiAvailability;
late HmsApiAvailability hmsApiAvailability;
checkIsHuawei() async {
await hmsApiAvailability.isHMSAvailable().then((value) {
@ -69,19 +71,22 @@ class AppMapState extends State<AppMap> {
Widget map() => isHuawei ? huaweiMap() : googleMap();
Widget googleMap() {
return GoogleMap(
mapType: MapType.normal,
return googlemap.GoogleMap(
mapType: googlemap.MapType.normal,
zoomControlsEnabled: true,
myLocationButtonEnabled: true,
myLocationEnabled: true,
initialCameraPosition: CameraPosition.fromMap(widget.initialCamera),
onCameraMove: widget.onCameraMove,
onMapCreated: (GoogleMapController controller) {
initialCameraPosition: googlemap.CameraPosition.fromMap(widget.initialCamera),
onCameraMove: widget.onCameraMove,
onMapCreated: (googlemap.GoogleMapController controller) {
googleMapController = 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,
myLocationEnabled: true,
initialCameraPosition: hmsMap.CameraPosition.fromMap(widget.initialCamera),
onCameraMove: (camera) => widget.onCameraMove(CameraPosition.fromMap(camera.toMap())),
onCameraMove: (camera) => widget.onCameraMove!(CameraPosition.fromMap(camera.toMap())),
onMapCreated: (controller) {
_huaweiMapController = controller;
_huaweiMapControllerComp.complete(controller);
widget.onMapCreated();
widget.onMapCreated!();
},
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/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/locator.dart';
@ -106,10 +106,10 @@ class BottomNavigationItem extends StatelessWidget {
Positioned(
right: 18.0,
bottom: 28.0,
child: Badge(
child: badge_import.Badge(
toAnimate: false,
position: BadgePosition.topEnd(),
shape: BadgeShape.circle,
position: badge_import.BadgePosition.topEnd(),
shape: badge_import.BadgeShape.circle,
badgeColor: secondaryColor.withOpacity(1.0),
borderRadius: BorderRadius.circular(8),
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:flutter/material.dart';
class CarouselSlider extends StatelessWidget {
const CarouselSlider({
@required this.imagesUrlList,
@required this.width,
@required this.height,
required this.imagesUrlList,
required this.width,
required this.height,
this.onImageChange,
this.autoPlay = false,
Key key,
Key? key,
}) : super(key: key);
final List imagesUrlList;
final double height;
final double width;
final bool autoPlay;
final Function onImageChange;
final void Function(int?, int)? onImageChange;
@override
Widget build(BuildContext context) {
return Carousel(
@ -37,7 +38,7 @@ class CarouselSlider extends StatelessWidget {
return Builder(builder: (BuildContext context) {
return Container(
child: Image.network(image, loadingBuilder: (BuildContext context,
Widget child, ImageChunkEvent loadingProgress) {
Widget child, ImageChunkEvent? loadingProgress) {
if (loadingProgress == null) return child;
return Center(
child: SizedBox(

@ -5,8 +5,8 @@ import 'package:flutter/material.dart';
import '../../../../core/model/labs/LabOrderResult.dart';
class LineChartCurved extends StatefulWidget {
final String title;
final List<LabOrderResult> labResult;
final String? title;
final List<LabOrderResult>? labResult;
LineChartCurved({this.title, this.labResult});
@ -15,8 +15,8 @@ class LineChartCurved extends StatefulWidget {
}
class LineChartCurvedState extends State<LineChartCurved> {
bool isShowingMainData;
List<int> xAxixs = List();
bool? isShowingMainData;
List<int> xAxixs = [];
int indexes = 0;
@override
@ -27,10 +27,10 @@ class LineChartCurvedState extends State<LineChartCurved> {
}
getXaxix() {
indexes = widget.labResult.length ~/ 3.5;
for (int index = 0; index < widget.labResult.length; index++) {
indexes = widget.labResult!.length ~/ 3.5;
for (int index = 0; index < widget.labResult!.length; index++) {
int mIndex = indexes * index;
if (mIndex < widget.labResult.length) {
if (mIndex < widget.labResult!.length) {
xAxixs.add(mIndex);
}
}
@ -49,7 +49,7 @@ class LineChartCurvedState extends State<LineChartCurved> {
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
widget.title,
widget.title!,
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 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/pages/base/base_view.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/others/network_base_view.dart';
import 'package:flutter/cupertino.dart';
@ -35,7 +36,7 @@ class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
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(
baseViewModel: model,
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/current_remaining_time.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:rating_bar/rating_bar.dart';
import '../../my_rich_text.dart';
class DoctorCard extends StatelessWidget {
final String name;
final String subName;
final double rating;
final DateTime date;
final String profileUrl;
final String billNo;
final Function onTap;
final Function onEmailTap;
final bool isInOutPatient;
final bool isShowInOutPatient;
final bool isLiveCareAppointment;
final bool isSortByClinic;
final String appointmentTime;
final bool isParentAppointment;
final int remainingTimeInMinutes;
final String? name;
final String? subName;
final double? rating;
final DateTime? date;
final String? profileUrl;
final String? billNo;
final VoidCallback? onTap;
final VoidCallback? onEmailTap;
final bool? isInOutPatient;
final bool? isShowInOutPatient;
final bool? isLiveCareAppointment;
final bool? isSortByClinic;
final String? appointmentTime;
final bool? isParentAppointment;
final int? remainingTimeInMinutes;
final String vaccineName;
final bool isSickLeave;
final int sickLeaveStatus;
@ -53,7 +53,7 @@ class DoctorCard extends StatelessWidget {
this.isSickLeave = false,
this.sickLeaveStatus = 0});
ProjectViewModel projectViewModel;
ProjectViewModel? projectViewModel;
@override
Widget build(BuildContext context) {
@ -84,29 +84,29 @@ class DoctorCard extends StatelessWidget {
height: double.infinity,
alignment: Alignment.center,
padding: EdgeInsets.only(left: 2, right: 2),
decoration: isShowInOutPatient
decoration: isShowInOutPatient!
? BoxDecoration(
//Colors.red[900] Color(0xff404545)
color: isLiveCareAppointment
color: isLiveCareAppointment!
? Color(0xff2E303A)
: !isInOutPatient
: !isInOutPatient!
? Color(0xffD02127)
: Color(0xffa9a089),
borderRadius: BorderRadius.only(
topLeft: 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),
bottomRight: projectViewModel.isArabic ? Radius.circular(10) : Radius.circular(0),
topLeft: 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),
bottomRight: projectViewModel!.isArabic ? Radius.circular(10) : Radius.circular(0),
),
)
: BoxDecoration(),
child: isShowInOutPatient
child: isShowInOutPatient!
? RotatedBox(
quarterTurns: 3,
child: Text(
isLiveCareAppointment
isLiveCareAppointment!
? TranslationBase.of(context).liveCare.toLowerCase().capitalizeFirstofEach
: !isInOutPatient
: !isInOutPatient!
? TranslationBase.of(context).inPatient.toLowerCase().capitalizeFirstofEach
: TranslationBase.of(context).outpatient.toLowerCase().capitalizeFirstofEach,
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,
children: [
Text(
DateUtil.getDayMonthYearDateFormatted(date),
DateUtil.getDayMonthYearDateFormatted(date!),
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12),
),
Text(
@ -163,8 +163,8 @@ class DoctorCard extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
LargeAvatar(
name: name,
url: profileUrl,
name: name!,
url: profileUrl!,
width: 48,
height: 48,
),
@ -175,33 +175,45 @@ class DoctorCard extends StatelessWidget {
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
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(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
if (rating == null && billNo != "") MyRichText(TranslationBase.of(context).invoiceNo, billNo ?? "", projectViewModel.isArabic),
if (vaccineName != "") MyRichText("", vaccineName ?? "", projectViewModel.isArabic),
if (rating == null && billNo != "") MyRichText(TranslationBase.of(context).invoiceNo, billNo ?? "", projectViewModel!.isArabic),
if (vaccineName != "") MyRichText("", vaccineName ?? "", projectViewModel!.isArabic),
if (rating != null)
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
RatingBar.readOnly(
initialRating: rating,
size: 16.0,
filledColor: Color(0XFFD02127),
emptyColor: Color(0XFFD02127),
isHalfAllowed: true,
halfFilledIcon: Icons.star_half,
filledIcon: Icons.star,
emptyIcon: Icons.star_border,
),
// RatingBar.readOnly(
// initialRating: rating,
// size: 16.0,
// filledColor: Color(0XFFD02127),
// emptyColor: Color(0XFFD02127),
// isHalfAllowed: true,
// halfFilledIcon: Icons.star_half,
// filledIcon: Icons.star,
// 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)
CountdownTimer(
controller: CountdownTimerController(endTime: DateTime.now().millisecondsSinceEpoch + (remainingTimeInMinutes * 1000) * 60),
widgetBuilder: (_, CurrentRemainingTime time) {
controller: CountdownTimerController(endTime: DateTime.now().millisecondsSinceEpoch + (remainingTimeInMinutes! * 1000) * 60),
widgetBuilder: (_, CurrentRemainingTime? time) {
return time != null
? Text(
"${time.days ?? 0}:${time.hours ?? 0}:${time.min}:${time.sec}",
@ -219,7 +231,7 @@ class DoctorCard extends StatelessWidget {
height: 48,
child: Align(
alignment: Alignment.bottomCenter,
child: (onEmailTap != null && projectViewModel.havePrivilege(17))
child: (onEmailTap != null && projectViewModel!.havePrivilege(17))
? InkWell(
onTap: onEmailTap,
child: Icon(

@ -11,11 +11,11 @@ class MedicalProfileItem extends StatelessWidget {
final bool hasBadge = false;
final bool isPngImage;
bool isEnable;
Color imgColor;
Color? imgColor;
final width;
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
Widget build(BuildContext context) {

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

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

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

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

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

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

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

@ -7,8 +7,8 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class ConfirmSendEmailDialog extends StatefulWidget {
final String email;
final GestureTapCallback onTapSendEmail;
final String? email;
final GestureTapCallback? onTapSendEmail;
ConfirmSendEmailDialog({this.email, this.onTapSendEmail});
@ -68,7 +68,7 @@ class _ConfirmSendEmailDialogState extends State<ConfirmSendEmailDialog> {
children: [
Expanded(
child: Text(
widget.email,
widget.email!,
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,
() {
Navigator.pop(context);
widget.onTapSendEmail();
widget.onTapSendEmail!();
},
color: Color(0xff359846),
),

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

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

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

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

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

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

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

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

@ -14,7 +14,7 @@ class HospitalLocation extends StatelessWidget {
final bool showCity;
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
Widget build(BuildContext context) {
@ -60,7 +60,7 @@ class HospitalLocation extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
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),
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));
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 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
@ -55,18 +55,18 @@ class MyInAppBrowser extends InAppBrowser {
static List<String> errorURLS = ['PayfortCancel', 'errorpage', 'Failed', 'orderdetails', 'redirectToApplePay', 'mdlaboratories.com/?', 'cancel', 'canceled'];
final Function onExitCallback;
final Function onLoadStartCallback;
final BuildContext context;
final Function? onExitCallback;
final Function? onLoadStartCallback;
final BuildContext? context;
AppSharedPreferences sharedPref = AppSharedPreferences();
AuthProvider authProvider = new AuthProvider();
InAppBrowser browser = new InAppBrowser();
// AuthenticatedUser authUser;
AppoitmentAllHistoryResultList appo;
late AppoitmentAllHistoryResultList? appo;
String deviceToken;
String deviceToken = "";
double lat = 0.0;
double long = 0.0;
@ -80,17 +80,19 @@ class MyInAppBrowser extends InAppBrowser {
}
@override
Future onLoadStart(Uri url) async {
if (onLoadStartCallback != null) onLoadStartCallback(url.toString());
Future onLoadStart(Uri? url) async {
if (onLoadStartCallback != null) onLoadStartCallback!(url.toString());
}
@override
Future onLoadStop(Uri url) async {
Future onLoadStop(Uri? url) async {
print("\n\nStopped $url\n\n");
}
@override
void onLoadError(Uri url, int code, String message) {
void onLoadError(Uri? url, int code, String message) {
print("Can't load $url.. Error: $message");
}
@ -100,7 +102,7 @@ class MyInAppBrowser extends InAppBrowser {
@override
void onExit() {
print("\n\nBrowser closed!\n\n");
if (onExitCallback != null) onExitCallback(appo, isPaymentDone);
if (onExitCallback != null) onExitCallback!(appo, isPaymentDone);
}
@override
@ -125,7 +127,7 @@ class MyInAppBrowser extends InAppBrowser {
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;
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);
@ -138,7 +140,7 @@ class MyInAppBrowser extends InAppBrowser {
// await getPatientData();
if (paymentMethod == "ApplePay") {
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);
@ -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,
AuthenticatedUser authenticatedUser, InAppBrowser 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();
generatePharmacyURL(order, amount, orderDesc, transactionID, emailId, paymentMethod, patientName, patientID, authenticatedUser).then((value) {
if (order.customValuesXml.contains("ApplePay")) {
@ -469,7 +471,7 @@ class MyChromeSafariBrowser extends ChromeSafariBrowser {
final Function onLoadStartCallback;
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
void onOpened() {

@ -1,72 +1,72 @@
import 'package:flutter/animation.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
/// Custom switch widget
/// [value] switch is active or not
/// [onChanged] function to be executed after sometime
/// [activeColor] color of active status
/// [inactiveColor] color of inactive status
class CustomSwitch extends StatefulWidget {
final bool value;
final AsyncCallback onChanged;
final Color activeColor;
final Color inactiveColor;
CustomSwitch({Key key, this.value, this.onChanged, this.activeColor, this.inactiveColor}) : super(key: key);
@override
_CustomSwitchState createState() => _CustomSwitchState();
}
class _CustomSwitchState extends State<CustomSwitch> with SingleTickerProviderStateMixin {
Animation _circleAnimation;
AnimationController _animationController;
@override
void initState() {
super.initState();
_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));
if (widget.value) _animationController.forward();
}
@override
Widget build(BuildContext context) {
return AnimatedBuilder(
animation: _animationController,
builder: (context, child) {
bool _switchStatus = _circleAnimation.status == AnimationStatus.dismissed || _circleAnimation.status == AnimationStatus.reverse;
return GestureDetector(
onTap: Feedback.wrapForTap(() async {
if (widget.value) {
_animationController.reverse();
} else {
_animationController.forward();
}
await widget.onChanged();
}, context),
child: AnimatedContainer(
duration: Duration(milliseconds: 200),
width: 50.0,
height: 25.0,
decoration: BoxDecoration(borderRadius: BorderRadius.circular(20.0), color: _switchStatus ? widget.inactiveColor : widget.activeColor),
child: Padding(
padding: EdgeInsets.only(top: 4.0, bottom: 4.0, right: 6.0, left: 6.0),
child: Row(
children: <Widget>[
Container(width: _circleAnimation.value),
Container(
width: 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),
)
],
),
),
),
);
},
);
}
}
// import 'package:flutter/animation.dart';
// import 'package:flutter/foundation.dart';
// import 'package:flutter/material.dart';
//
// /// Custom switch widget
// /// [value] switch is active or not
// /// [onChanged] function to be executed after sometime
// /// [activeColor] color of active status
// /// [inactiveColor] color of inactive status
// class CustomSwitch extends StatefulWidget {
// final bool value;
// final AsyncCallback onChanged;
// final Color activeColor;
// final Color inactiveColor;
//
// CustomSwitch({Key key, this.value, this.onChanged, this.activeColor, this.inactiveColor}) : super(key: key);
//
// @override
// _CustomSwitchState createState() => _CustomSwitchState();
// }
//
// class _CustomSwitchState extends State<CustomSwitch> with SingleTickerProviderStateMixin {
// Animation _circleAnimation;
// AnimationController _animationController;
//
// @override
// void initState() {
// super.initState();
// _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));
// if (widget.value) _animationController.forward();
// }
//
// @override
// Widget build(BuildContext context) {
// return AnimatedBuilder(
// animation: _animationController,
// builder: (context, child) {
// bool _switchStatus = _circleAnimation.status == AnimationStatus.dismissed || _circleAnimation.status == AnimationStatus.reverse;
// return GestureDetector(
// onTap: Feedback.wrapForTap(() async {
// if (widget.value) {
// _animationController.reverse();
// } else {
// _animationController.forward();
// }
// await widget.onChanged();
// }, context),
// child: AnimatedContainer(
// duration: Duration(milliseconds: 200),
// width: 50.0,
// height: 25.0,
// decoration: BoxDecoration(borderRadius: BorderRadius.circular(20.0), color: _switchStatus ? widget.inactiveColor : widget.activeColor),
// child: Padding(
// padding: EdgeInsets.only(top: 4.0, bottom: 4.0, right: 6.0, left: 6.0),
// child: Row(
// children: <Widget>[
// Container(width: _circleAnimation.value),
// Container(
// width: 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),
// )
// ],
// ),
// ),
// ),
// );
// },
// );
// }
// }

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

File diff suppressed because it is too large Load Diff

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

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

@ -4,7 +4,7 @@ class MyRichText extends StatelessWidget {
final String title;
final String value;
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
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/my_rich_text.dart';
import 'package:flutter/material.dart';
import 'package:flutter_rating_bar/flutter_rating_bar.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:provider/provider.dart';
import 'package:rating_bar/rating_bar.dart';
class DoctorHeader extends StatelessWidget {
final HeaderModel headerModel;
@ -20,23 +20,23 @@ class DoctorHeader extends StatelessWidget {
final VoidCallback onRatingAndReviewTap;
final bool showConfirmMessageDialog;
final String buttonTitle;
final String buttonIcon;
final String? buttonIcon;
final bool isNeedToShowButton;
final bool isShowName;
DoctorHeader(
{Key key,
@required this.headerModel,
@required this.buttonTitle,
@required this.onTap,
{Key? key,
required this.headerModel,
required this.buttonTitle,
required this.onTap,
this.isNeedToShowButton = true,
this.isShowName = false,
this.buttonIcon,
this.showConfirmMessageDialog = true,
@required this.onRatingAndReviewTap})
required this.onRatingAndReviewTap})
: super(key: key);
ProjectViewModel projectViewModel;
late ProjectViewModel projectViewModel;
@override
Widget build(BuildContext context) {
@ -127,15 +127,25 @@ class DoctorHeader extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.center,
children: [
SizedBox(width: 21),
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.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,
//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) { },
),
SizedBox(width: 6),
Text(
@ -200,7 +210,7 @@ class DoctorHeader extends StatelessWidget {
void getDoctorRatingsDetails(context) {
GifLoaderDialogUtils.showMyDialog(context);
List<DoctorRateDetails> doctorDetailsList = List();
List<DoctorRateDetails> doctorDetailsList = [];
DoctorsListService service = new DoctorsListService();
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))),
Container(
margin: EdgeInsets.symmetric(horizontal: 20.0),
child: RatingBar.readOnly(
initialRating: this.headerModel.decimalDoctorRate != null ? double.tryParse(this.headerModel.decimalDoctorRate) : this.headerModel.actualDoctorRate.toDouble(),
size: 35.0,
filledColor: Colors.yellow[700],
emptyColor: Colors.grey[500],
isHalfAllowed: true,
halfFilledIcon: Icons.star_half,
filledIcon: Icons.star,
emptyIcon: Icons.star,
child:
// RatingBar.readOnly(
// initialRating: this.headerModel.decimalDoctorRate != null ? double.tryParse(this.headerModel.decimalDoctorRate) : this.headerModel.actualDoctorRate.toDouble(),
// size: 35.0,
// filledColor: Colors.yellow[700],
// emptyColor: Colors.grey[500],
// isHalfAllowed: true,
// 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,
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))),
getRatingLine(doctorDetailsList[0].ratio, Colors.green[700]),
getRatingLine(doctorDetailsList[0].ratio, Colors.green[700]!),
],
),
Container(
@ -407,7 +429,7 @@ class DoctorHeader extends StatelessWidget {
barrierDismissible: true,
barrierLabel: '',
context: context,
pageBuilder: (context, animation1, animation2) {});
pageBuilder: (context, animation1, animation2) => SizedBox());
}
double getRatingWidth(double patientNumber) {

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

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

@ -16,9 +16,9 @@ class PackagesCartItemCard extends StatefulWidget {
final PackagesCartItemsResponseModel itemModel;
final StepperCallbackFuture shouldStepperChangeApply;
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
State<StatefulWidget> createState() => PackagesCartItemCardState();
@ -51,7 +51,7 @@ class PackagesCartItemCardState extends State<PackagesCartItemCard> {
InkWell(
onTap: () async {
await widget.viewModel.service.deleteProductFromCart(widget.itemModel.id, context: context, showLoading: false);
widget.getCartItems();
widget.getCartItems!();
},
child: Padding(
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);
return Text(
'$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:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_rating_bar/flutter_rating_bar.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:rating_bar/rating_bar.dart';
bool wide = true;
class PackagesItemCard extends StatefulWidget {
final double itemWidth;
final double itemHeight;
final double itemContentPadding;
final double? itemWidth;
final double? itemHeight;
final double? itemContentPadding;
final PackagesResponseModel itemModel;
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
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),
),
),
RatingBar.readOnly(
RatingBar(
initialRating: 4.5, // todo ask haroon about parameter for rating
size: 18.0,
filledColor: Color(0XFFD02127),
emptyColor: Color(0XFFD02127),
isHalfAllowed: true,
halfFilledIcon: Icons.star_half,
filledIcon: Icons.star,
emptyIcon: Icons.star_border,
),
// 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(widget.onCartClick != null)
@ -166,16 +168,16 @@ class PackagesItemCardState extends State<PackagesItemCard> {
margin: const EdgeInsets.only(top: 0.0),
child: Text(widget.itemModel.price.toString().trim() + " " + TranslationBase.of(context).sar,
style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.bold, letterSpacing: -0.56))),
RatingBar.readOnly(
initialRating: 4.5,
size: 18.0,
filledColor: Color(0XFFD02127),
emptyColor: Color(0XFFD02127),
isHalfAllowed: true,
halfFilledIcon: Icons.star_half,
filledIcon: Icons.star,
emptyIcon: Icons.star_border,
),
// RatingBar.readOnly(
// initialRating: 4.5,
// size: 18.0,
// filledColor: Color(0XFFD02127),
// emptyColor: Color(0XFFD02127),
// isHalfAllowed: true,
// halfFilledIcon: Icons.star_half,
// filledIcon: Icons.star,
// emptyIcon: Icons.star_border,
// ),
],
),
InkWell(

@ -15,9 +15,9 @@ bool wide = true;
class PackagesOrderHistoryItemCard extends StatefulWidget {
final PackagesResponseModel itemModel;
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
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,
child: Padding(
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);
return Text(
'$prc ${TranslationBase.of(context).sar}',

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

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

@ -8,7 +8,7 @@ class StarRating extends StatelessWidget {
final int totalCount;
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
Widget build(BuildContext context) {
@ -31,7 +31,7 @@ class StarRating extends StatelessWidget {
if (totalCount!=null)
SizedBox(width: 5.0),
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
/// [collapsed] The widget shown in the collapsed state
class AppExpandableNotifier extends StatefulWidget {
final Widget headerWidget;
final Widget bodyWidget;
final String title;
final Widget collapsed;
final Widget? headerWidget;
final Widget? bodyWidget;
final String? title;
final Widget? collapsed;
final bool isExpand;
bool expandFlag = false;
bool hasCounter = false;
@ -29,7 +29,7 @@ class AppExpandableNotifier extends StatefulWidget {
}
class _AppExpandableNotifier extends State<AppExpandableNotifier> {
ProjectViewModel projectViewModel;
late ProjectViewModel projectViewModel;
@override
void initState() {
@ -70,7 +70,7 @@ class _AppExpandableNotifier extends State<AppExpandableNotifier> {
scrollOnExpand: true,
scrollOnCollapse: false,
child: ExpandablePanel(
hasIcon: false,
// hasIcon: false,
theme: const ExpandableThemeData(
headerAlignment: ExpandablePanelHeaderAlignment.center,
tapBodyToCollapse: true,
@ -139,7 +139,7 @@ class _AppExpandableNotifier extends State<AppExpandableNotifier> {
),
),
collapsed: widget.collapsed ?? Container(),
expanded: widget.bodyWidget,
expanded: widget.bodyWidget!,
builder: (_, collapsed, expanded) {
return Expandable(
controller: widget.controller,

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

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

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

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

Loading…
Cancel
Save