Merge branch 'development' into Haroon

merge-update-with-lab-changes
haroon amjad 5 years ago
commit 573f5110f5

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CLIENT_ID</key>
<string>864393916058-ekeb4s8tgfo58dutv0l54399t7ivr06r.apps.googleusercontent.com</string>
<key>REVERSED_CLIENT_ID</key>
<string>com.googleusercontent.apps.864393916058-ekeb4s8tgfo58dutv0l54399t7ivr06r</string>
<key>API_KEY</key>
<string>AIzaSyA_6ayGCk4fly7o7eTVBrj9kuHBYHMAOfs</string>
<key>GCM_SENDER_ID</key>
<string>864393916058</string>
<key>PLIST_VERSION</key>
<string>1</string>
<key>BUNDLE_ID</key>
<string>com.cloud.diplomaticquarterapp</string>
<key>PROJECT_ID</key>
<string>diplomaticquarter-d2385</string>
<key>STORAGE_BUCKET</key>
<string>diplomaticquarter-d2385.appspot.com</string>
<key>IS_ADS_ENABLED</key>
<false></false>
<key>IS_ANALYTICS_ENABLED</key>
<false></false>
<key>IS_APPINVITE_ENABLED</key>
<true></true>
<key>IS_GCM_ENABLED</key>
<true></true>
<key>IS_SIGNIN_ENABLED</key>
<true></true>
<key>GOOGLE_APP_ID</key>
<string>1:864393916058:ios:13f787bbfe6051f8b97923</string>
<key>DATABASE_URL</key>
<string>https://diplomaticquarter-d2385.firebaseio.com</string>
</dict>
</plist>

@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CLIENT_ID</key>
<string>815750722565-da8p56le8bd6apsbm9eft0jjl1rtpgkt.apps.googleusercontent.com</string>
<key>REVERSED_CLIENT_ID</key>
<string>com.googleusercontent.apps.815750722565-da8p56le8bd6apsbm9eft0jjl1rtpgkt</string>
<key>ANDROID_CLIENT_ID</key>
<string>815750722565-m14h8mkosm7cnq6uh6rhqr54dn02d705.apps.googleusercontent.com</string>
<key>API_KEY</key>
<string>AIzaSyDiXnCO00li4V7Ioa2YZ_M4ECxRsu_P9tA</string>
<key>GCM_SENDER_ID</key>
<string>815750722565</string>
<key>PLIST_VERSION</key>
<string>1</string>
<key>BUNDLE_ID</key>
<string>com.HMG.Smartphone</string>
<key>PROJECT_ID</key>
<string>api-project-815750722565</string>
<key>STORAGE_BUCKET</key>
<string>api-project-815750722565.appspot.com</string>
<key>IS_ADS_ENABLED</key>
<false></false>
<key>IS_ANALYTICS_ENABLED</key>
<false></false>
<key>IS_APPINVITE_ENABLED</key>
<true></true>
<key>IS_GCM_ENABLED</key>
<true></true>
<key>IS_SIGNIN_ENABLED</key>
<true></true>
<key>GOOGLE_APP_ID</key>
<string>1:815750722565:ios:328ec247a81a2ca23c186c</string>
<key>DATABASE_URL</key>
<string>https://api-project-815750722565.firebaseio.com</string>
</dict>
</plist>

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

BIN
key

Binary file not shown.

@ -1,9 +1,7 @@
import 'dart:io'; import 'dart:io';
import 'package:diplomaticquarterapp/core/service/geofencing/GeofencingServices.dart';
import 'package:diplomaticquarterapp/models/Request.dart'; import 'package:diplomaticquarterapp/models/Request.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart';
const MAX_SMALL_SCREEN = 660; const MAX_SMALL_SCREEN = 660;
@ -13,11 +11,16 @@ const PACKAGES_CATEGORIES = '/api/categories';
const PACKAGES_PRODUCTS = '/api/products'; const PACKAGES_PRODUCTS = '/api/products';
const BASE_URL = 'https://uat.hmgwebservices.com/'; const BASE_URL = 'https://uat.hmgwebservices.com/';
//const BASE_URL = 'https://hmgwebservices.com/'; // const BASE_URL = 'https://hmgwebservices.com/';
// Pharmacy UAT URLs
// const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/';
// const PHARMACY_BASE_URL = 'https://uat.hmgwebservices.com/epharmacy/api/';
// Pharmacy Production URLs
const BASE_PHARMACY_URL = 'https://mdlaboratories.com/exacartapi/api/';
const PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapi/api/';
//const BASE_PHARMACY_URL = 'http://swd-pharapp-01:7200/api/';
const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/';
const PHARMACY_BASE_URL = 'https://uat.hmgwebservices.com/epharmacy/api/';
const PING_SERVICE = 'Services/Weather.svc/REST/CheckConnectivity'; const PING_SERVICE = 'Services/Weather.svc/REST/CheckConnectivity';
const GET_PROJECT = 'Services/Lists.svc/REST/GetProject'; const GET_PROJECT = 'Services/Lists.svc/REST/GetProject';
@ -91,6 +94,11 @@ const GET_PATIENT_VITAL_SIGN =
const GET_NEAREST_HOSPITAL = const GET_NEAREST_HOSPITAL =
'Services/Patients.svc/REST/Patient_GetProjectAvgERWaitingTime'; 'Services/Patients.svc/REST/Patient_GetProjectAvgERWaitingTime';
///ED Online
const ER_GET_VISUAL_TRIAGE_QUESTIONS = "services/Doctors.svc/REST/ER_GetVisualTriageQuestions";
const ER_SAVE_TRIAGE_INFORMATION = "services/Doctors.svc/REST/ER_SaveTriageInformation";
const ER_GetPatientPaymentInformationForERClinic = "services/Doctors.svc/REST/ER_GetPatientPaymentInformationForERClinic";
///Er Nearest ///Er Nearest
const GET_AMBULANCE_REQUEST = const GET_AMBULANCE_REQUEST =
'Services/Patients.svc/REST/PatientER_RRT_GetAllTransportationMethod'; 'Services/Patients.svc/REST/PatientER_RRT_GetAllTransportationMethod';
@ -435,11 +443,19 @@ const GET_ALL_CITIES = 'services/Lists.svc/rest/GetAllCities';
const CREATE_E_REFERRAL = "Services/Patients.svc/REST/CreateEReferral"; const CREATE_E_REFERRAL = "Services/Patients.svc/REST/CreateEReferral";
const GET_E_REFERRALS = "Services/Patients.svc/REST/GetEReferrals"; const GET_E_REFERRALS = "Services/Patients.svc/REST/GetEReferrals";
// Encillary Orders
const GET_ANCILLARY_ORDERS =
'Services/Doctors.svc/REST/GetOnlineAncillaryOrderList';
const GET_ANCILLARY_ORDERS_DETAILS =
'Services/Doctors.svc/REST/GetOnlineAncillaryOrderProcList';
//Pharmacy wishlist //Pharmacy wishlist
// const GET_WISHLIST = "http://swd-pharapp-01:7200/api/shopping_cart_items/"; // const GET_WISHLIST = "http://swd-pharapp-01:7200/api/shopping_cart_items/";
// pharmacy // pharmacy
const PHARMACY_AUTORZIE_CUSTOMER = "epharmacy/api/AutorizeCustomer"; const PHARMACY_AUTORZIE_CUSTOMER = "AutorizeCustomer";
const PHARMACY_VERIFY_CUSTOMER = "VerifyCustomer"; const PHARMACY_VERIFY_CUSTOMER = "VerifyCustomer";
const PHARMACY_GET_COUNTRY = "countries"; const PHARMACY_GET_COUNTRY = "countries";
const PHARMACY_CREATE_CUSTOMER = "epharmacy/api/CreateCustomer"; const PHARMACY_CREATE_CUSTOMER = "epharmacy/api/CreateCustomer";
@ -460,9 +476,9 @@ const GET_Cancel_ORDER = "cancelorder/";
const WRITE_REVIEW = "Content-Type" + "text/plain; charset=utf-8"; const WRITE_REVIEW = "Content-Type" + "text/plain; charset=utf-8";
const GET_SHOPPING_CART = "shopping_cart_items/"; const GET_SHOPPING_CART = "shopping_cart_items/";
const GET_SHIPPING_OPTIONS = "get_shipping_option/"; const GET_SHIPPING_OPTIONS = "get_shipping_option/";
const DELETE_SHOPPING_CART = "epharmacy/api/delete_shopping_cart_items/"; const DELETE_SHOPPING_CART = "delete_shopping_cart_items/";
const DELETE_SHOPPING_CART_ALL = "delete_shopping_cart_item_by_customer/"; const DELETE_SHOPPING_CART_ALL = "delete_shopping_cart_item_by_customer/";
const ORDER_SHOPPING_CART = "epharmacy/api/orders"; const ORDER_SHOPPING_CART = "orders";
const GET_LACUM_ACCOUNT_INFORMATION = const GET_LACUM_ACCOUNT_INFORMATION =
"Services/Patients.svc/REST/GetLakumAccountInformation"; "Services/Patients.svc/REST/GetLakumAccountInformation";
const GET_LACUM_GROUP_INFORMATION = const GET_LACUM_GROUP_INFORMATION =
@ -519,11 +535,11 @@ const GET_BRAND_ITEMS = "products";
// External API // External API
const ADD_ADDRESS_INFO = const ADD_ADDRESS_INFO =
"https://mdlaboratories.com/exacartapi/api/addcustomeraddress"; "addcustomeraddress";
const GET_CUSTOMER_ADDRESSES = const GET_CUSTOMER_ADDRESSES =
"https://mdlaboratories.com/exacartapi/api/Customers/"; "Customers/";
const GET_CUSTOMER_INFO = const GET_CUSTOMER_INFO =
"https://mdlaboratories.com/exacartapi/api/VerifyCustomer"; "VerifyCustomer";
//Pharmacy //Pharmacy
@ -555,6 +571,8 @@ const GET_SEARCH_PRODUCTS =
const SCAN_QR_CODE = 'productbysku/'; const SCAN_QR_CODE = 'productbysku/';
const FILTERED_PRODUCTS = 'products?categoryids=';
class AppGlobal { class AppGlobal {
static var context; static var context;

@ -1159,7 +1159,7 @@ const Map localizedValues = {
"ar": "Connected with HMG Network,\n\nBut failed to access HMG services" "ar": "Connected with HMG Network,\n\nBut failed to access HMG services"
}, },
"offerAndPackages": {"en": "Offers And Packages", "ar": "العروض والباقات"}, "offerAndPackages": {"en": "Offers And Packages", "ar": "العروض والباقات"},
"InvoiceNo": {"en": " Invoice No", "ar": "رقم الفاتورة"}, "InvoiceNo": {"en": "Invoice No", "ar": "رقم الفاتورة"},
"SpecialResult": {"en": " Special Result", "ar": "نتيجة خاصة"}, "SpecialResult": {"en": " Special Result", "ar": "نتيجة خاصة"},
"GeneralResult": {"en": "General Result", "ar": "نتيجة عامة"}, "GeneralResult": {"en": "General Result", "ar": "نتيجة عامة"},
"show-more-btn": {"en": "Flow Chart", "ar": "النتائج التراكمية"}, "show-more-btn": {"en": "Flow Chart", "ar": "النتائج التراكمية"},
@ -1652,7 +1652,10 @@ const Map localizedValues = {
"enterReadingValue": {"en": "Enter the reading value", "ar": "ادخل القيمة"}, "enterReadingValue": {"en": "Enter the reading value", "ar": "ادخل القيمة"},
"result": {"en": "Result", "ar": "النتيجة"}, "result": {"en": "Result", "ar": "النتيجة"},
"sort": {"en": "Sort", "ar": "فرز"}, "sort": {"en": "Sort", "ar": "فرز"},
"bloodSugarConversion": {"en": "Blood Sugar Conversion", "ar": "السكر في الدم"}, "bloodSugarConversion": {
"en": "Blood Sugar Conversion",
"ar": "السكر في الدم"
},
"convertBloodSugarStatement": { "convertBloodSugarStatement": {
"en": "en":
"Convert blood sugar/glucose from mmol/l (UK standard) to mg/dlt (US standard) and vice versa.", "Convert blood sugar/glucose from mmol/l (UK standard) to mg/dlt (US standard) and vice versa.",
@ -1954,4 +1957,24 @@ const Map localizedValues = {
}, },
"order-overview": {"en": "Order Overview", "ar": "ملخص الطلب"}, "order-overview": {"en": "Order Overview", "ar": "ملخص الطلب"},
"shipping-address": {"en": "Delivery Address", "ar": "عنوان التوصيل"}, "shipping-address": {"en": "Delivery Address", "ar": "عنوان التوصيل"},
"pharmacy-relogin": {
"en": "Your session has timed out, Please try again",
"ar": "انتهت مهلة جلسة الخاص بها. يرجى المحاولة مرة أخرى"
},
"ancillary-orders": {"en": "Ancillary Orders", "ar": "الأوامر التبعية"},
"onlineCheckInAgreement": {"en": "The online check-in is for non-life threatening situationCall the red crescent (number) or go to the nearest emergency department if there are:signs of stroke or heart attack history of seizure or syncope there is limb or life threatening injury picture of severe injuries",
"ar": "تسجيل الذهاب الى الطوارئ عبر الإنترنت هو فقط للحالات  التي لا تهدد الحياة يجب الاتصل بالهلال الأحمر (رقم) أو الذهاب إلى أقرب قسم طوارئ إذا كان هناك علامات السكتة الدماغية أو النوبة القلبية او هناك نوبة تشنج او حالة فقدان الوعي او وجود إصابة تهدد أحد الأطراف او تهدد الحياة او وجود إصابات خطيرة"},
"MRN": {"en": "MRN", "ar": "ایم آر این"},
"appointment-date": {"en": "Appointment Date", "ar": "تقرری کی تاریخ"},
"appointment-no": {"en": "Appointment No", "ar": "تقرری نمبر"},
"insurance-id": {"en": "Insurance ID", "ar": "انشورنس ID"},
"chiefComplaints": {"en": "Chief Complaints", "ar": "الشكوى الرئيسة"},
"errorChiefComplaints": {"en": "Please Chief Complaints", "ar": "يرجى ادخال الشكوى الرئيسة"},
"errorExpectedArrivalTimes": {"en": "Please Expected arrival time", "ar": "يرجى ادخال الوقت المتوقع للوصول"},
"expectedArrivalTime": {"en": "Expected arrival time", "ar": "الوقت المتوقع للوصول"},
"add-address": {
"en": "Add new address",
"ar": "اضف عنوان جديد"
}
}; };

@ -0,0 +1,92 @@
class ErPatientShareModel {
int cashPrice;
int cashPriceTax;
int cashPriceWithTax;
int companyId;
String companyName;
int companyShareWithTax;
dynamic errCode;
int groupID;
dynamic insurancePolicyNo;
String message;
dynamic patientCardID;
double patientShare;
double patientShareWithTax;
double patientTaxAmount;
int policyId;
String policyName;
String procedureName;
dynamic setupID;
int statusCode;
dynamic subPolicyNo;
ErPatientShareModel(
{this.cashPrice,
this.cashPriceTax,
this.cashPriceWithTax,
this.companyId,
this.companyName,
this.companyShareWithTax,
this.errCode,
this.groupID,
this.insurancePolicyNo,
this.message,
this.patientCardID,
this.patientShare,
this.patientShareWithTax,
this.patientTaxAmount,
this.policyId,
this.policyName,
this.procedureName,
this.setupID,
this.statusCode,
this.subPolicyNo});
ErPatientShareModel.fromJson(Map<String, dynamic> json) {
cashPrice = json['CashPrice'];
cashPriceTax = json['CashPriceTax'];
cashPriceWithTax = json['CashPriceWithTax'];
companyId = json['CompanyId'];
companyName = json['CompanyName'];
companyShareWithTax = json['CompanyShareWithTax'];
errCode = json['ErrCode'];
groupID = json['GroupID'];
insurancePolicyNo = json['InsurancePolicyNo'];
message = json['Message'];
patientCardID = json['PatientCardID'];
patientShare = json['PatientShare'];
patientShareWithTax = json['PatientShareWithTax'];
patientTaxAmount = json['PatientTaxAmount'];
policyId = json['PolicyId'];
policyName = json['PolicyName'];
procedureName = json['ProcedureName'];
setupID = json['SetupID'];
statusCode = json['StatusCode'];
subPolicyNo = json['SubPolicyNo'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['CashPrice'] = this.cashPrice;
data['CashPriceTax'] = this.cashPriceTax;
data['CashPriceWithTax'] = this.cashPriceWithTax;
data['CompanyId'] = this.companyId;
data['CompanyName'] = this.companyName;
data['CompanyShareWithTax'] = this.companyShareWithTax;
data['ErrCode'] = this.errCode;
data['GroupID'] = this.groupID;
data['InsurancePolicyNo'] = this.insurancePolicyNo;
data['Message'] = this.message;
data['PatientCardID'] = this.patientCardID;
data['PatientShare'] = this.patientShare;
data['PatientShareWithTax'] = this.patientShareWithTax;
data['PatientTaxAmount'] = this.patientTaxAmount;
data['PolicyId'] = this.policyId;
data['PolicyName'] = this.policyName;
data['ProcedureName'] = this.procedureName;
data['SetupID'] = this.setupID;
data['StatusCode'] = this.statusCode;
data['SubPolicyNo'] = this.subPolicyNo;
return data;
}
}

@ -0,0 +1,147 @@
import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart';
class TriageInformationRequest {
double versionID;
int channel;
int languageID;
String iPAdress;
String sessionID;
int patientID;
String tokenID;
String generalid;
int patientOutSA;
int patientTypeID;
int patientType;
int projectID;
ERTriageInformation eRTriageInformation;
HospitalsModel selectedHospital;
TriageInformationRequest(
{this.versionID,
this.channel,
this.languageID,
this.iPAdress,
this.sessionID,
this.patientID,
this.tokenID,
this.generalid,
this.patientOutSA,
this.patientTypeID,
this.patientType,
this.projectID,
this.eRTriageInformation,this.selectedHospital});
TriageInformationRequest.fromJson(Map<String, dynamic> json) {
versionID = json['VersionID'];
channel = json['Channel'];
languageID = json['LanguageID'];
iPAdress = json['IPAdress'];
sessionID = json['SessionID'];
patientID = json['PatientID'];
tokenID = json['TokenID'];
generalid = json['generalid'];
patientOutSA = json['PatientOutSA'];
patientTypeID = json['PatientTypeID'];
patientType = json['PatientType'];
projectID = json['ProjectID'];
eRTriageInformation = json['ERTriageInformation'] != null
? new ERTriageInformation.fromJson(json['ERTriageInformation'])
: null;
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['VersionID'] = this.versionID;
data['Channel'] = this.channel;
data['LanguageID'] = this.languageID;
data['IPAdress'] = this.iPAdress;
data['SessionID'] = this.sessionID;
data['PatientID'] = this.patientID;
data['TokenID'] = this.tokenID;
data['generalid'] = this.generalid;
data['PatientOutSA'] = this.patientOutSA;
data['PatientTypeID'] = this.patientTypeID;
data['PatientType'] = this.patientType;
data['ProjectID'] = this.projectID;
if (this.eRTriageInformation != null) {
data['ERTriageInformation'] = this.eRTriageInformation.toJson();
}
return data;
}
}
class ERTriageInformation {
String notes;
String chiefComplaint;
int patientId;
int projectId;
int riskScore;
List<Checklist> checklist;
ERTriageInformation(
{this.notes,
this.chiefComplaint,
this.patientId,
this.projectId,
this.riskScore,
this.checklist});
ERTriageInformation.fromJson(Map<String, dynamic> json) {
notes = json['Notes'];
chiefComplaint = json['ChiefComplaint'];
patientId = json['PatientId'];
projectId = json['ProjectId'];
riskScore = json['RiskScore'];
if (json['checklist'] != null) {
checklist = new List<Checklist>();
json['checklist'].forEach((v) {
checklist.add(new Checklist.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['Notes'] = this.notes;
data['ChiefComplaint'] = this.chiefComplaint;
data['PatientId'] = this.patientId;
data['ProjectId'] = this.projectId;
data['RiskScore'] = this.riskScore;
if (this.checklist != null) {
data['checklist'] = this.checklist.map((v) => v.toJson()).toList();
}
return data;
}
}
class Checklist {
int isSelected;
int parameterCode;
int parameterGroup;
int parameterType;
int score;
Checklist(
{this.isSelected,
this.parameterCode,
this.parameterGroup,
this.parameterType,
this.score});
Checklist.fromJson(Map<String, dynamic> json) {
isSelected = json['IsSelected'];
parameterCode = json['ParameterCode'];
parameterGroup = json['ParameterGroup'];
parameterType = json['ParameterType'];
score = json['Score'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['IsSelected'] = this.isSelected;
data['ParameterCode'] = this.parameterCode;
data['ParameterGroup'] = this.parameterGroup;
data['ParameterType'] = this.parameterType;
data['Score'] = this.score;
return data;
}
}

@ -0,0 +1,52 @@
class TriageQuestionsModel {
String adultPoints;
String headerSequence;
int parameterCode;
int parameterGroup;
int parameterType;
String pediaPoints;
String question;
String questionN;
String scoreGroup;
String titles;
TriageQuestionsModel(
{this.adultPoints,
this.headerSequence,
this.parameterCode,
this.parameterGroup,
this.parameterType,
this.pediaPoints,
this.question,
this.questionN,
this.scoreGroup,
this.titles});
TriageQuestionsModel.fromJson(Map<String, dynamic> json) {
adultPoints = json['AdultPoints'];
headerSequence = json['HeaderSequence'];
parameterCode = json['ParameterCode'];
parameterGroup = json['ParameterGroup'];
parameterType = json['ParameterType'];
pediaPoints = json['PediaPoints'];
question = json['Question'];
questionN = json['QuestionN'];
scoreGroup = json['ScoreGroup'];
titles = json['Titles'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['AdultPoints'] = this.adultPoints;
data['HeaderSequence'] = this.headerSequence;
data['ParameterCode'] = this.parameterCode;
data['ParameterGroup'] = this.parameterGroup;
data['ParameterType'] = this.parameterType;
data['PediaPoints'] = this.pediaPoints;
data['Question'] = this.question;
data['QuestionN'] = this.questionN;
data['ScoreGroup'] = this.scoreGroup;
data['Titles'] = this.titles;
return data;
}
}

@ -1,11 +1,11 @@
class HospitalsModel { class HospitalsModel {
String desciption; String desciption;
Null desciptionN; dynamic desciptionN;
dynamic iD; dynamic iD;
String legalName; String legalName;
String legalNameN; String legalNameN;
String name; String name;
Null nameN; dynamic nameN;
String phoneNumber; String phoneNumber;
String setupID; String setupID;
dynamic distanceInKilometers; dynamic distanceInKilometers;
@ -13,7 +13,7 @@ class HospitalsModel {
String latitude; String latitude;
String longitude; String longitude;
dynamic mainProjectID; dynamic mainProjectID;
Null projectOutSA; dynamic projectOutSA;
bool usingInDoctorApp; bool usingInDoctorApp;
HospitalsModel( HospitalsModel(

@ -4,29 +4,29 @@ import 'PharmacyImageObject.dart';
import 'Reviews.dart'; import 'Reviews.dart';
class PharmacyProduct { class PharmacyProduct {
String id; dynamic id;
bool visibleIndividually; bool visibleIndividually;
String name; dynamic name;
String namen; dynamic namen;
String shortDescription; dynamic shortDescription;
String shortDescriptionn; dynamic shortDescriptionn;
String fullDescription; dynamic fullDescription;
String fullDescriptionn; dynamic fullDescriptionn;
bool markasNew; bool markasNew;
bool showOnHomePage; bool showOnHomePage;
String metaKeywords; dynamic metaKeywords;
String metaDescription; dynamic metaDescription;
String metaTitle; dynamic metaTitle;
bool allowCustomerReviews; bool allowCustomerReviews;
int approvedRatingSum; int approvedRatingSum;
int notApprovedRatingSum; int notApprovedRatingSum;
int approvedTotalReviews; int approvedTotalReviews;
int notApprovedTotalReviews; int notApprovedTotalReviews;
String sku; dynamic sku;
bool isRx; bool isRx;
bool prescriptionRequired; bool prescriptionRequired;
String rxMessage; dynamic rxMessage;
String rxMessagen; dynamic rxMessagen;
String manufacturerPartNumber; String manufacturerPartNumber;
String gtin; String gtin;
bool isGiftCard; bool isGiftCard;
@ -115,118 +115,117 @@ class PharmacyProduct {
int vendorId; int vendorId;
String seName; String seName;
PharmacyProduct( PharmacyProduct(
{this.id, {this.id,
this.visibleIndividually, this.visibleIndividually,
this.name, this.name,
this.namen, this.namen,
this.shortDescription, this.shortDescription,
this.shortDescriptionn, this.shortDescriptionn,
this.fullDescription, this.fullDescription,
this.fullDescriptionn, this.fullDescriptionn,
this.markasNew, this.markasNew,
this.showOnHomePage, this.showOnHomePage,
this.metaKeywords, this.metaKeywords,
this.metaDescription, this.metaDescription,
this.metaTitle, this.metaTitle,
this.allowCustomerReviews, this.allowCustomerReviews,
this.approvedRatingSum, this.approvedRatingSum,
this.notApprovedRatingSum, this.notApprovedRatingSum,
this.approvedTotalReviews, this.approvedTotalReviews,
this.notApprovedTotalReviews, this.notApprovedTotalReviews,
this.sku, this.sku,
this.isRx, this.isRx,
this.prescriptionRequired, this.prescriptionRequired,
this.rxMessage, this.rxMessage,
this.rxMessagen, this.rxMessagen,
this.manufacturerPartNumber, this.manufacturerPartNumber,
this.gtin, this.gtin,
this.isGiftCard, this.isGiftCard,
this.requireOtherProducts, this.requireOtherProducts,
this.automaticallyAddRequiredProducts, this.automaticallyAddRequiredProducts,
this.isDownload, this.isDownload,
this.unlimitedDownloads, this.unlimitedDownloads,
this.maxNumberOfDownloads, this.maxNumberOfDownloads,
this.downloadExpirationDays, this.downloadExpirationDays,
this.hasSampleDownload, this.hasSampleDownload,
this.hasUserAgreement, this.hasUserAgreement,
this.isRecurring, this.isRecurring,
this.recurringCycleLength, this.recurringCycleLength,
this.recurringTotalCycles, this.recurringTotalCycles,
this.isRental, this.isRental,
this.rentalPriceLength, this.rentalPriceLength,
this.isShipEnabled, this.isShipEnabled,
this.isFreeShipping, this.isFreeShipping,
this.shipSeparately, this.shipSeparately,
this.additionalShippingCharge, this.additionalShippingCharge,
this.isTaxExempt, this.isTaxExempt,
this.isTelecommunicationsOrBroadcastingOrElectronicServices, this.isTelecommunicationsOrBroadcastingOrElectronicServices,
this.useMultipleWarehouses, this.useMultipleWarehouses,
this.manageInventoryMethodId, this.manageInventoryMethodId,
this.stockQuantity, this.stockQuantity,
this.stockAvailability, this.stockAvailability,
this.stockAvailabilityn, this.stockAvailabilityn,
this.displayStockAvailability, this.displayStockAvailability,
this.displayStockQuantity, this.displayStockQuantity,
this.minStockQuantity, this.minStockQuantity,
this.notifyAdminForQuantityBelow, this.notifyAdminForQuantityBelow,
this.allowBackInStockSubscriptions, this.allowBackInStockSubscriptions,
this.orderMinimumQuantity, this.orderMinimumQuantity,
this.orderMaximumQuantity, this.orderMaximumQuantity,
this.allowedQuantities, this.allowedQuantities,
this.allowAddingOnlyExistingAttributeCombinations, this.allowAddingOnlyExistingAttributeCombinations,
this.disableBuyButton, this.disableBuyButton,
this.disableWishlistButton, this.disableWishlistButton,
this.availableForPreOrder, this.availableForPreOrder,
this.preOrderAvailabilityStartDateTimeUtc, this.preOrderAvailabilityStartDateTimeUtc,
this.callForPrice, this.callForPrice,
this.price, this.price,
this.oldPrice, this.oldPrice,
this.productCost, this.productCost,
this.specialPrice, this.specialPrice,
this.specialPriceStartDateTimeUtc, this.specialPriceStartDateTimeUtc,
this.specialPriceEndDateTimeUtc, this.specialPriceEndDateTimeUtc,
this.customerEntersPrice, this.customerEntersPrice,
this.minimumCustomerEnteredPrice, this.minimumCustomerEnteredPrice,
this.maximumCustomerEnteredPrice, this.maximumCustomerEnteredPrice,
this.basepriceEnabled, this.basepriceEnabled,
this.basepriceAmount, this.basepriceAmount,
this.basepriceBaseAmount, this.basepriceBaseAmount,
this.hasTierPrices, this.hasTierPrices,
this.hasDiscountsApplied, this.hasDiscountsApplied,
this.discountName, this.discountName,
this.discountNamen, this.discountNamen,
this.discountDescription, this.discountDescription,
this.discountDescriptionn, this.discountDescriptionn,
this.discountPercentage, this.discountPercentage,
this.currency, this.currency,
this.currencyn, this.currencyn,
this.weight, this.weight,
this.length, this.length,
this.width, this.width,
this.height, this.height,
this.availableStartDateTimeUtc, this.availableStartDateTimeUtc,
this.availableEndDateTimeUtc, this.availableEndDateTimeUtc,
this.displayOrder, this.displayOrder,
this.published, this.published,
this.deleted, this.deleted,
this.createdOnUtc, this.createdOnUtc,
this.updatedOnUtc, this.updatedOnUtc,
this.productType, this.productType,
this.parentGroupedProductId, this.parentGroupedProductId,
this.roleIds, this.roleIds,
this.discountIds, this.discountIds,
this.storeIds, this.storeIds,
this.manufacturerIds, this.manufacturerIds,
this.reviews, this.reviews,
this.images, this.images,
this.attributes, this.attributes,
this.specifications, this.specifications,
this.associatedProductIds, this.associatedProductIds,
this.tags, this.tags,
this.vendorId, this.vendorId,
this.seName}); this.seName});
PharmacyProduct.fromJson(Map<String, dynamic> json) { PharmacyProduct.fromJson(Map<String, dynamic> json) {
id = json['id']; id = json['id'];
@ -257,7 +256,7 @@ class PharmacyProduct {
isGiftCard = json['is_gift_card']; isGiftCard = json['is_gift_card'];
requireOtherProducts = json['require_other_products']; requireOtherProducts = json['require_other_products'];
automaticallyAddRequiredProducts = automaticallyAddRequiredProducts =
json['automatically_add_required_products']; json['automatically_add_required_products'];
isDownload = json['is_download']; isDownload = json['is_download'];
unlimitedDownloads = json['unlimited_downloads']; unlimitedDownloads = json['unlimited_downloads'];
maxNumberOfDownloads = json['max_number_of_downloads']; maxNumberOfDownloads = json['max_number_of_downloads'];
@ -275,7 +274,7 @@ class PharmacyProduct {
additionalShippingCharge = json['additional_shipping_charge']; additionalShippingCharge = json['additional_shipping_charge'];
isTaxExempt = json['is_tax_exempt']; isTaxExempt = json['is_tax_exempt'];
isTelecommunicationsOrBroadcastingOrElectronicServices = isTelecommunicationsOrBroadcastingOrElectronicServices =
json['is_telecommunications_or_broadcasting_or_electronic_services']; json['is_telecommunications_or_broadcasting_or_electronic_services'];
useMultipleWarehouses = json['use_multiple_warehouses']; useMultipleWarehouses = json['use_multiple_warehouses'];
manageInventoryMethodId = json['manage_inventory_method_id']; manageInventoryMethodId = json['manage_inventory_method_id'];
stockQuantity = json['stock_quantity']; stockQuantity = json['stock_quantity'];
@ -290,12 +289,12 @@ class PharmacyProduct {
orderMaximumQuantity = json['order_maximum_quantity']; orderMaximumQuantity = json['order_maximum_quantity'];
allowedQuantities = json['allowed_quantities']; allowedQuantities = json['allowed_quantities'];
allowAddingOnlyExistingAttributeCombinations = allowAddingOnlyExistingAttributeCombinations =
json['allow_adding_only_existing_attribute_combinations']; json['allow_adding_only_existing_attribute_combinations'];
disableBuyButton = json['disable_buy_button']; disableBuyButton = json['disable_buy_button'];
disableWishlistButton = json['disable_wishlist_button']; disableWishlistButton = json['disable_wishlist_button'];
availableForPreOrder = json['available_for_pre_order']; availableForPreOrder = json['available_for_pre_order'];
preOrderAvailabilityStartDateTimeUtc = preOrderAvailabilityStartDateTimeUtc =
json['pre_order_availability_start_date_time_utc']; json['pre_order_availability_start_date_time_utc'];
callForPrice = json['call_for_price']; callForPrice = json['call_for_price'];
price = json['price']; price = json['price'];
oldPrice = json['old_price']; oldPrice = json['old_price'];

@ -0,0 +1,204 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:diplomaticquarterapp/models/anicllary-orders/ancillary_order_list_model.dart';
import 'package:diplomaticquarterapp/models/anicllary-orders/ancillary_order_proc_model.dart';
class AncillaryOrdersService extends BaseService {
List<AncillaryOrdersListModel> _ancillaryLists = List();
List<AncillaryOrdersListModel> get ancillaryLists => _ancillaryLists;
List<AncillaryOrdersListProcListModel> _ancillaryProcLists = List();
List<AncillaryOrdersListProcListModel> get ancillaryProcLists =>
_ancillaryProcLists;
Future getOrders() async {
Map<String, dynamic> body = Map();
hasError = false;
await baseAppClient.post(GET_ANCILLARY_ORDERS,
onSuccess: (dynamic response, int statusCode) {
_ancillaryLists = [];
response['AncillaryOrderList'].forEach((item) {
ancillaryLists.add(AncillaryOrdersListModel.fromJson(item));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
Future getOrdersDetails(appointmentNo, orderNo) async {
Map<String, dynamic> body = Map();
hasError = false;
await baseAppClient.post(GET_ANCILLARY_ORDERS_DETAILS,
onSuccess: (dynamic response, int statusCode) {
_ancillaryProcLists = [];
response['AncillaryOrderProcList'] = [
{
"AncillaryOrderProcList": [
{
"ApprovalLineItemNo": 0,
"ApprovalNo": 0,
"ApprovalStatus": "",
"ApprovalStatusID": 0,
"CompanyShare": 501.3,
"CompanyShareWithTax": 576.5,
"CompanyTaxAmount": 75.19,
"DiscountAmount": 55.7,
"DiscountCategory": 1,
"DiscountType": "P",
"DiscountTypeValue": 10,
"IsApprovalCreated": false,
"IsApprovalRequired": false,
"IsCovered": false,
"OrderDate": "/Date(1601758800000+0300)/",
"OrderLineItemNo": 1,
"OrderNo": 2020000001,
"PartnerID": 0,
"PartnerShare": 0,
"PartnerShareType": "P",
"PatientShare": 0,
"PatientShareWithTax": 0,
"PatientTaxAmount": 0,
"ProcPrice": 557,
"ProcedureCategoryID": 2,
"ProcedureCategoryName": "LABORATORY",
"ProcedureID": "02013001",
"ProcedureName": "11-DESOXYCORTISOL (COMPOUND S) - S.O",
"TaxAmount": 75.19,
"TaxPct": 15
},
{
"ApprovalLineItemNo": 0,
"ApprovalNo": 0,
"ApprovalStatus": "",
"ApprovalStatusID": 0,
"CompanyShare": 90,
"CompanyShareWithTax": 103.5,
"CompanyTaxAmount": 13.5,
"DiscountAmount": 10,
"DiscountCategory": 1,
"DiscountType": "P",
"DiscountTypeValue": 10,
"IsApprovalCreated": false,
"IsApprovalRequired": true,
"IsCovered": false,
"OrderDate": "/Date(1601758800000+0300)/",
"OrderLineItemNo": 4,
"OrderNo": 2020000001,
"PartnerID": 0,
"PartnerShare": 0,
"PartnerShareType": "P",
"PatientShare": 0,
"PatientShareWithTax": 0,
"PatientTaxAmount": 0,
"ProcPrice": 100,
"ProcedureCategoryID": 2,
"ProcedureCategoryName": "LABORATORY",
"ProcedureID": "02014011",
"ProcedureName": "CBC (COMPLETE BLOOD COUNT PROFILE)",
"TaxAmount": 13.5,
"TaxPct": 15
},
{
"ApprovalLineItemNo": 0,
"ApprovalNo": 0,
"ApprovalStatus": "",
"ApprovalStatusID": 0,
"CompanyShare": 347.76,
"CompanyShareWithTax": 399.92,
"CompanyTaxAmount": 52.16,
"DiscountAmount": 38.64,
"DiscountCategory": 1,
"DiscountType": "P",
"DiscountTypeValue": 10,
"IsApprovalCreated": false,
"IsApprovalRequired": false,
"IsCovered": false,
"OrderDate": "/Date(1601758800000+0300)/",
"OrderLineItemNo": 3,
"OrderNo": 2020000001,
"PartnerID": 0,
"PartnerShare": 0,
"PartnerShareType": "P",
"PatientShare": 0,
"PatientShareWithTax": 0,
"PatientTaxAmount": 0,
"ProcPrice": 386.4,
"ProcedureCategoryID": 2,
"ProcedureCategoryName": "LABORATORY",
"ProcedureID": "02019302",
"ProcedureName": "21-HYDROXYLASE ABS - S.O",
"TaxAmount": 52.16,
"TaxPct": 15
},
{
"ApprovalLineItemNo": 0,
"ApprovalNo": 0,
"ApprovalStatus": "",
"ApprovalStatusID": 0,
"CompanyShare": 1323,
"CompanyShareWithTax": 1521.45,
"CompanyTaxAmount": 198.45,
"DiscountAmount": 147,
"DiscountCategory": 1,
"DiscountType": "P",
"DiscountTypeValue": 10,
"IsApprovalCreated": false,
"IsApprovalRequired": true,
"IsCovered": false,
"OrderDate": "/Date(1601758800000+0300)/",
"OrderLineItemNo": 5,
"OrderNo": 2020000001,
"PartnerID": 0,
"PartnerShare": 0,
"PartnerShareType": "P",
"PatientShare": 0,
"PatientShareWithTax": 0,
"PatientTaxAmount": 0,
"ProcPrice": 1470,
"ProcedureCategoryID": 3,
"ProcedureCategoryName": "RADIOLOGY",
"ProcedureID": "03033065",
"ProcedureName": "CT SCAN - ABDOMEN (WITH CONTRAST)",
"TaxAmount": 198.45,
"TaxPct": 15
}
],
"AppointmentDate": "/Date(1601499600000+0300)/",
"AppointmentNo": 2016053756,
"ClinicID": 1,
"ClinicName": "INTERNAL MEDICINE CLINIC",
"CompanyID": 0,
"CompanyName": "Blood Donation Investigation",
"DoctorID": 1485,
"DoctorName": "ANAS ABDULLAH",
"ErrCode": null,
"GroupID": 2,
"InsurancePolicyNo": "45976500",
"Message": "Success",
"PatientCardID": "232332323",
"PatientID": 3072055,
"PatientName": "MAYA KHALED SADDIQ",
"PatientType": 1,
"PolicyID": 2,
"PolicyName": "Test",
"ProjectID": 15,
"SetupID": "010266",
"StatusCode": 1,
"SubCategoryID": 2,
"SubPolicyNo": "234234"
}
];
response['AncillaryOrderProcList'].forEach((item) {
ancillaryProcLists.add(AncillaryOrdersListProcListModel.fromJson(item));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
}

@ -7,6 +7,8 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart';
import 'package:diplomaticquarterapp/pages/appUpdatePage/app_update_page.dart'; import 'package:diplomaticquarterapp/pages/appUpdatePage/app_update_page.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
@ -132,7 +134,198 @@ class BaseAppClient {
if (statusCode < 200 || statusCode >= 400 || json == null) { if (statusCode < 200 || statusCode >= 400 || json == null) {
onFailure('Error While Fetching data', statusCode); onFailure('Error While Fetching data', statusCode);
} else { } else {
var parsed = json.decode(response.body.toString()); // var parsed = json.decode(response.body.toString());
var parsed = json.decode(utf8.decode(response.bodyBytes));
if (parsed['Response_Message'] != null) {
onSuccess(parsed, statusCode);
} else {
if (parsed['ErrorType'] == 4) {
navigateToAppUpdate(
AppGlobal.context, parsed['ErrorEndUserMessage']);
}
if (isAllowAny) {
onSuccess(parsed, statusCode);
} else if (parsed['IsAuthenticated'] == null) {
if (parsed['isSMSSent'] == true) {
onSuccess(parsed, statusCode);
} else if (parsed['MessageStatus'] == 1) {
onSuccess(parsed, statusCode);
} else if (parsed['Result'] == 'OK') {
onSuccess(parsed, statusCode);
} else {
if (parsed != null) {
onSuccess(parsed, statusCode);
} else {
onFailure(
parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'],
statusCode);
logout();
}
}
} else if (parsed['MessageStatus'] == 1 ||
parsed['SMSLoginRequired'] == true) {
onSuccess(parsed, statusCode);
} else if (parsed['MessageStatus'] == 2 &&
parsed['IsAuthenticated']) {
if (parsed['SameClinicApptList'] != null) {
onSuccess(parsed, statusCode);
} else {
if (parsed['message'] == null &&
parsed['ErrorEndUserMessage'] == null) {
if (parsed['ErrorSearchMsg'] == null) {
onFailure("Server Error found with no available message",
statusCode);
} else {
onFailure(parsed['ErrorSearchMsg'], statusCode);
}
} else {
onFailure(
parsed['message'] ??
parsed['ErrorEndUserMessage'] ??
parsed['ErrorMessage'],
statusCode);
}
}
} else if (!parsed['IsAuthenticated']) {
await logout();
//helpers.showErrorToast('Your session expired Please login agian');
} else {
if (parsed['SameClinicApptList'] != null) {
onSuccess(parsed, statusCode);
} else {
if (parsed['message'] != null) {
onFailure(parsed['message'] ?? parsed['message'], statusCode);
} else {
onFailure(
parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'],
statusCode);
}
}
}
}
}
} else {
onFailure('Please Check The Internet Connection', -1);
}
} catch (e) {
print(e);
onFailure(e.toString(), -1);
}
}
postPharmacy(String endPoint,
{Map<String, dynamic> body,
Function(dynamic response, int statusCode) onSuccess,
Function(String error, int statusCode) onFailure,
bool isAllowAny = false,
bool isExternal = false}) async {
var token = await sharedPref.getString(PHARMACY_AUTORZIE_TOKEN);
var user = await sharedPref.getObject(USER_PROFILE);
String url;
if (isExternal) {
url = endPoint;
} else {
url = PHARMACY_BASE_URL + endPoint;
}
try {
//Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
var pharmacyToken = await sharedPref.getString(PHARMACY_AUTORZIE_TOKEN);
var user = await sharedPref.getObject(USER_PROFILE);
Map<String, String> headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': token ?? '',
'Mobilenumber': user != null
? getPhoneNumberWithoutZero(user['MobileNumber'].toString())
: "",
'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9',
'Username': user != null ? user['PatientID'].toString() : "",
};
if (!isExternal) {
String token = await sharedPref.getString(TOKEN);
var languageID =
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
if (body.containsKey('SetupID')) {
body['SetupID'] = body.containsKey('SetupID')
? body['SetupID'] != null
? body['SetupID']
: SETUP_ID
: SETUP_ID;
}
body['VersionID'] = VERSION_ID;
body['Channel'] = CHANNEL;
body['LanguageID'] = languageID == 'ar' ? 1 : 2;
body['IPAdress'] = IP_ADDRESS;
body['generalid'] = GENERAL_ID;
body['PatientOutSA'] = body.containsKey('PatientOutSA')
? body['PatientOutSA'] != null
? body['PatientOutSA']
: PATIENT_OUT_SA
: PATIENT_OUT_SA;
if (body.containsKey('isDentalAllowedBackend')) {
body['isDentalAllowedBackend'] =
body.containsKey('isDentalAllowedBackend')
? body['isDentalAllowedBackend'] != null
? body['isDentalAllowedBackend']
: IS_DENTAL_ALLOWED_BACKEND
: IS_DENTAL_ALLOWED_BACKEND;
}
body['DeviceTypeID'] = DeviceTypeID;
if (!body.containsKey('IsPublicRequest')) {
body['PatientType'] = body.containsKey('PatientType')
? body['PatientType'] != null
? body['PatientType']
: user['PatientType'] != null
? user['PatientType']
: PATIENT_TYPE
: PATIENT_TYPE;
body['PatientTypeID'] = body.containsKey('PatientTypeID')
? body['PatientTypeID'] != null
? body['PatientTypeID']
: user['PatientType'] != null
? user['PatientType']
: PATIENT_TYPE_ID
: PATIENT_TYPE_ID;
if (user != null) {
body['TokenID'] = token;
body['PatientID'] = body['PatientID'] != null
? body['PatientID']
: user['PatientID'];
body['PatientOutSA'] = user['OutSA'];
body['SessionID'] = SESSION_ID; //getSe
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': pharmacyToken,
'Mobilenumber': user['MobileNumber'].toString(),
'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9',
'Username': user['PatientID'].toString(),
};
}
}
}
print("URL : $url");
print("Body : ${json.encode(body)}");
if (await Utils.checkConnection()) {
final response = await http.post(url.trim(),
body: json.encode(body), headers: headers);
final int statusCode = response.statusCode;
print("statusCode :$statusCode");
if (statusCode < 200 || statusCode >= 400 || json == null) {
onFailure('Error While Fetching data', statusCode);
} else {
// var parsed = json.decode(response.body.toString());
var parsed = json.decode(utf8.decode(response.bodyBytes));
if (parsed['Response_Message'] != null) { if (parsed['Response_Message'] != null) {
onSuccess(parsed, statusCode); onSuccess(parsed, statusCode);
} else { } else {
@ -248,7 +441,8 @@ class BaseAppClient {
if (statusCode < 200 || statusCode >= 400 || json == null) { if (statusCode < 200 || statusCode >= 400 || json == null) {
onFailure('Error While Fetching data', statusCode); onFailure('Error While Fetching data', statusCode);
} else { } else {
var parsed = json.decode(response.body.toString()); // var parsed = json.decode(response.body.toString());
var parsed = json.decode(utf8.decode(response.bodyBytes));
onSuccess(parsed, statusCode); onSuccess(parsed, statusCode);
} }
} else { } else {
@ -280,7 +474,7 @@ class BaseAppClient {
if (await Utils.checkConnection()) { if (await Utils.checkConnection()) {
final response = await http.get(url.trim(), headers: { final response = await http.get(url.trim(), headers: {
'Content-Type': 'application/json', 'Content-Type': 'text/html; charset=utf-8',
'Accept': 'application/json', 'Accept': 'application/json',
'Authorization': token ?? '', 'Authorization': token ?? '',
'Mobilenumber': user != null 'Mobilenumber': user != null
@ -293,10 +487,17 @@ class BaseAppClient {
print("statusCode :$statusCode"); print("statusCode :$statusCode");
if (statusCode < 200 || statusCode >= 400 || json == null) { if (statusCode < 200 || statusCode >= 400 || json == null) {
onFailure('Error While Fetching data', statusCode); if (statusCode == 401) {
AppToast.showErrorToast(
message: TranslationBase.of(AppGlobal.context).pharmacyRelogin);
Navigator.of(AppGlobal.context).pushNamed(HOME);
} else {
onFailure('Error While Fetching data', statusCode);
}
} else { } else {
var parsed = json.decode(response.body.toString()); // var parsed = json.decode(response.body.toString());
onSuccess(parsed, statusCode); var bodyUtf = json.decode(utf8.decode(response.bodyBytes));
onSuccess(bodyUtf, statusCode);
} }
} else { } else {
onFailure('Please Check The Internet Connection', -1); onFailure('Please Check The Internet Connection', -1);
@ -389,10 +590,12 @@ class BaseAppClient {
pharmacyPost(String endPoint, pharmacyPost(String endPoint,
{Map<String, dynamic> body, {Map<String, dynamic> body,
Function(dynamic response, int statusCode) onSuccess, Function(dynamic response, int statusCode) onSuccess,
Function(String error, int statusCode) onFailure, Function(String error, int statusCode) onFailure,
bool isAllowAny = false, bool isAllowAny = false,
bool isExternal = false}) async { bool isExternal = false}) async {
var token = await sharedPref.getString(PHARMACY_AUTORZIE_TOKEN);
var user = await sharedPref.getObject(USER_PROFILE);
String url; String url;
if (isExternal) { if (isExternal) {
url = endPoint; url = endPoint;
@ -400,17 +603,16 @@ class BaseAppClient {
url = BASE_PHARMACY_URL + endPoint; url = BASE_PHARMACY_URL + endPoint;
} }
try { try {
//Map profile = await sharedPref.getObj(DOCTOR_PROFILE); if (isExternal) {
if (!isExternal) {
String token = await sharedPref.getString(TOKEN); String token = await sharedPref.getString(TOKEN);
var languageID = var languageID =
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
var user = await sharedPref.getObject(USER_PROFILE); var user = await sharedPref.getObject(USER_PROFILE);
if (body.containsKey('SetupID')) { if (body.containsKey('SetupID')) {
body['SetupID'] = body.containsKey('SetupID') body['SetupID'] = body.containsKey('SetupID')
? body['SetupID'] != null ? body['SetupID'] != null
? body['SetupID'] ? body['SetupID']
: SETUP_ID : SETUP_ID
: SETUP_ID; : SETUP_ID;
} }
@ -422,17 +624,17 @@ class BaseAppClient {
body['generalid'] = GENERAL_ID; body['generalid'] = GENERAL_ID;
body['PatientOutSA'] = body.containsKey('PatientOutSA') body['PatientOutSA'] = body.containsKey('PatientOutSA')
? body['PatientOutSA'] != null ? body['PatientOutSA'] != null
? body['PatientOutSA'] ? body['PatientOutSA']
: PATIENT_OUT_SA : PATIENT_OUT_SA
: PATIENT_OUT_SA; : PATIENT_OUT_SA;
if (body.containsKey('isDentalAllowedBackend')) { if (body.containsKey('isDentalAllowedBackend')) {
body['isDentalAllowedBackend'] = body['isDentalAllowedBackend'] =
body.containsKey('isDentalAllowedBackend') body.containsKey('isDentalAllowedBackend')
? body['isDentalAllowedBackend'] != null ? body['isDentalAllowedBackend'] != null
? body['isDentalAllowedBackend'] ? body['isDentalAllowedBackend']
: IS_DENTAL_ALLOWED_BACKEND : IS_DENTAL_ALLOWED_BACKEND
: IS_DENTAL_ALLOWED_BACKEND; : IS_DENTAL_ALLOWED_BACKEND;
} }
body['DeviceTypeID'] = DeviceTypeID; body['DeviceTypeID'] = DeviceTypeID;
@ -440,18 +642,18 @@ class BaseAppClient {
if (!body.containsKey('IsPublicRequest')) { if (!body.containsKey('IsPublicRequest')) {
body['PatientType'] = body.containsKey('PatientType') body['PatientType'] = body.containsKey('PatientType')
? body['PatientType'] != null ? body['PatientType'] != null
? body['PatientType'] ? body['PatientType']
: user['PatientType'] != null : user['PatientType'] != null
? user['PatientType'] ? user['PatientType']
: PATIENT_TYPE : PATIENT_TYPE
: PATIENT_TYPE; : PATIENT_TYPE;
body['PatientTypeID'] = body.containsKey('PatientTypeID') body['PatientTypeID'] = body.containsKey('PatientTypeID')
? body['PatientTypeID'] != null ? body['PatientTypeID'] != null
? body['PatientTypeID'] ? body['PatientTypeID']
: user['PatientType'] != null : user['PatientType'] != null
? user['PatientType'] ? user['PatientType']
: PATIENT_TYPE_ID : PATIENT_TYPE_ID
: PATIENT_TYPE_ID; : PATIENT_TYPE_ID;
if (user != null) { if (user != null) {
body['TokenID'] = token; body['TokenID'] = token;
@ -469,19 +671,27 @@ class BaseAppClient {
var ss = json.encode(body); var ss = json.encode(body);
if (await Utils.checkConnection()) { if (await Utils.checkConnection()) {
final response = await http.post(url.trim(), final response =
body: json.encode(body), await http.post(url.trim(), body: json.encode(body), headers: {
headers: { // 'Content-Type': 'application/json',
'Content-Type': 'application/json', // 'Accept': 'application/json',
'Accept': 'application/json', // 'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9',
'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9', 'Content-Type': 'application/json',
}); 'Accept': 'application/json',
'Authorization': token ?? '',
'Mobilenumber': user != null
? getPhoneNumberWithoutZero(user['MobileNumber'].toString())
: "",
'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9',
'Username': user != null ? user['PatientID'].toString() : "",
});
final int statusCode = response.statusCode; final int statusCode = response.statusCode;
print("statusCode :$statusCode"); print("statusCode :$statusCode");
if (statusCode < 200 || statusCode >= 400 || json == null) { if (statusCode < 200 || statusCode >= 400 || json == null) {
onFailure('Error While Fetching data', statusCode); onFailure('Error While Fetching data', statusCode);
} else { } else {
var parsed = json.decode(response.body.toString()); // var parsed = json.decode(response.body.toString());
var parsed = json.decode(utf8.decode(response.bodyBytes));
if (parsed['Response_Message'] != null) { if (parsed['Response_Message'] != null) {
onSuccess(parsed, statusCode); onSuccess(parsed, statusCode);
} else { } else {
@ -515,12 +725,11 @@ class BaseAppClient {
parsed['IsAuthenticated']) { parsed['IsAuthenticated']) {
if (parsed['message'] == null && if (parsed['message'] == null &&
parsed['ErrorEndUserMessage'] == null) { parsed['ErrorEndUserMessage'] == null) {
if(parsed['ErrorSearchMsg'] == null ){ if (parsed['ErrorSearchMsg'] == null) {
onFailure("Server Error found with no available message", onFailure("Server Error found with no available message",
statusCode); statusCode);
}else { } else {
onFailure(parsed['ErrorSearchMsg'], onFailure(parsed['ErrorSearchMsg'], statusCode);
statusCode);
} }
} else { } else {
onFailure( onFailure(

@ -0,0 +1,96 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/model/er/ErPatientShareModel.dart';
import 'package:diplomaticquarterapp/core/model/er/TriageQuestionsModel.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart';
class EdOnlineServices extends BaseService {
List<TriageQuestionsModel> triageQuestionsModelList = List();
ErPatientShareModel erPatientShareModel;
Future getQuestions() async {
hasError =false;
triageQuestionsModelList.clear();
Map<String, dynamic> body = Map();
body['ProjectID'] = 15;
await baseAppClient.post(ER_GET_VISUAL_TRIAGE_QUESTIONS,
onSuccess: (dynamic response, int statusCode) {
triageQuestionsModelList.clear();
response['ER_TriageQuestionsList'].forEach((questions) {
triageQuestionsModelList.add(TriageQuestionsModel.fromJson(questions));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
Future getPatientPaymentInformation({var id}) async {
hasError =false;
await baseAppClient.post(ER_GetPatientPaymentInformationForERClinic,
onSuccess: (dynamic response, int statusCode) {
erPatientShareModel =
ErPatientShareModel.fromJson(response['ER_PatientShare']);
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: Map.from({"ProjectID":15,"ClinicID":10}));
}
Future saveQuestionsInformation(
{String notes,
String chiefComplaint,
int projectId,
DateTime selectedTime,
List<TriageQuestionsModel> selectedQuestions}) async {
hasError =false;
Map<String, dynamic> body = Map();
List<Map> checklist = List();
body['ProjectID'] = 15;
body['ProjectId'] = projectId;
int riskScore = 0;
if (user.age > 14) {
selectedQuestions.forEach((element) {
int score = int.parse(element.adultPoints);
riskScore += score;
checklist.add(Map.from({
"IsSelected": 1,
"ParameterCode": element.parameterCode,
"ParameterGroup": element.parameterGroup,
"ParameterType": element.parameterType,
"Score": score
}));
});
} else {
selectedQuestions.forEach((element) {
int score = int.parse(element.pediaPoints);
riskScore += score;
checklist.add(Map.from({
"IsSelected": 1,
"ParameterCode": element.parameterCode,
"ParameterGroup": element.parameterGroup,
"ParameterType": element.parameterType,
"Score": score
}));
});
}
body['ERTriageInformation'] = {
"Notes": notes,
"ChiefComplaint": chiefComplaint,
"PatientId": user.patientID,
"ProjectId": 15,
"RiskScore": riskScore,
"checklist": checklist.map((e) => e).toList()
};
await baseAppClient.post(ER_SAVE_TRIAGE_INFORMATION,
onSuccess: (dynamic response, int statusCode) {},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
}

@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/Addresses.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/Addresses.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/LacumAccountInformation.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/LacumAccountInformation.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/ShoppingCart.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/ShoppingCart.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/order_detail.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/payment-checkout-data.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/payment-checkout-data.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart';
@ -15,6 +16,7 @@ class OrderPreviewService extends BaseService {
List<Addresses> addresses = List(); List<Addresses> addresses = List();
LacumAccountInformation lacumInformation; LacumAccountInformation lacumInformation;
LacumAccountInformation lacumGroupInformation; LacumAccountInformation lacumGroupInformation;
List<OrderDetailModel> orderList = List();
Future getAddresses() async { Future getAddresses() async {
var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID); var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID);
@ -42,13 +44,14 @@ class OrderPreviewService extends BaseService {
dynamic localRes; dynamic localRes;
hasError = false; hasError = false;
try { try {
await baseAppClient.getPharmacy("$GET_SHIPPING_OPTIONS$customerId/${selectedAddress.id}", await baseAppClient
onSuccess: (dynamic response, int statusCode) { .getPharmacy("$GET_SHIPPING_OPTIONS$customerId/${selectedAddress.id}",
localRes = response['shipping_option'][0]; onSuccess: (dynamic response, int statusCode) {
}, onFailure: (String error, int statusCode) { localRes = response['shipping_option'][0];
hasError = true; }, onFailure: (String error, int statusCode) {
super.error = error; hasError = true;
}, queryParams: queryParams); super.error = error;
}, queryParams: queryParams);
} catch (error) { } catch (error) {
throw error; throw error;
} }
@ -89,7 +92,7 @@ class OrderPreviewService extends BaseService {
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body["shopping_cart_item"] = choppingCartObject; body["shopping_cart_item"] = choppingCartObject;
await baseAppClient.post("$GET_SHOPPING_CART$productId", await baseAppClient.pharmacyPost("$GET_SHOPPING_CART$productId", isExternal: false,
onSuccess: (response, statusCode) async { onSuccess: (response, statusCode) async {
localRes = response; localRes = response;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
@ -107,7 +110,7 @@ class OrderPreviewService extends BaseService {
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
await baseAppClient.post("$DELETE_SHOPPING_CART$productId", await baseAppClient.pharmacyPost("$DELETE_SHOPPING_CART$productId", isExternal: false,
onSuccess: (response, statusCode) async { onSuccess: (response, statusCode) async {
localRes = response; localRes = response;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
@ -125,8 +128,9 @@ class OrderPreviewService extends BaseService {
super.error = ""; super.error = "";
dynamic localRes; dynamic localRes;
await baseAppClient.getPharmacy("$DELETE_SHOPPING_CART_ALL$customerId/ShoppingCart", await baseAppClient
onSuccess: (response, statusCode) async { .getPharmacy("$DELETE_SHOPPING_CART_ALL$customerId/ShoppingCart",
onSuccess: (response, statusCode) async {
localRes = response; localRes = response;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
@ -167,23 +171,24 @@ class OrderPreviewService extends BaseService {
try { try {
await baseAppClient.post(GET_LACUM_GROUP_INFORMATION, await baseAppClient.post(GET_LACUM_GROUP_INFORMATION,
onSuccess: (response, statusCode) async { onSuccess: (response, statusCode) async {
lacumGroupInformation = LacumAccountInformation.fromJson(response); lacumGroupInformation = LacumAccountInformation.fromJson(response);
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: body); }, body: body);
} catch (error) { } catch (error) {
throw error; throw error;
} }
} }
Future makeOrder(PaymentCheckoutData paymentCheckoutData, List<ShoppingCart> shoppingCarts) async { Future makeOrder(PaymentCheckoutData paymentCheckoutData,
List<ShoppingCart> shoppingCarts) async {
paymentCheckoutData.address.isChecked = true; paymentCheckoutData.address.isChecked = true;
hasError = false; hasError = false;
super.error = ""; super.error = "";
var languageID = var languageID =
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'en'); await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'en');
var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID); var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID);
Map<String, dynamic> orderBody = Map(); Map<String, dynamic> orderBody = Map();
@ -192,10 +197,15 @@ class OrderPreviewService extends BaseService {
orderBody['billing_address'] = paymentCheckoutData.address; orderBody['billing_address'] = paymentCheckoutData.address;
orderBody['pick_up_in_store'] = false; orderBody['pick_up_in_store'] = false;
orderBody['payment_method_system_name'] = "Payments.PayFort"; orderBody['payment_method_system_name'] = "Payments.PayFort";
orderBody['shipping_method'] = languageID == 'ar' ? paymentCheckoutData.shippingOption.namen : paymentCheckoutData.shippingOption.name ; orderBody['shipping_method'] = languageID == 'ar'
orderBody['shipping_rate_computation_method_system_name'] = paymentCheckoutData.shippingOption.shippingRateComputationMethodSystemName; ? paymentCheckoutData.shippingOption.namen
orderBody['customer_id'] = customerId; : paymentCheckoutData.shippingOption.name;
orderBody['custom_values_xml'] = "PaymentOption:${getPaymentOptionName(paymentCheckoutData.paymentOption)}"; orderBody['shipping_rate_computation_method_system_name'] =
paymentCheckoutData
.shippingOption.shippingRateComputationMethodSystemName;
orderBody['customer_id'] = int.parse(customerId);
orderBody['custom_values_xml'] =
"PaymentOption:${getPaymentOptionName(paymentCheckoutData.paymentOption)}";
orderBody['shippingOption'] = paymentCheckoutData.shippingOption; orderBody['shippingOption'] = paymentCheckoutData.shippingOption;
orderBody['shipping_address'] = paymentCheckoutData.address; orderBody['shipping_address'] = paymentCheckoutData.address;
orderBody['lakum_amount'] = paymentCheckoutData.usedLakumPoints; orderBody['lakum_amount'] = paymentCheckoutData.usedLakumPoints;
@ -213,12 +223,17 @@ class OrderPreviewService extends BaseService {
body['order'] = orderBody; body['order'] = orderBody;
try { try {
await baseAppClient.post(ORDER_SHOPPING_CART, await baseAppClient.pharmacyPost(ORDER_SHOPPING_CART, isExternal: false, isAllowAny: true,
onSuccess: (response, statusCode) async { onSuccess: (response, statusCode) async {
}, onFailure: (String error, int statusCode) { orderList.clear();
hasError = true; response['orders'].forEach((item) {
super.error = error; orderList.add(OrderDetailModel.fromJson(item));
}, body: body); print(response);
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
} catch (error) { } catch (error) {
throw error; throw error;
} }

@ -80,7 +80,7 @@ class PharmacyModuleService extends BaseService {
}; };
hasError = false; hasError = false;
try { try {
await baseAppClient.get(PHARMACY_AUTORZIE_CUSTOMER, await baseAppClient.getPharmacy(PHARMACY_AUTORZIE_CUSTOMER,
onSuccess: (dynamic response, int statusCode) async { onSuccess: (dynamic response, int statusCode) async {
if (response['Status'] == 200) { if (response['Status'] == 200) {
await sharedPref.setString( await sharedPref.setString(

@ -27,8 +27,8 @@ class PharmacyCategoriseService extends BaseService {
List<PharmacyProduct> get parentProductsList => _parentProductsList; List<PharmacyProduct> get parentProductsList => _parentProductsList;
//service four //service four
List<SubCategoriesModel> _subCategoriseList = List(); List<CategoriseParentModel> _subCategoriseList = List();
List<SubCategoriesModel> get subCategoriseList => _subCategoriseList; List<CategoriseParentModel> get subCategoriseList => _subCategoriseList;
//service five //service five
List<PharmacyProduct> _subProductsList = List(); List<PharmacyProduct> _subProductsList = List();
@ -40,8 +40,8 @@ class PharmacyCategoriseService extends BaseService {
//service 7 //service 7
List<BrandsModel> _brandsList = List(); List<CategoriseParentModel> _brandsList = List();
List<BrandsModel> get brandsList => _brandsList; List<CategoriseParentModel> get brandsList => _brandsList;
// service 8 // service 8
@ -112,14 +112,14 @@ class PharmacyCategoriseService extends BaseService {
); );
} }
Future getBrands() async { Future getBrands({String id}) async {
hasError = false; hasError = false;
_brandsList.clear(); _brandsList.clear();
await baseAppClient.getPharmacy( await baseAppClient.getPharmacy(
GET_BRANDS_LIST, GET_BRANDS_LIST + "$id" + "&fields=id,name,image,namen",
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
response['manufacturer'].forEach((item) { response['manufacturer'].forEach((item) {
_brandsList.add(BrandsModel.fromJson(item)); _brandsList.add(CategoriseParentModel.fromJson(item));
}); });
}, },
onFailure: (String error, int statusCode) { onFailure: (String error, int statusCode) {
@ -178,7 +178,7 @@ class PharmacyCategoriseService extends BaseService {
endPoint, endPoint,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
response['categories'].forEach((item) { response['categories'].forEach((item) {
_subCategoriseList.add(SubCategoriesModel.fromJson(item)); _subCategoriseList.add(CategoriseParentModel.fromJson(item));
}); });
}, },
onFailure: (String error, int statusCode) { onFailure: (String error, int statusCode) {
@ -291,4 +291,29 @@ class PharmacyCategoriseService extends BaseService {
throw error; throw error;
} }
} }
Future getFilteredProducts(
{String categoryId, String brandId, String min, String max}) async {
hasError = false;
String endPoint;
_parentProductsList.clear();
endPoint = FILTERED_PRODUCTS +
"$categoryId" +
"&manufacturerids=$brandId" +
"&price_min=$min" +
"&price_max=$max&page=1&limit=50";
await baseAppClient.getPharmacy(
endPoint,
onSuccess: (dynamic response, int statusCode) {
response['products'].forEach((item) {
_parentProductsList.add(PharmacyProduct.fromJson(item));
});
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
);
}
} }

@ -0,0 +1,38 @@
import 'package:diplomaticquarterapp/core/service/ancillary_orders_service.dart';
import 'package:diplomaticquarterapp/models/anicllary-orders/ancillary_order_list_model.dart';
import 'package:diplomaticquarterapp/models/anicllary-orders/ancillary_order_proc_model.dart';
import 'base_view_model.dart';
import '../../locator.dart';
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
class AnciallryOrdersViewModel extends BaseViewModel {
bool hasError = false;
AncillaryOrdersService _ancillaryService = locator<AncillaryOrdersService>();
List<AncillaryOrdersListModel> get ancillaryLists =>
_ancillaryService.ancillaryLists;
List<AncillaryOrdersListProcListModel> get ancillaryListsDetails =>
_ancillaryService.ancillaryProcLists;
Future getOrders() async {
hasError = false;
setState(ViewState.Busy);
await _ancillaryService.getOrders();
if (_ancillaryService.hasError) {
error = _ancillaryService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
}
Future getOrdersDetails(appointmentNo, orderNo) async {
hasError = false;
setState(ViewState.Busy);
await _ancillaryService.getOrdersDetails(appointmentNo, orderNo);
if (_ancillaryService.hasError) {
error = _ancillaryService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
}
}

@ -0,0 +1,76 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/er/ErPatientShareModel.dart';
import 'package:diplomaticquarterapp/core/model/er/TriageQuestionsModel.dart';
import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart';
import 'package:diplomaticquarterapp/core/service/er/EdOnlineServices.dart';
import 'package:diplomaticquarterapp/core/service/hospital_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
import '../../../locator.dart';
class EdOnlineViewModel extends BaseViewModel {
HospitalService _hospitalService = locator<HospitalService>();
EdOnlineServices _edOnlineServices = locator<EdOnlineServices>();
List<HospitalsModel> get hospitals => _hospitalService.hospitals;
List<TriageQuestionsModel> get triageQuestionsModelList =>
_edOnlineServices.triageQuestionsModelList;
ErPatientShareModel get erPatientShareModel => _edOnlineServices.erPatientShareModel;
Future getHospitals() async {
if(_hospitalService.hospitals.isEmpty){
setState(ViewState.Busy);
await _hospitalService.getHospitals();
if (_hospitalService.hasError) {
error = _hospitalService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
}
Future getQuestions() async {
if(_edOnlineServices.triageQuestionsModelList.isEmpty){
setState(ViewState.Busy);
await _edOnlineServices.getQuestions();
if (_edOnlineServices.hasError) {
error = _edOnlineServices.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
}
Future getPatientPaymentInformation({var id}) async {
setState(ViewState.Busy);
await _edOnlineServices.getPatientPaymentInformation();
if (_edOnlineServices.hasError) {
error = _edOnlineServices.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
Future saveQuestionsInformation(
{String notes,
String chiefComplaint,
int projectId,
DateTime selectedTime,
List<TriageQuestionsModel> selectedQuestions}) async {
setState(ViewState.BusyLocal);
await _edOnlineServices.saveQuestionsInformation(
notes: notes,
projectId: projectId,
chiefComplaint: chiefComplaint,
selectedTime: selectedTime,
selectedQuestions: selectedQuestions);
if (_edOnlineServices.hasError) {
error = _edOnlineServices.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
}
}

@ -5,8 +5,10 @@ import 'package:diplomaticquarterapp/core/model/pharmacies/LacumAccountInformati
import 'package:diplomaticquarterapp/core/model/pharmacies/ShippingOption.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/ShippingOption.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/ShoppingCart.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/ShoppingCart.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/ShoppingCartResponse.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/ShoppingCartResponse.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/order_detail.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/payment-checkout-data.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/payment-checkout-data.dart';
import 'package:diplomaticquarterapp/core/service/parmacyModule/order-preview-service.dart'; import 'package:diplomaticquarterapp/core/service/parmacyModule/order-preview-service.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart';
import '../../../locator.dart'; import '../../../locator.dart';
import '../base_view_model.dart'; import '../base_view_model.dart';
@ -17,6 +19,11 @@ class OrderPreviewViewModel extends BaseViewModel {
List<Addresses> get addresses => _orderService.addresses; List<Addresses> get addresses => _orderService.addresses;
LacumAccountInformation get lacumInformation => LacumAccountInformation get lacumInformation =>
_orderService.lacumInformation; _orderService.lacumInformation;
List<OrderDetailModel> get orderListModel => _orderService.orderList;
PharmacyModuleViewModel pharmacyModuleViewModel =
locator<PharmacyModuleViewModel>();
ShoppingCartResponse cartResponse = ShoppingCartResponse(); ShoppingCartResponse cartResponse = ShoppingCartResponse();
PaymentCheckoutData paymentCheckoutData = PaymentCheckoutData(); PaymentCheckoutData paymentCheckoutData = PaymentCheckoutData();
double totalAdditionalShippingCharge = 0; double totalAdditionalShippingCharge = 0;
@ -32,7 +39,7 @@ class OrderPreviewViewModel extends BaseViewModel {
} }
} }
getShoppingCart() async { Future getShoppingCart() async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _orderService.getShoppingCart().then((res) { await _orderService.getShoppingCart().then((res) {
_handleGetShoppingCartResponse(res); _handleGetShoppingCartResponse(res);
@ -48,20 +55,20 @@ class OrderPreviewViewModel extends BaseViewModel {
} }
} }
changeProductQuantity(ShoppingCart product) async { Future changeProductQuantity(ShoppingCart product) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _orderService.changeProductQuantity(product.id, product).then((res) { await _orderService.changeProductQuantity(product.id, product).then((res) {
_handleGetShoppingCartResponse(res); _handleGetShoppingCartResponse(res);
}); });
if (_orderService.hasError) { if (_orderService.hasError) {
error = _orderService.error; error = _orderService.error;
setState(ViewState.Error); setState(ViewState.ErrorLocal);
} else { } else {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
} }
deleteProduct(ShoppingCart product) async { Future deleteProduct(ShoppingCart product) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _orderService.deleteProduct(product.id).then((res) { await _orderService.deleteProduct(product.id).then((res) {
_handleGetShoppingCartResponse(res); _handleGetShoppingCartResponse(res);
@ -74,7 +81,7 @@ class OrderPreviewViewModel extends BaseViewModel {
} }
} }
deleteShoppingCart() async { Future deleteShoppingCart() async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _orderService.deleteShoppingCart().then((res) { await _orderService.deleteShoppingCart().then((res) {
_handleGetShoppingCartResponse(res); _handleGetShoppingCartResponse(res);
@ -182,6 +189,8 @@ class OrderPreviewViewModel extends BaseViewModel {
Future makeOrder() async { Future makeOrder() async {
setState(ViewState.Busy); setState(ViewState.Busy);
await pharmacyModuleViewModel.generatePharmacyToken();
await _orderService.makeOrder(paymentCheckoutData, cartResponse.shoppingCarts); await _orderService.makeOrder(paymentCheckoutData, cartResponse.shoppingCarts);
if (_orderService.hasError) { if (_orderService.hasError) {
error = _orderService.error; error = _orderService.error;

@ -110,15 +110,16 @@ class OrderModelViewModel extends BaseViewModel {
message: "Your review has been Submitted successfully"); message: "Your review has been Submitted successfully");
} }
} }
Future makeOrder() async { Future makeOrder() async {
setState(ViewState.Busy); /* setState(ViewState.Busy);
await _orderServices.makeOrder(paymentCheckoutData, cartResponse.shoppingCarts); await _orderServices.makeOrder(paymentCheckoutData, cartResponse.shoppingCarts);
if (_orderServices.hasError) { if (_orderServices.hasError) {
error = _orderServices.error; error = _orderServices.error;
setState(ViewState.Error); setState(ViewState.Error);
} else { } else {
setState(ViewState.Idle); setState(ViewState.Idle);
} }*/
} }
} }

@ -44,13 +44,15 @@ class PharmacyModuleViewModel extends BaseViewModel {
// List<PharmacyProduct> get pharmacyPrescriptionsList => PharmacyProduct.pharmacyPrescriptionsList ; // List<PharmacyProduct> get pharmacyPrescriptionsList => PharmacyProduct.pharmacyPrescriptionsList ;
Future getPharmacyHomeData() async { Future getPharmacyHomeData() async {
setState(ViewState.Busy); if(authenticatedUserObject.isLogin)
await generatePharmacyToken();
var data = await sharedPref.getObject(USER_PROFILE); var data = await sharedPref.getObject(USER_PROFILE);
var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID); var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID);
setState(ViewState.Busy);
if (authenticatedUserObject.isLogin && data != null && customerId == null) { if (authenticatedUserObject.isLogin && data != null && customerId == null) {
await _pharmacyService.makeVerifyCustomer(data); await _pharmacyService.makeVerifyCustomer(data);
// here must call getShoppingCard()
if (_pharmacyService.hasError) { if (_pharmacyService.hasError) {
error = _pharmacyService.error; error = _pharmacyService.error;
setState(ViewState.Error); setState(ViewState.Error);

@ -29,7 +29,7 @@ class PharmacyCategoriseViewModel extends BaseViewModel {
List<PharmacyProduct> get parentProducts => List<PharmacyProduct> get parentProducts =>
_pharmacyCategoriseService.parentProductsList; _pharmacyCategoriseService.parentProductsList;
List<SubCategoriesModel> get subCategorise => List<CategoriseParentModel> get subCategorise =>
_pharmacyCategoriseService.subCategoriseList; _pharmacyCategoriseService.subCategoriseList;
List<PharmacyProduct> get subProducts => List<PharmacyProduct> get subProducts =>
@ -37,7 +37,8 @@ class PharmacyCategoriseViewModel extends BaseViewModel {
List<PharmacyProduct> get finalProducts => List<PharmacyProduct> get finalProducts =>
_pharmacyCategoriseService.finalProducts; _pharmacyCategoriseService.finalProducts;
List<BrandsModel> get brandsList => _pharmacyCategoriseService.brandsList; List<CategoriseParentModel> get brandsList =>
_pharmacyCategoriseService.brandsList;
List<PharmacyProduct> get searchList => _pharmacyCategoriseService.searchList; List<PharmacyProduct> get searchList => _pharmacyCategoriseService.searchList;
@ -55,11 +56,11 @@ class PharmacyCategoriseViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future getBrands() async { Future getBrands({String id}) async {
hasError = false; hasError = false;
// _insuranceCardService.clearInsuranceCard(); // _insuranceCardService.clearInsuranceCard();
setState(ViewState.Busy); setState(ViewState.Busy);
await _pharmacyCategoriseService.getBrands(); await _pharmacyCategoriseService.getBrands(id: id);
if (_pharmacyCategoriseService.hasError) { if (_pharmacyCategoriseService.hasError) {
error = _pharmacyCategoriseService.error; error = _pharmacyCategoriseService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
@ -105,7 +106,7 @@ class PharmacyCategoriseViewModel extends BaseViewModel {
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
} else } else
await getParentProducts(i: i); await getParentProducts(i: i);
await getBrands(); await getBrands(id: i);
} }
Future getParentProducts({String i}) async { Future getParentProducts({String i}) async {
@ -156,6 +157,20 @@ class PharmacyCategoriseViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future getFilteredProducts(
{String categoryId, String brandId, String min, String max}) async {
hasError = false;
// _insuranceCardService.clearInsuranceCard();
setState(ViewState.Busy);
await _pharmacyCategoriseService.getFilteredProducts(
categoryId: categoryId, brandId: brandId, max: max, min: min);
if (_pharmacyCategoriseService.hasError) {
error = _pharmacyCategoriseService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
}
Future getManufacturerProducts(String id) async { Future getManufacturerProducts(String id) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _pharmacyCategoriseService.getManufacturerProducts(id); await _pharmacyCategoriseService.getManufacturerProducts(id);

@ -1,7 +1,9 @@
import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/H2O_service.dart'; import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/H2O_service.dart';
import 'package:diplomaticquarterapp/core/service/ancillary_orders_service.dart';
import 'package:diplomaticquarterapp/core/service/parmacyModule/prescription_service.dart'; import 'package:diplomaticquarterapp/core/service/parmacyModule/prescription_service.dart';
import 'package:diplomaticquarterapp/core/service/qr_service.dart'; import 'package:diplomaticquarterapp/core/service/qr_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/ancillary_orders_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/user_information_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/user_information_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart';
@ -38,6 +40,7 @@ import 'core/service/childvaccines/vaccination_table_service.dart';
import 'core/service/contactus/finadus_service.dart'; import 'core/service/contactus/finadus_service.dart';
import 'core/service/contactus/livechat_service.dart'; import 'core/service/contactus/livechat_service.dart';
import 'core/service/dashboard_service.dart'; import 'core/service/dashboard_service.dart';
import 'core/service/er/EdOnlineServices.dart';
import 'core/service/er/am_service.dart'; import 'core/service/er/am_service.dart';
import 'core/service/er/er_service.dart'; import 'core/service/er/er_service.dart';
import 'core/service/feedback/feedback_service.dart'; import 'core/service/feedback/feedback_service.dart';
@ -75,6 +78,7 @@ import 'core/service/parmacyModule/parmacy_module_service.dart';
import 'core/service/offers_service.dart'; import 'core/service/offers_service.dart';
import 'core/service/pharmacy_categorise_service.dart'; import 'core/service/pharmacy_categorise_service.dart';
import 'core/viewModels/AlHabibMedicalService/health-calculator/Bariatrics-viewmodel.dart'; import 'core/viewModels/AlHabibMedicalService/health-calculator/Bariatrics-viewmodel.dart';
import 'core/viewModels/er/EdOnlineViewModel.dart';
import 'core/viewModels/medical/PrescriptionDeliveryViewModel.dart'; import 'core/viewModels/medical/PrescriptionDeliveryViewModel.dart';
import 'core/viewModels/TermsConditionsViewModel.dart'; import 'core/viewModels/TermsConditionsViewModel.dart';
import 'core/viewModels/all_habib_medical_services/e_referral_view_model.dart'; import 'core/viewModels/all_habib_medical_services/e_referral_view_model.dart';
@ -192,6 +196,8 @@ void setupLocator() {
locator.registerLazySingleton(() => DeleteBabyService()); locator.registerLazySingleton(() => DeleteBabyService());
locator.registerLazySingleton(() => VaccinationTableService()); locator.registerLazySingleton(() => VaccinationTableService());
locator.registerLazySingleton(() => AncillaryOrdersService());
locator.registerLazySingleton(() => EdOnlineServices());
//pharmacy //pharmacy
// locator.registerLazySingleton(() => PharmacyCategoriseService()); // locator.registerLazySingleton(() => PharmacyCategoriseService());
@ -220,7 +226,6 @@ void setupLocator() {
locator.registerLazySingleton(() => PrescriptionService()); locator.registerLazySingleton(() => PrescriptionService());
locator.registerLazySingleton(() => RecommendedProductService()); locator.registerLazySingleton(() => RecommendedProductService());
locator.registerLazySingleton(() => PrivilegeService()); locator.registerLazySingleton(() => PrivilegeService());
locator.registerLazySingleton(() => WeatherService()); locator.registerLazySingleton(() => WeatherService());
locator.registerLazySingleton(() => TermsConditionsService()); locator.registerLazySingleton(() => TermsConditionsService());
@ -286,6 +291,7 @@ void setupLocator() {
locator.registerFactory(() => LacumViewModel()); locator.registerFactory(() => LacumViewModel());
locator.registerFactory(() => LacumTranferViewModel()); locator.registerFactory(() => LacumTranferViewModel());
locator.registerFactory(() => LacumRegistrationViewModel()); locator.registerFactory(() => LacumRegistrationViewModel());
locator.registerFactory(() => EdOnlineViewModel());
//pharmacy //pharmacy
locator.registerFactory(() => PharmacyCategoriseViewModel()); locator.registerFactory(() => PharmacyCategoriseViewModel());
@ -309,4 +315,5 @@ void setupLocator() {
locator.registerLazySingleton( locator.registerLazySingleton(
() => GeofencingServices()); // Geofencing Services () => GeofencingServices()); // Geofencing Services
locator.registerFactory(() => TermsConditionsViewModel()); locator.registerFactory(() => TermsConditionsViewModel());
locator.registerFactory(() => AnciallryOrdersViewModel());
} }

@ -0,0 +1,105 @@
class AncillaryOrdersListModel {
List<AncillaryOrderList> ancillaryOrderList;
Null errCode;
String message;
int patientID;
String patientName;
int patientType;
int projectID;
String projectName;
String setupID;
int statusCode;
AncillaryOrdersListModel(
{this.ancillaryOrderList,
this.errCode,
this.message,
this.patientID,
this.patientName,
this.patientType,
this.projectID,
this.projectName,
this.setupID,
this.statusCode});
AncillaryOrdersListModel.fromJson(Map<String, dynamic> json) {
if (json['AncillaryOrderList'] != null) {
ancillaryOrderList = new List<AncillaryOrderList>();
json['AncillaryOrderList'].forEach((v) {
ancillaryOrderList.add(new AncillaryOrderList.fromJson(v));
});
}
errCode = json['ErrCode'];
message = json['Message'];
patientID = json['PatientID'];
patientName = json['PatientName'];
patientType = json['PatientType'];
projectID = json['ProjectID'];
projectName = json['ProjectName'];
setupID = json['SetupID'];
statusCode = json['StatusCode'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.ancillaryOrderList != null) {
data['AncillaryOrderList'] =
this.ancillaryOrderList.map((v) => v.toJson()).toList();
}
data['ErrCode'] = this.errCode;
data['Message'] = this.message;
data['PatientID'] = this.patientID;
data['PatientName'] = this.patientName;
data['PatientType'] = this.patientType;
data['ProjectID'] = this.projectID;
data['ProjectName'] = this.projectName;
data['SetupID'] = this.setupID;
data['StatusCode'] = this.statusCode;
return data;
}
}
class AncillaryOrderList {
String appointmentDate;
int appointmentNo;
int clinicID;
String clinicName;
int doctorID;
String doctorName;
String orderDate;
int orderNo;
AncillaryOrderList(
{this.appointmentDate,
this.appointmentNo,
this.clinicID,
this.clinicName,
this.doctorID,
this.doctorName,
this.orderDate,
this.orderNo});
AncillaryOrderList.fromJson(Map<String, dynamic> json) {
appointmentDate = json['AppointmentDate'];
appointmentNo = json['AppointmentNo'];
clinicID = json['ClinicID'];
clinicName = json['ClinicName'];
doctorID = json['DoctorID'];
doctorName = json['DoctorName'];
orderDate = json['OrderDate'];
orderNo = json['OrderNo'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['AppointmentDate'] = this.appointmentDate;
data['AppointmentNo'] = this.appointmentNo;
data['ClinicID'] = this.clinicID;
data['ClinicName'] = this.clinicName;
data['DoctorID'] = this.doctorID;
data['DoctorName'] = this.doctorName;
data['OrderDate'] = this.orderDate;
data['OrderNo'] = this.orderNo;
return data;
}
}

@ -0,0 +1,249 @@
class AncillaryOrdersListProcListModel {
List<AncillaryOrderProcList> ancillaryOrderProcList;
String appointmentDate;
dynamic appointmentNo;
dynamic clinicID;
String clinicName;
dynamic companyID;
String companyName;
dynamic doctorID;
String doctorName;
Null errCode;
dynamic groupID;
String insurancePolicyNo;
String message;
String patientCardID;
dynamic patientID;
String patientName;
dynamic patientType;
dynamic policyID;
String policyName;
dynamic projectID;
String setupID;
dynamic statusCode;
dynamic subCategoryID;
String subPolicyNo;
AncillaryOrdersListProcListModel(
{this.ancillaryOrderProcList,
this.appointmentDate,
this.appointmentNo,
this.clinicID,
this.clinicName,
this.companyID,
this.companyName,
this.doctorID,
this.doctorName,
this.errCode,
this.groupID,
this.insurancePolicyNo,
this.message,
this.patientCardID,
this.patientID,
this.patientName,
this.patientType,
this.policyID,
this.policyName,
this.projectID,
this.setupID,
this.statusCode,
this.subCategoryID,
this.subPolicyNo});
AncillaryOrdersListProcListModel.fromJson(Map<String, dynamic> json) {
if (json['AncillaryOrderProcList'] != null) {
ancillaryOrderProcList = new List<AncillaryOrderProcList>();
json['AncillaryOrderProcList'].forEach((v) {
ancillaryOrderProcList.add(new AncillaryOrderProcList.fromJson(v));
});
}
appointmentDate = json['AppointmentDate'];
appointmentNo = json['AppointmentNo'];
clinicID = json['ClinicID'];
clinicName = json['ClinicName'];
companyID = json['CompanyID'];
companyName = json['CompanyName'];
doctorID = json['DoctorID'];
doctorName = json['DoctorName'];
errCode = json['ErrCode'];
groupID = json['GroupID'];
insurancePolicyNo = json['InsurancePolicyNo'];
message = json['Message'];
patientCardID = json['PatientCardID'];
patientID = json['PatientID'];
patientName = json['PatientName'];
patientType = json['PatientType'];
policyID = json['PolicyID'];
policyName = json['PolicyName'];
projectID = json['ProjectID'];
setupID = json['SetupID'];
statusCode = json['StatusCode'];
subCategoryID = json['SubCategoryID'];
subPolicyNo = json['SubPolicyNo'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.ancillaryOrderProcList != null) {
data['AncillaryOrderProcList'] =
this.ancillaryOrderProcList.map((v) => v.toJson()).toList();
}
data['AppointmentDate'] = this.appointmentDate;
data['AppointmentNo'] = this.appointmentNo;
data['ClinicID'] = this.clinicID;
data['ClinicName'] = this.clinicName;
data['CompanyID'] = this.companyID;
data['CompanyName'] = this.companyName;
data['DoctorID'] = this.doctorID;
data['DoctorName'] = this.doctorName;
data['ErrCode'] = this.errCode;
data['GroupID'] = this.groupID;
data['InsurancePolicyNo'] = this.insurancePolicyNo;
data['Message'] = this.message;
data['PatientCardID'] = this.patientCardID;
data['PatientID'] = this.patientID;
data['PatientName'] = this.patientName;
data['PatientType'] = this.patientType;
data['PolicyID'] = this.policyID;
data['PolicyName'] = this.policyName;
data['ProjectID'] = this.projectID;
data['SetupID'] = this.setupID;
data['StatusCode'] = this.statusCode;
data['SubCategoryID'] = this.subCategoryID;
data['SubPolicyNo'] = this.subPolicyNo;
return data;
}
}
class AncillaryOrderProcList {
dynamic approvalLineItemNo;
dynamic approvalNo;
String approvalStatus;
dynamic approvalStatusID;
dynamic companyShare;
dynamic companyShareWithTax;
dynamic companyTaxAmount;
dynamic discountAmount;
dynamic discountCategory;
String discountType;
dynamic discountTypeValue;
bool isApprovalCreated;
bool isApprovalRequired;
bool isCovered;
String orderDate;
dynamic orderLineItemNo;
dynamic orderNo;
dynamic partnerID;
dynamic partnerShare;
String partnerShareType;
dynamic patientShare;
dynamic patientShareWithTax;
dynamic patientTaxAmount;
dynamic procPrice;
dynamic procedureCategoryID;
String procedureCategoryName;
String procedureID;
String procedureName;
dynamic taxAmount;
dynamic taxPct;
AncillaryOrderProcList(
{this.approvalLineItemNo,
this.approvalNo,
this.approvalStatus,
this.approvalStatusID,
this.companyShare,
this.companyShareWithTax,
this.companyTaxAmount,
this.discountAmount,
this.discountCategory,
this.discountType,
this.discountTypeValue,
this.isApprovalCreated,
this.isApprovalRequired,
this.isCovered,
this.orderDate,
this.orderLineItemNo,
this.orderNo,
this.partnerID,
this.partnerShare,
this.partnerShareType,
this.patientShare,
this.patientShareWithTax,
this.patientTaxAmount,
this.procPrice,
this.procedureCategoryID,
this.procedureCategoryName,
this.procedureID,
this.procedureName,
this.taxAmount,
this.taxPct});
AncillaryOrderProcList.fromJson(Map<String, dynamic> json) {
approvalLineItemNo = json['ApprovalLineItemNo'];
approvalNo = json['ApprovalNo'];
approvalStatus = json['ApprovalStatus'];
approvalStatusID = json['ApprovalStatusID'];
companyShare = json['CompanyShare'];
companyShareWithTax = json['CompanyShareWithTax'];
companyTaxAmount = json['CompanyTaxAmount'];
discountAmount = json['DiscountAmount'];
discountCategory = json['DiscountCategory'];
discountType = json['DiscountType'];
discountTypeValue = json['DiscountTypeValue'];
isApprovalCreated = json['IsApprovalCreated'];
isApprovalRequired = json['IsApprovalRequired'];
isCovered = json['IsCovered'];
orderDate = json['OrderDate'];
orderLineItemNo = json['OrderLineItemNo'];
orderNo = json['OrderNo'];
partnerID = json['PartnerID'];
partnerShare = json['PartnerShare'];
partnerShareType = json['PartnerShareType'];
patientShare = json['PatientShare'];
patientShareWithTax = json['PatientShareWithTax'];
patientTaxAmount = json['PatientTaxAmount'];
procPrice = json['ProcPrice'];
procedureCategoryID = json['ProcedureCategoryID'];
procedureCategoryName = json['ProcedureCategoryName'];
procedureID = json['ProcedureID'];
procedureName = json['ProcedureName'];
taxAmount = json['TaxAmount'];
taxPct = json['TaxPct'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['ApprovalLineItemNo'] = this.approvalLineItemNo;
data['ApprovalNo'] = this.approvalNo;
data['ApprovalStatus'] = this.approvalStatus;
data['ApprovalStatusID'] = this.approvalStatusID;
data['CompanyShare'] = this.companyShare;
data['CompanyShareWithTax'] = this.companyShareWithTax;
data['CompanyTaxAmount'] = this.companyTaxAmount;
data['DiscountAmount'] = this.discountAmount;
data['DiscountCategory'] = this.discountCategory;
data['DiscountType'] = this.discountType;
data['DiscountTypeValue'] = this.discountTypeValue;
data['IsApprovalCreated'] = this.isApprovalCreated;
data['IsApprovalRequired'] = this.isApprovalRequired;
data['IsCovered'] = this.isCovered;
data['OrderDate'] = this.orderDate;
data['OrderLineItemNo'] = this.orderLineItemNo;
data['OrderNo'] = this.orderNo;
data['PartnerID'] = this.partnerID;
data['PartnerShare'] = this.partnerShare;
data['PartnerShareType'] = this.partnerShareType;
data['PatientShare'] = this.patientShare;
data['PatientShareWithTax'] = this.patientShareWithTax;
data['PatientTaxAmount'] = this.patientTaxAmount;
data['ProcPrice'] = this.procPrice;
data['ProcedureCategoryID'] = this.procedureCategoryID;
data['ProcedureCategoryName'] = this.procedureCategoryName;
data['ProcedureID'] = this.procedureID;
data['ProcedureName'] = this.procedureName;
data['TaxAmount'] = this.taxAmount;
data['TaxPct'] = this.taxPct;
return data;
}
}

@ -22,127 +22,135 @@ class CMCLocationPage extends StatefulWidget {
final double longitude; final double longitude;
final dynamic model; final dynamic model;
const CMCLocationPage({Key key, this.onPick, this.latitude, this.longitude, this.model}) const CMCLocationPage(
{Key key, this.onPick, this.latitude, this.longitude, this.model})
: super(key: key); : super(key: key);
@override @override
_CMCLocationPageState createState() => _CMCLocationPageState createState() => _CMCLocationPageState();
_CMCLocationPageState();
} }
class _CMCLocationPageState class _CMCLocationPageState extends State<CMCLocationPage> {
extends State<CMCLocationPage> {
double latitude = 0; double latitude = 0;
double longitude = 0; double longitude = 0;
@override @override
void initState() { void initState() {
latitude = widget.latitude; latitude = widget.latitude;
longitude = widget.longitude; longitude = widget.longitude;
super.initState(); super.initState();
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<CMCViewModel>( return BaseView<CMCViewModel>(
onModelReady: (model) {}, onModelReady: (model) {},
builder: (_, model, widget) => AppScaffold( builder: (_, model, widget) => AppScaffold(
isShowDecPage: false, isShowDecPage: false,
isShowAppBar: true, isShowAppBar: true,
baseViewModel: model, baseViewModel: model,
body: PlacePicker( body: PlacePicker(
apiKey: GOOGLE_API_KEY, apiKey: GOOGLE_API_KEY,
enableMyLocationButton: true, enableMyLocationButton: true,
automaticallyImplyAppBarLeading: false, automaticallyImplyAppBarLeading: false,
autocompleteOnTrailingWhitespace: true, autocompleteOnTrailingWhitespace: true,
selectInitialPosition: true, selectInitialPosition: true,
autocompleteLanguage: projectViewModel.currentLanguage, autocompleteLanguage: projectViewModel.currentLanguage,
enableMapTypeButton: true, enableMapTypeButton: true,
searchForInitialValue: false, searchForInitialValue: false,
onPlacePicked: (PickResult result) { onPlacePicked: (PickResult result) {
print(result.adrAddress); print(result.adrAddress);
},
}, selectedPlaceWidgetBuilder:
selectedPlaceWidgetBuilder: (_, selectedPlace, state, isSearchBarFocused) {
(_, selectedPlace, state, isSearchBarFocused) { print(
print("state: $state, isSearchBarFocused: $isSearchBarFocused"); "state: $state, isSearchBarFocused: $isSearchBarFocused");
return isSearchBarFocused return isSearchBarFocused
? Container() ? Container()
: FloatingCard( : FloatingCard(
bottomPosition: 0.0, bottomPosition: 0.0,
leftPosition: 0.0, leftPosition: 0.0,
rightPosition: 0.0, rightPosition: 0.0,
width: 500, width: 500,
borderRadius: BorderRadius.circular(12.0), borderRadius: BorderRadius.circular(12.0),
child: state == SearchingState.Searching child: state == SearchingState.Searching
? Center(child: CircularProgressIndicator()) ? Center(child: CircularProgressIndicator())
: Container( : Container(
margin: EdgeInsets.all(12), margin: EdgeInsets.all(12),
child: Column( child: Column(
children: [ children: [
SecondaryButton( SecondaryButton(
color: Colors.grey[800], color: Colors.grey[800],
textColor: Colors.white, textColor: Colors.white,
onTap: () async { onTap: () async {
print(selectedPlace); print(selectedPlace);
AddNewAddressRequestModel AddNewAddressRequestModel
addNewAddressRequestModel = addNewAddressRequestModel =
new AddNewAddressRequestModel( new AddNewAddressRequestModel(
customer: Customer(addresses: [ customer: Customer(addresses: [
Addresses( Addresses(
address1: address1: selectedPlace
selectedPlace.formattedAddress, .formattedAddress,
address2: selectedPlace address2: selectedPlace
.formattedAddress, .formattedAddress,
customerAttributes: "", customerAttributes: "",
city: "", city: "",
createdOnUtc: "", createdOnUtc: "",
id: 0, id: 0,
latLong: "$latitude,$longitude", latLong:
email: "") "$latitude,$longitude",
]), email: "")
); ]),
);
selectedPlace.addressComponents.forEach((e) { selectedPlace.addressComponents
if (e.types.contains("country")) { .forEach((e) {
addNewAddressRequestModel.customer if (e.types.contains("country")) {
.addresses[0].country = e.longName; addNewAddressRequestModel
} .customer
if (e.types.contains("postal_code")) { .addresses[0]
addNewAddressRequestModel.customer .country = e.longName;
.addresses[0].zipPostalCode = }
e.longName; if (e.types
} .contains("postal_code")) {
if (e.types.contains("locality")) { addNewAddressRequestModel
addNewAddressRequestModel.customer .customer
.addresses[0].city = .addresses[0]
e.longName; .zipPostalCode = e.longName;
} }
}); if (e.types.contains("locality")) {
addNewAddressRequestModel
.customer
.addresses[0]
.city = e.longName;
}
});
await model.addAddressInfo( await model.addAddressInfo(
addNewAddressRequestModel: addNewAddressRequestModel); addNewAddressRequestModel:
if (model.state == ViewState.ErrorLocal) { addNewAddressRequestModel);
Utils.showErrorToast(model.error); if (model.state ==
} else { ViewState.ErrorLocal) {
AppToast.showSuccessToast( Utils.showErrorToast(model.error);
message: "Address Added Successfully"); } else {
} AppToast.showSuccessToast(
Navigator.of(context).pop(); message:
}, "Address Added Successfully");
label: TranslationBase.of(context).addNewAddress, }
), Navigator.of(context).pop();
], },
), label: TranslationBase.of(context)
), .addNewAddress,
); ),
}, ],
initialPosition: LatLng(latitude, longitude), ),
useCurrentLocation: false, ),
), );
)); },
initialPosition: LatLng(latitude, longitude),
useCurrentLocation: false,
),
));
} }
} }

@ -26,12 +26,10 @@ class NewCMCPage extends StatefulWidget {
final CMCViewModel model; final CMCViewModel model;
@override @override
_NewCMCPageState createState() => _NewCMCPageState createState() => _NewCMCPageState();
_NewCMCPageState();
} }
class _NewCMCPageState extends State<NewCMCPage> class _NewCMCPageState extends State<NewCMCPage> with TickerProviderStateMixin {
with TickerProviderStateMixin {
PageController _controller; PageController _controller;
int _currentIndex = 1; int _currentIndex = 1;
@ -49,7 +47,8 @@ class _NewCMCPageState extends State<NewCMCPage>
price: widget.model.cmcAllServicesList[0].price, price: widget.model.cmcAllServicesList[0].price,
serviceID: widget.model.cmcAllServicesList[0].serviceID.toString(), serviceID: widget.model.cmcAllServicesList[0].serviceID.toString(),
selectedServiceName: widget.model.cmcAllServicesList[0].description, selectedServiceName: widget.model.cmcAllServicesList[0].description,
selectedServiceNameAR: widget.model.cmcAllServicesList[0].descriptionN, selectedServiceNameAR:
widget.model.cmcAllServicesList[0].descriptionN,
recordID: 1, recordID: 1,
totalPrice: widget.model.cmcAllServicesList[0].totalPrice, totalPrice: widget.model.cmcAllServicesList[0].totalPrice,
vAT: widget.model.cmcAllServicesList[0].vAT); vAT: widget.model.cmcAllServicesList[0].vAT);
@ -98,20 +97,24 @@ class _NewCMCPageState extends State<NewCMCPage>
model: model, model: model,
onTap: () async { onTap: () async {
UpdatePresOrderRequestModel updatePresOrderRequestModel = UpdatePresOrderRequestModel updatePresOrderRequestModel =
UpdatePresOrderRequestModel( UpdatePresOrderRequestModel(
presOrderID: order.presOrderID, presOrderID: order.presOrderID,
rejectionReason: "", rejectionReason: "",
presOrderStatus: 4, editedBy: 3); presOrderStatus: 4,
editedBy: 3);
await model.updateCmcPresOrder(updatePresOrderRequestModel); await model.updateCmcPresOrder(updatePresOrderRequestModel);
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
Utils.showErrorToast(model.error); Utils.showErrorToast(model.error);
} else { } else {
AppToast.showSuccessToast(message:TranslationBase.of(context).processDoneSuccessfully ); AppToast.showSuccessToast(
message:
TranslationBase.of(context).processDoneSuccessfully);
await model.getCmcAllPresOrders(); await model.getCmcAllPresOrders();
} }
}, },
)); ));
} }
return Scaffold( return Scaffold(
body: SafeArea( body: SafeArea(
child: SingleChildScrollView( child: SingleChildScrollView(
@ -142,212 +145,255 @@ class _NewCMCPageState extends State<NewCMCPage>
children: <Widget>[ children: <Widget>[
widget.model.cmcAllOrderDetail.length != 0 widget.model.cmcAllOrderDetail.length != 0
? FractionallySizedBox( ? FractionallySizedBox(
widthFactor: 0.9, widthFactor: 0.9,
child: SingleChildScrollView( child: SingleChildScrollView(
child: Column(
children: [
Container(
width: double.infinity,
margin: EdgeInsets.only(top: 15),
decoration: BoxDecoration(
border:
Border.all(color: Colors.grey, width: 1),
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
SizedBox(
height: 12,
),
Container( Container(
width: double.infinity, width: double.infinity,
padding: EdgeInsets.only( margin: EdgeInsets.only(top: 15),
left: 15, bottom: 15, top: 15,right: 15),
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border( border: Border.all(
bottom: BorderSide( color: Colors.grey, width: 1),
color: Colors.grey, borderRadius:
width: 1.0, BorderRadius.circular(12),
), color:
), Theme.of(context).primaryColor),
// borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
Texts(
TranslationBase
.of(context)
.requestID,
bold: false,
fontSize: 13,
),
SizedBox( SizedBox(
height: 4, height: 12,
), ),
Texts( Container(
widget.model.cmcAllOrderDetail[0].iD.toString(), width: double.infinity,
fontSize: 22, padding: EdgeInsets.only(
), left: 15,
], bottom: 15,
), top: 15,
), right: 15),
Container( decoration: BoxDecoration(
width: double.infinity, border: Border(
padding: EdgeInsets.only( bottom: BorderSide(
left: 15, bottom: 15, top: 15,right: 15), color: Colors.grey,
decoration: BoxDecoration( width: 1.0,
border: Border( ),
bottom: BorderSide( ),
color: Colors.grey, // borderRadius: BorderRadius.circular(12),
width: 1.0, color: Theme.of(context)
.primaryColor),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Texts(
TranslationBase.of(context)
.requestID,
bold: false,
fontSize: 13,
),
SizedBox(
height: 4,
),
Texts(
widget.model
.cmcAllOrderDetail[0].iD
.toString(),
fontSize: 22,
),
],
), ),
), ),
// borderRadius: BorderRadius.circular(12), Container(
color: Colors.white), width: double.infinity,
child: Column( padding: EdgeInsets.only(
crossAxisAlignment: CrossAxisAlignment.start, left: 15,
children: [ bottom: 15,
Texts( top: 15,
TranslationBase right: 15),
.of(context) decoration: BoxDecoration(
.OrderStatus, border: Border(
bold: false, bottom: BorderSide(
fontSize: 13, color: Colors.grey,
), width: 1.0,
SizedBox( ),
height: 4, ),
), // borderRadius: BorderRadius.circular(12),
Texts( color: Theme.of(context)
.primaryColor),
projectViewModel.isArabic ? widget.model.cmcAllOrderDetail[0] child: Column(
.descriptionN : widget.model.cmcAllOrderDetail[0].description, crossAxisAlignment:
fontSize: 22, CrossAxisAlignment.start,
children: [
Texts(
TranslationBase.of(context)
.OrderStatus,
bold: false,
fontSize: 13,
),
SizedBox(
height: 4,
),
Texts(
projectViewModel.isArabic
? widget
.model
.cmcAllOrderDetail[0]
.descriptionN
: widget
.model
.cmcAllOrderDetail[0]
.description,
fontSize: 22,
),
],
),
), ),
], Container(
), width: double.infinity,
), padding: EdgeInsets.only(
Container( left: 15,
width: double.infinity, bottom: 15,
padding: EdgeInsets.only( top: 15,
left: 15, bottom: 15, top: 15,right: 15), right: 15),
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border( border: Border(
bottom: BorderSide( bottom: BorderSide(
color: Colors.grey, color: Colors.grey,
width: 1.0, width: 1.0,
),
),
// borderRadius: BorderRadius.circular(12),
color: Theme.of(context)
.primaryColor),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Texts(
TranslationBase.of(context)
.pickupDate,
bold: false,
fontSize: 13,
),
SizedBox(
height: 4,
),
Texts(
DateUtil.getDayMonthYearDateFormatted(
DateUtil.convertStringToDate(
widget
.model
.cmcAllOrderDetail[
0]
.createdOn)),
fontSize: 22,
),
],
), ),
), ),
// borderRadius: BorderRadius.circular(12), Container(
color: Colors.white), width: double.infinity,
child: Column( padding: EdgeInsets.only(
crossAxisAlignment: CrossAxisAlignment.start, left: 15, bottom: 15, top: 15),
children: [ decoration: BoxDecoration(
Texts( border: Border(
TranslationBase.of(context).pickupDate, bottom: BorderSide(
bold: false, color: Colors.grey,
fontSize: 13, width: 1.0,
),
),
// borderRadius: BorderRadius.circular(12),
color: Theme.of(context)
.primaryColor),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Texts(
TranslationBase.of(context)
.serviceName,
bold: false,
fontSize: 13,
),
SizedBox(
height: 4,
),
Texts(
!projectViewModel.isArabic
? widget
.model
.cmcAllOrderDetail[0]
.description
.toString()
: widget
.model
.cmcAllOrderDetail[0]
.descriptionN
.toString(),
fontSize: 22,
),
],
),
), ),
SizedBox( SizedBox(
height: 4, height: 12,
), ),
Texts( Center(
DateUtil.getDayMonthYearDateFormatted( child: Container(
DateUtil.convertStringToDate(widget.model.cmcAllOrderDetail[0].createdOn)), width: MediaQuery.of(context)
fontSize: 22, .size
), .width *
], 0.85,
), child: SecondaryButton(
), label: TranslationBase.of(
Container( context)
width: double.infinity, .cancel
padding: EdgeInsets.only( .toUpperCase(),
left: 15, bottom: 15, top: 15), onTap: () {
decoration: BoxDecoration( showConfirmMessage(
border: Border( widget.model,
bottom: BorderSide( widget.model
color: Colors.grey, .cmcAllOrderDetail[0]);
width: 1.0, },
color: Colors.red[800],
disabled: false,
textColor: Theme.of(context)
.backgroundColor),
), ),
), ),
// borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Texts(
TranslationBase.of(context).serviceName,
bold: false,
fontSize: 13,
),
SizedBox( SizedBox(
height: 4, height: 22,
),
Texts(
!projectViewModel.isArabic?widget.model.cmcAllOrderDetail[0].description
.toString() :
widget.model.cmcAllOrderDetail[0]
.descriptionN
.toString(),
fontSize: 22,
), ),
], ],
), ),
), ),
SizedBox(
height: 12,
),
Center(
child: Container(
width: MediaQuery
.of(context)
.size
.width *
0.85,
child: SecondaryButton(
label: TranslationBase.of(context).cancel.toUpperCase(),
onTap: () {
showConfirmMessage(widget.model,
widget.model.cmcAllOrderDetail[0]);
}
,
color: Colors.red[800],
disabled: false,
textColor: Theme
.of(context)
.backgroundColor),
),
),
SizedBox( SizedBox(
height: 22, height: 22,
), ),
], ],
), ),
), ),
SizedBox( )
height: 22,
),
],
),
),
)
: NewCMCStepOnePage( : NewCMCStepOnePage(
changePageViewIndex: changePageViewIndex, changePageViewIndex: changePageViewIndex,
cMCInsertPresOrderRequestModel: cMCInsertPresOrderRequestModel:
cMCInsertPresOrderRequestModel, cMCInsertPresOrderRequestModel,
model: widget.model, model: widget.model,
), ),
NewCMCStepTowPage( NewCMCStepTowPage(
longitude: _longitude, longitude: _longitude,
latitude: _latitude, latitude: _latitude,
changePageViewIndex: changePageViewIndex, changePageViewIndex: changePageViewIndex,
cmcInsertPresOrderRequestModel: cMCInsertPresOrderRequestModel, cmcInsertPresOrderRequestModel:
cMCInsertPresOrderRequestModel,
model: widget.model, model: widget.model,
), NewCMCStepThreePage( ),
NewCMCStepThreePage(
changePageViewIndex: changePageViewIndex, changePageViewIndex: changePageViewIndex,
cmcInsertPresOrderRequestModel: cMCInsertPresOrderRequestModel, cmcInsertPresOrderRequestModel:
cMCInsertPresOrderRequestModel,
model: widget.model, model: widget.model,
), ),
], ],

@ -62,14 +62,14 @@ class _NewCMCStepOnePageState extends State<NewCMCStepOnePage> {
), ),
Column( Column(
children: children:
widget.model.cmcAllServicesList.map((service) { widget.model.cmcAllServicesList.map((service) {
return Container( return Container(
margin: EdgeInsets.only(top: 15), margin: EdgeInsets.only(top: 15),
decoration: BoxDecoration( decoration: BoxDecoration(
border: border:
Border.all(color: Colors.grey, width: 1), Border.all(color: Colors.grey, width: 1),
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(12),
color: Colors.white), color: Theme.of(context).primaryColor),
child: Column( child: Column(
children: [ children: [
Row( Row(
@ -79,53 +79,52 @@ class _NewCMCStepOnePageState extends State<NewCMCStepOnePage> {
activeColor: Colors.red[800], activeColor: Colors.red[800],
onChanged: (newValue) async { onChanged: (newValue) async {
PatientERCMCInsertServicesList PatientERCMCInsertServicesList
patientERCMCInsertServicesList = patientERCMCInsertServicesList =
new PatientERCMCInsertServicesList( new PatientERCMCInsertServicesList(
price: service.price, price: service.price,
serviceID: service.serviceID serviceID: service.serviceID
.toString(), .toString(),
selectedServiceName: selectedServiceName:
service.description, service.description,
selectedServiceNameAR: selectedServiceNameAR:
service.descriptionN, service.descriptionN,
recordID: 1, recordID: 1,
totalPrice: totalPrice:
service.totalPrice, service.totalPrice,
vAT: service.vAT); vAT: service.vAT);
setState(() { setState(() {
widget widget
.cMCInsertPresOrderRequestModel .cMCInsertPresOrderRequestModel
.patientERCMCInsertServicesList = .patientERCMCInsertServicesList = [
[
patientERCMCInsertServicesList patientERCMCInsertServicesList
]; ];
}); });
CMCGetItemsRequestModel CMCGetItemsRequestModel
cMCGetItemsRequestModel = cMCGetItemsRequestModel =
new CMCGetItemsRequestModel( new CMCGetItemsRequestModel(
checkupType: newValue); checkupType: newValue);
await widget.model.getCheckupItems( await widget.model.getCheckupItems(
cMCGetItemsRequestModel: cMCGetItemsRequestModel:
cMCGetItemsRequestModel); cMCGetItemsRequestModel);
}, },
groupValue: widget groupValue: widget
.cMCInsertPresOrderRequestModel .cMCInsertPresOrderRequestModel
.patientERCMCInsertServicesList .patientERCMCInsertServicesList
.length > .length >
0 0
? int.parse(widget ? int.parse(widget
.cMCInsertPresOrderRequestModel .cMCInsertPresOrderRequestModel
.patientERCMCInsertServicesList[ .patientERCMCInsertServicesList[
0] 0]
.serviceID) .serviceID)
: 1), : 1),
Expanded( Expanded(
child: Padding( child: Padding(
padding: const EdgeInsets.all(20.0), padding: const EdgeInsets.all(20.0),
child: Texts( child: Texts(
projectViewModel.isArabic ? service projectViewModel.isArabic
.descriptionN : service ? service.descriptionN
.description, : service.description,
fontSize: 15, fontSize: 15,
), ),
), ),
@ -144,14 +143,18 @@ class _NewCMCStepOnePageState extends State<NewCMCStepOnePage> {
height: 30, height: 30,
), ),
Container( Container(
color: Colors.white, color: Theme.of(context).primaryColor,
width: double.infinity, width: double.infinity,
child: Column( child: Column(
children: [ children: [
Row( Row(
children: [ children: [
Container(margin: EdgeInsets.only( Container(
right: 10, left: 10), child: Texts(TranslationBase.of(context).coveredService, fontWeight: FontWeight.bold,)) margin: EdgeInsets.only(right: 10, left: 10),
child: Texts(
TranslationBase.of(context).coveredService,
fontWeight: FontWeight.bold,
))
], ],
), ),
Column( Column(
@ -163,10 +166,10 @@ class _NewCMCStepOnePageState extends State<NewCMCStepOnePage> {
child: Container( child: Container(
margin: EdgeInsets.only(top: 15), margin: EdgeInsets.only(top: 15),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white), color: Theme.of(context).primaryColor),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment crossAxisAlignment:
.start, CrossAxisAlignment.start,
children: [ children: [
SizedBox( SizedBox(
height: 12, height: 12,
@ -182,17 +185,18 @@ class _NewCMCStepOnePageState extends State<NewCMCStepOnePage> {
width: 0.5, width: 0.5,
color: Colors.grey)), color: Colors.grey)),
//borderRadius: , //borderRadius: ,
color: Colors.white), color:
Theme.of(context).primaryColor),
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: [ children: [
Container(margin: EdgeInsets.only( Container(
right: 10, left: 10), margin: EdgeInsets.only(
child: Texts( right: 10, left: 10),
item.itemName, child: Texts(item.itemName,
fontSize: 15, fontWeight: FontWeight.bold fontSize: 15,
), fontWeight: FontWeight.bold),
), ),
], ],
), ),
@ -222,37 +226,34 @@ class _NewCMCStepOnePageState extends State<NewCMCStepOnePage> {
Container( Container(
width: MediaQuery.of(context).size.width * 0.9, width: MediaQuery.of(context).size.width * 0.9,
child: SecondaryButton( child: SecondaryButton(
label: TranslationBase label: TranslationBase.of(context).next,
.of(context) textColor: Theme.of(context).backgroundColor,
.next,
textColor: Theme
.of(context)
.backgroundColor,
color: Colors.grey[800], color: Colors.grey[800],
onTap: () async { onTap: () async {
if (widget.cMCInsertPresOrderRequestModel if (widget.cMCInsertPresOrderRequestModel
.patientERCMCInsertServicesList.length != .patientERCMCInsertServicesList.length !=
0 || 0 ||
widget.cMCInsertPresOrderRequestModel widget.cMCInsertPresOrderRequestModel
.patientERCMCInsertServicesList == .patientERCMCInsertServicesList ==
null) { null) {
int index = widget.model.cmcAllServicesList.length; int index = widget.model.cmcAllServicesList.length;
PatientERCMCInsertServicesList PatientERCMCInsertServicesList
patientERCMCInsertServicesList = patientERCMCInsertServicesList =
new PatientERCMCInsertServicesList( new PatientERCMCInsertServicesList(
price: widget price: widget
.model.cmcAllServicesList[index - 1].price, .model.cmcAllServicesList[index - 1].price,
serviceID: widget serviceID: widget
.model.cmcAllServicesList[index - 1].serviceID .model.cmcAllServicesList[index - 1].serviceID
.toString(), .toString(),
selectedServiceName: widget.model selectedServiceName: widget.model
.cmcAllServicesList[index - 1].description, .cmcAllServicesList[index - 1].description,
selectedServiceNameAR: widget.model selectedServiceNameAR: widget.model
.cmcAllServicesList[index - 1].descriptionN, .cmcAllServicesList[index - 1].descriptionN,
recordID: 1, recordID: 1,
totalPrice: widget totalPrice: widget
.model.cmcAllServicesList[index - 1].totalPrice, .model.cmcAllServicesList[index - 1].totalPrice,
vAT: widget.model.cmcAllServicesList[index - 1].vAT); vAT:
widget.model.cmcAllServicesList[index - 1].vAT);
widget.cMCInsertPresOrderRequestModel widget.cMCInsertPresOrderRequestModel
.patientERCMCInsertServicesList = [ .patientERCMCInsertServicesList = [

@ -22,15 +22,13 @@ class NewCMCStepThreePage extends StatefulWidget {
{Key key, {Key key,
this.changePageViewIndex, this.changePageViewIndex,
this.model, this.model,
this.cmcInsertPresOrderRequestModel}); this.cmcInsertPresOrderRequestModel});
@override @override
_NewCMCStepThreePageState createState() => _NewCMCStepThreePageState createState() => _NewCMCStepThreePageState();
_NewCMCStepThreePageState();
} }
class _NewCMCStepThreePageState class _NewCMCStepThreePageState extends State<NewCMCStepThreePage> {
extends State<NewCMCStepThreePage> {
Completer<GoogleMapController> _controller = Completer(); Completer<GoogleMapController> _controller = Completer();
static CameraPosition _kGooglePlex = CameraPosition( static CameraPosition _kGooglePlex = CameraPosition(
@ -49,8 +47,7 @@ class _NewCMCStepThreePageState
widget.cmcInsertPresOrderRequestModel.latitude.hashCode widget.cmcInsertPresOrderRequestModel.latitude.hashCode
.toString(), .toString(),
), ),
position: LatLng( position: LatLng(widget.cmcInsertPresOrderRequestModel.latitude,
widget.cmcInsertPresOrderRequestModel.latitude,
widget.cmcInsertPresOrderRequestModel.longitude)), widget.cmcInsertPresOrderRequestModel.longitude)),
); );
_kGooglePlex = CameraPosition( _kGooglePlex = CameraPosition(
@ -86,15 +83,16 @@ class _NewCMCStepThreePageState
), ),
Container( Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.circular(12)), borderRadius: BorderRadius.circular(12)),
padding: EdgeInsets.all(8), padding: EdgeInsets.all(8),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Texts(TranslationBase Texts(
.of(context) TranslationBase.of(context).orderLocation + " : ",
.orderLocation + " : ", fontWeight: FontWeight.bold,), fontWeight: FontWeight.bold,
),
SizedBox( SizedBox(
height: 12, height: 12,
), ),
@ -115,40 +113,38 @@ class _NewCMCStepThreePageState
SizedBox( SizedBox(
height: 12, height: 12,
), ),
Texts(TranslationBase Texts(TranslationBase.of(context).selectedService),
.of(context)
.selectedService),
...List.generate( ...List.generate(
widget.cmcInsertPresOrderRequestModel widget.cmcInsertPresOrderRequestModel
.patientERCMCInsertServicesList.length, .patientERCMCInsertServicesList.length,
(index) => (index) => Container(
Container( child: Column(
child: Column( crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, children: [
children: [ Texts(
Texts( TranslationBase.of(context).serviceName,
TranslationBase fontSize: 12,
.of(context) fontWeight: FontWeight.bold,
.serviceName, ),
fontSize: 12, fontWeight: FontWeight.bold, SizedBox(
), height: 5,
SizedBox( ),
height: 5, Texts(
), projectViewModel.isArabic
Texts( ? widget
projectViewModel.isArabic ? widget
.cmcInsertPresOrderRequestModel .cmcInsertPresOrderRequestModel
.patientERCMCInsertServicesList[index] .patientERCMCInsertServicesList[index]
.selectedServiceNameAR : widget .selectedServiceNameAR
: widget
.cmcInsertPresOrderRequestModel .cmcInsertPresOrderRequestModel
.patientERCMCInsertServicesList[index] .patientERCMCInsertServicesList[index]
.selectedServiceName, .selectedServiceName,
fontSize: 15, fontSize: 15,
bold: true, bold: true,
),
],
), ),
), ],
),
),
) )
], ],
), ),
@ -165,9 +161,7 @@ class _NewCMCStepThreePageState
Container( Container(
width: MediaQuery.of(context).size.width * 0.9, width: MediaQuery.of(context).size.width * 0.9,
child: SecondaryButton( child: SecondaryButton(
label: TranslationBase label: TranslationBase.of(context).confirm,
.of(context)
.confirm,
color: Colors.grey[800], color: Colors.grey[800],
onTap: () async { onTap: () async {
await widget.model.insertPresPresOrder( await widget.model.insertPresPresOrder(
@ -176,9 +170,7 @@ class _NewCMCStepThreePageState
widget.changePageViewIndex(0); widget.changePageViewIndex(0);
} }
}, },
textColor: Theme textColor: Theme.of(context).backgroundColor),
.of(context)
.backgroundColor),
), ),
], ],
), ),

@ -37,17 +37,14 @@ class NewCMCStepTowPage extends StatefulWidget {
: super(key: key); : super(key: key);
@override @override
_NewCMCStepTowPageState createState() => _NewCMCStepTowPageState createState() => _NewCMCStepTowPageState();
_NewCMCStepTowPageState();
} }
class _NewCMCStepTowPageState class _NewCMCStepTowPageState extends State<NewCMCStepTowPage> {
extends State<NewCMCStepTowPage> {
double latitude = 0; double latitude = 0;
double longitude = 0; double longitude = 0;
AddressInfo _selectedAddress; AddressInfo _selectedAddress;
@override @override
void initState() { void initState() {
if (widget.cmcInsertPresOrderRequestModel.latitude == null) { if (widget.cmcInsertPresOrderRequestModel.latitude == null) {
@ -61,17 +58,18 @@ class _NewCMCStepTowPageState
setLatitudeAndLongitude({bool isSetState = false, String latLong}) { setLatitudeAndLongitude({bool isSetState = false, String latLong}) {
if (latLong == null) if (latLong == null)
latLong = widget.model.addressesList[widget.model.addressesList latLong = widget
.length - 1].latLong; .model.addressesList[widget.model.addressesList.length - 1].latLong;
List latLongArr = latLong.split(','); List latLongArr = latLong.split(',');
latitude = double.parse(latLongArr[0]); latitude = double.parse(latLongArr[0]);
longitude = double.parse(latLongArr[1]); longitude = double.parse(latLongArr[1]);
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold( return AppScaffold(
isShowDecPage: false, isShowDecPage: false,
body: Stack( body: Stack(
children: [ children: [
@ -84,7 +82,6 @@ class _NewCMCStepTowPageState
autocompleteLanguage: projectViewModel.currentLanguage, autocompleteLanguage: projectViewModel.currentLanguage,
enableMapTypeButton: true, enableMapTypeButton: true,
searchForInitialValue: false, searchForInitialValue: false,
onPlacePicked: (PickResult result) { onPlacePicked: (PickResult result) {
print(result.adrAddress); print(result.adrAddress);
widget.changePageViewIndex(3); widget.changePageViewIndex(3);
@ -95,57 +92,56 @@ class _NewCMCStepTowPageState
return isSearchBarFocused return isSearchBarFocused
? Container() ? Container()
: FloatingCard( : FloatingCard(
bottomPosition: 0.0, bottomPosition: 0.0,
leftPosition: 0.0, leftPosition: 0.0,
rightPosition: 0.0, rightPosition: 0.0,
width: 500, width: 500,
borderRadius: BorderRadius.circular(12.0), borderRadius: BorderRadius.circular(12.0),
child: state == SearchingState.Searching child: state == SearchingState.Searching
? Center(child: CircularProgressIndicator()) ? Center(child: CircularProgressIndicator())
: Container( : Container(
margin: EdgeInsets.all(12), margin: EdgeInsets.all(12),
child: Column( child: Column(
children: [ children: [
SecondaryButton( SecondaryButton(
color: Colors.grey[800], color: Colors.grey[800],
textColor: Colors.white, textColor: Colors.white,
onTap: () { onTap: () {
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
page: page: CMCLocationPage(
CMCLocationPage( latitude: latitude,
latitude: latitude, longitude: longitude,
longitude: longitude, ),
),
), );
), },
); label: TranslationBase.of(context)
}, .addNewAddress,
label: TranslationBase.of(context).addNewAddress, ),
), SizedBox(
SizedBox(height: 10,), height: 10,
SecondaryButton( ),
color: Colors.red SecondaryButton(
[800], color: Colors.red[800],
textColor: Colors.white, textColor: Colors.white,
onTap: () { onTap: () {
setState(() { setState(() {
widget.cmcInsertPresOrderRequestModel widget.cmcInsertPresOrderRequestModel
.latitude = .latitude =
selectedPlace.geometry.location.lat; selectedPlace.geometry.location.lat;
widget.cmcInsertPresOrderRequestModel widget.cmcInsertPresOrderRequestModel
.longitude = .longitude =
selectedPlace.geometry.location.lng; selectedPlace.geometry.location.lng;
}); });
widget.changePageViewIndex(3); widget.changePageViewIndex(3);
}, },
label: TranslationBase.of(context).confirm, label: TranslationBase.of(context).confirm,
), ),
], ],
) )),
), );
);
}, },
initialPosition: LatLng(latitude, longitude), initialPosition: LatLng(latitude, longitude),
useCurrentLocation: false, useCurrentLocation: false,
@ -160,37 +156,36 @@ class _NewCMCStepTowPageState
// height: 65, // height: 65,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
color: Colors.white), color: Theme.of(context).primaryColor),
child: Row( child: Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.spaceBetween,
MainAxisAlignment.spaceBetween,
children: [ children: [
Expanded(child: Texts(getAddressName(), fontSize: 14,),), Expanded(
child: Texts(
getAddressName(),
fontSize: 14,
),
),
Icon(Icons.arrow_drop_down) Icon(Icons.arrow_drop_down)
], ],
), ),
), ),
), ),
height: 56, width: double.infinity, color: Theme height: 56,
.of(context) width: double.infinity,
.scaffoldBackgroundColor, color: Theme.of(context).scaffoldBackgroundColor,
) )
], ],
), ),
); );
} }
void confirmSelectLocationDialog(List<AddressInfo> addresses) { void confirmSelectLocationDialog(List<AddressInfo> addresses) {
showDialog( showDialog(
context: context, context: context,
child: SelectLocationDialog( child: SelectLocationDialog(
addresses: addresses, addresses: addresses,
selectedAddress: _selectedAddress selectedAddress: _selectedAddress,
,
onValueSelected: (value) { onValueSelected: (value) {
setLatitudeAndLongitude(latLong: value.latLong); setLatitudeAndLongitude(latLong: value.latLong);
setState(() { setState(() {

@ -17,8 +17,7 @@ class CMCPage extends StatefulWidget {
_CMCPageState createState() => _CMCPageState(); _CMCPageState createState() => _CMCPageState();
} }
class _CMCPageState extends State<CMCPage> class _CMCPageState extends State<CMCPage> with SingleTickerProviderStateMixin {
with SingleTickerProviderStateMixin {
TabController _tabController; TabController _tabController;
@override @override
@ -36,14 +35,18 @@ class _CMCPageState extends State<CMCPage>
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<CMCViewModel>( return BaseView<CMCViewModel>(
onModelReady: (model) async{ onModelReady: (model) async {
await model.getCmcAllPresOrders(); await model.getCmcAllPresOrders();
}, },
builder: (_, model, widget) => AppScaffold( builder: (_, model, widget) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
description:TranslationBase.of(context).infoCMC, description: TranslationBase.of(context).infoCMC,
imagesInfo: [ImagesInfo(imageAr: 'assets/images/Wifi-AR.png',imageEn: 'assets/images/wifi-EN.png', isAsset: true)], imagesInfo: [
ImagesInfo(
imageAr: 'assets/images/Wifi-AR.png',
imageEn: 'assets/images/wifi-EN.png',
isAsset: true)
],
appBarTitle: TranslationBase.of(context).comprehensiveMedicalCheckup, appBarTitle: TranslationBase.of(context).comprehensiveMedicalCheckup,
body: Scaffold( body: Scaffold(
extendBodyBehindAppBar: true, extendBodyBehindAppBar: true,
@ -58,9 +61,7 @@ class _CMCPageState extends State<CMCPage>
child: BackdropFilter( child: BackdropFilter(
filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10), filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10),
child: Container( child: Container(
color: Theme.of(context) color: Theme.of(context).primaryColor.withOpacity(0.8),
.scaffoldBackgroundColor
.withOpacity(0.8),
height: 70.0, height: 70.0,
), ),
), ),
@ -76,7 +77,7 @@ class _CMCPageState extends State<CMCPage>
color: Theme.of(context).dividerColor, color: Theme.of(context).dividerColor,
width: 0.7), width: 0.7),
), ),
color: Colors.white), color: Theme.of(context).primaryColor),
child: Center( child: Center(
child: TabBar( child: TabBar(
isScrollable: true, isScrollable: true,
@ -86,7 +87,7 @@ class _CMCPageState extends State<CMCPage>
indicatorColor: Colors.red[800], indicatorColor: Colors.red[800],
labelColor: Theme.of(context).primaryColor, labelColor: Theme.of(context).primaryColor,
labelPadding: labelPadding:
EdgeInsets.only(top: 4.0, left: 18.0, right: 18.0), EdgeInsets.only(top: 4.0, left: 18.0, right: 18.0),
unselectedLabelColor: Colors.grey[800], unselectedLabelColor: Colors.grey[800],
tabs: [ tabs: [
Container( Container(
@ -99,7 +100,8 @@ class _CMCPageState extends State<CMCPage>
Container( Container(
width: MediaQuery.of(context).size.width * 0.37, width: MediaQuery.of(context).size.width * 0.37,
child: Center( child: Center(
child: Texts(TranslationBase.of(context).orderLog), child:
Texts(TranslationBase.of(context).orderLog),
), ),
), ),
], ],

@ -49,6 +49,7 @@ class _LocationPageState
return BaseView<HomeHealthCareViewModel>( return BaseView<HomeHealthCareViewModel>(
onModelReady: (model) {}, onModelReady: (model) {},
builder: (_, model, widget) => AppScaffold( builder: (_, model, widget) => AppScaffold(
appBarTitle: TranslationBase.of(context).addAddress,
isShowDecPage: false, isShowDecPage: false,
isShowAppBar: true, isShowAppBar: true,
baseViewModel: model, baseViewModel: model,

@ -31,19 +31,20 @@ class NewHomeHealthCareStepOnePage extends StatefulWidget {
_NewHomeHealthCareStepOnePageState(); _NewHomeHealthCareStepOnePageState();
} }
class _NewHomeHealthCareStepOnePageState extends State<NewHomeHealthCareStepOnePage> { class _NewHomeHealthCareStepOnePageState
extends State<NewHomeHealthCareStepOnePage> {
PickResult _result; PickResult _result;
@override @override
void initState() { void initState() {
if (widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList == null) if (widget.patientERInsertPresOrderRequestModel
widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList = []; .patientERHHCInsertServicesList ==
null)
widget.patientERInsertPresOrderRequestModel
.patientERHHCInsertServicesList = [];
super.initState(); super.initState();
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
@ -67,9 +68,7 @@ class _NewHomeHealthCareStepOnePageState extends State<NewHomeHealthCareStepOneP
height: 12, height: 12,
), ),
Texts( Texts(
TranslationBase TranslationBase.of(context).selectHomeHealthCareServices,
.of(context)
.selectHomeHealthCareServices,
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),
Column( Column(
@ -79,7 +78,7 @@ class _NewHomeHealthCareStepOnePageState extends State<NewHomeHealthCareStepOneP
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border.all(color: Colors.grey, width: 1), border: Border.all(color: Colors.grey, width: 1),
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(12),
color: Colors.white), color: Theme.of(context).primaryColor),
child: Column( child: Column(
children: [ children: [
Row( Row(
@ -95,13 +94,13 @@ class _NewHomeHealthCareStepOnePageState extends State<NewHomeHealthCareStepOneP
.patientERInsertPresOrderRequestModel .patientERInsertPresOrderRequestModel
.patientERHHCInsertServicesList .patientERHHCInsertServicesList
.add(PatientERHHCInsertServicesList( .add(PatientERHHCInsertServicesList(
recordID: widget recordID: widget
.patientERInsertPresOrderRequestModel .patientERInsertPresOrderRequestModel
.patientERHHCInsertServicesList .patientERHHCInsertServicesList
.length, .length,
serviceID: service.serviceID, serviceID: service.serviceID,
serviceName: serviceName:
service.description)); service.description));
else else
removeSelected(service.serviceID); removeSelected(service.serviceID);
// widget.patientERInsertPresOrderRequestModel // widget.patientERInsertPresOrderRequestModel
@ -112,8 +111,9 @@ class _NewHomeHealthCareStepOnePageState extends State<NewHomeHealthCareStepOneP
child: Padding( child: Padding(
padding: const EdgeInsets.all(20.0), padding: const EdgeInsets.all(20.0),
child: Texts( child: Texts(
projectViewModel.isArabic ? service projectViewModel.isArabic
.descriptionN : service.description, ? service.descriptionN
: service.description,
fontSize: 15, fontSize: 15,
), ),
), ),
@ -139,14 +139,14 @@ class _NewHomeHealthCareStepOnePageState extends State<NewHomeHealthCareStepOneP
Container( Container(
width: MediaQuery.of(context).size.width * 0.9, width: MediaQuery.of(context).size.width * 0.9,
child: SecondaryButton( child: SecondaryButton(
label: TranslationBase label: TranslationBase.of(context).next,
.of(context)
.next,
disabled: this disabled: this
.widget .widget
.patientERInsertPresOrderRequestModel .patientERInsertPresOrderRequestModel
.patientERHHCInsertServicesList .patientERHHCInsertServicesList
.length == 0 || widget.model.state == ViewState.BusyLocal, .length ==
0 ||
widget.model.state == ViewState.BusyLocal,
color: Colors.grey[800], color: Colors.grey[800],
loading: widget.model.state == ViewState.BusyLocal, loading: widget.model.state == ViewState.BusyLocal,
onTap: () async { onTap: () async {

@ -45,15 +45,15 @@ class _NewHomeHealthCarePageState extends State<NewHomeHealthCarePage>
_getCurrentLocation(); _getCurrentLocation();
} }
_getCurrentLocation() async { _getCurrentLocation() async {
await getLastKnownPosition().then((value) { await getLastKnownPosition().then((value) {
_latitude = value.latitude; _latitude = value.latitude;
_longitude = value.longitude; _longitude = value.longitude;
}).catchError((e) { }).catchError((e) {
_longitude = 0; _longitude = 0;
_latitude = 0; _latitude = 0;
}); });
} }
@override @override
void dispose() { void dispose() {
@ -87,7 +87,9 @@ class _NewHomeHealthCarePageState extends State<NewHomeHealthCarePage>
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
Utils.showErrorToast(model.error); Utils.showErrorToast(model.error);
} else { } else {
AppToast.showSuccessToast(message:TranslationBase.of(context).processDoneSuccessfully ); AppToast.showSuccessToast(
message:
TranslationBase.of(context).processDoneSuccessfully);
await model.getHHCAllPresOrders(); await model.getHHCAllPresOrders();
// await model.getHHCAllServices(); // await model.getHHCAllServices();
} }
@ -105,7 +107,9 @@ class _NewHomeHealthCarePageState extends State<NewHomeHealthCarePage>
child: Column( child: Column(
children: [ children: [
Container( Container(
margin: EdgeInsets.only(left: MediaQuery.of(context).size.width*0.05, right: MediaQuery.of(context).size.width*0.05), margin: EdgeInsets.only(
left: MediaQuery.of(context).size.width * 0.05,
right: MediaQuery.of(context).size.width * 0.05),
child: StepsWidget( child: StepsWidget(
index: _currentIndex, index: _currentIndex,
changeCurrentTab: _changeCurrentTab, changeCurrentTab: _changeCurrentTab,
@ -130,11 +134,13 @@ class _NewHomeHealthCarePageState extends State<NewHomeHealthCarePage>
width: double.infinity, width: double.infinity,
margin: EdgeInsets.only(top: 15), margin: EdgeInsets.only(top: 15),
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border.all(color: Colors.grey, width: 1), border: Border.all(
color: Colors.grey, width: 1),
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(12),
color: Colors.white), color: Theme.of(context).primaryColor),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
SizedBox( SizedBox(
height: 12, height: 12,
@ -142,7 +148,10 @@ class _NewHomeHealthCarePageState extends State<NewHomeHealthCarePage>
Container( Container(
width: double.infinity, width: double.infinity,
padding: EdgeInsets.only( padding: EdgeInsets.only(
left: 15, bottom: 15, top: 15,right: 15), left: 15,
bottom: 15,
top: 15,
right: 15),
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border( border: Border(
bottom: BorderSide( bottom: BorderSide(
@ -151,13 +160,14 @@ class _NewHomeHealthCarePageState extends State<NewHomeHealthCarePage>
), ),
), ),
// borderRadius: BorderRadius.circular(12), // borderRadius: BorderRadius.circular(12),
color: Colors.white), color:
Theme.of(context).primaryColor),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
Texts( Texts(
TranslationBase TranslationBase.of(context)
.of(context)
.requestID, .requestID,
bold: false, bold: false,
fontSize: 13, fontSize: 13,
@ -166,7 +176,8 @@ class _NewHomeHealthCarePageState extends State<NewHomeHealthCarePage>
height: 4, height: 4,
), ),
Texts( Texts(
widget.model.pendingOrder.iD.toString(), widget.model.pendingOrder.iD
.toString(),
fontSize: 22, fontSize: 22,
), ),
], ],
@ -175,7 +186,10 @@ class _NewHomeHealthCarePageState extends State<NewHomeHealthCarePage>
Container( Container(
width: double.infinity, width: double.infinity,
padding: EdgeInsets.only( padding: EdgeInsets.only(
left: 15, bottom: 15, top: 15,right: 15), left: 15,
bottom: 15,
top: 15,
right: 15),
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border( border: Border(
bottom: BorderSide( bottom: BorderSide(
@ -184,13 +198,14 @@ class _NewHomeHealthCarePageState extends State<NewHomeHealthCarePage>
), ),
), ),
// borderRadius: BorderRadius.circular(12), // borderRadius: BorderRadius.circular(12),
color: Colors.white), color:
Theme.of(context).primaryColor),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
Texts( Texts(
TranslationBase TranslationBase.of(context)
.of(context)
.OrderStatus, .OrderStatus,
bold: false, bold: false,
fontSize: 13, fontSize: 13,
@ -199,11 +214,11 @@ class _NewHomeHealthCarePageState extends State<NewHomeHealthCarePage>
height: 4, height: 4,
), ),
Texts( Texts(
projectViewModel.isArabic
projectViewModel.isArabic ? widget ? widget.model.pendingOrder
.model.pendingOrder .descriptionN
.descriptionN : widget.model : widget.model.pendingOrder
.pendingOrder.description, .description,
fontSize: 22, fontSize: 22,
), ),
], ],
@ -212,7 +227,10 @@ class _NewHomeHealthCarePageState extends State<NewHomeHealthCarePage>
Container( Container(
width: double.infinity, width: double.infinity,
padding: EdgeInsets.only( padding: EdgeInsets.only(
left: 15, bottom: 15, top: 15,right: 15), left: 15,
bottom: 15,
top: 15,
right: 15),
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border( border: Border(
bottom: BorderSide( bottom: BorderSide(
@ -221,12 +239,15 @@ class _NewHomeHealthCarePageState extends State<NewHomeHealthCarePage>
), ),
), ),
// borderRadius: BorderRadius.circular(12), // borderRadius: BorderRadius.circular(12),
color: Colors.white), color:
Theme.of(context).primaryColor),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
Texts( Texts(
TranslationBase.of(context).pickupDate, TranslationBase.of(context)
.pickupDate,
bold: false, bold: false,
fontSize: 13, fontSize: 13,
), ),
@ -234,9 +255,14 @@ class _NewHomeHealthCarePageState extends State<NewHomeHealthCarePage>
height: 4, height: 4,
), ),
Texts( Texts(
DateUtil.getDayMonthYearDateFormatted( DateUtil
DateUtil.convertStringToDate(widget .getDayMonthYearDateFormatted(
.model.pendingOrder.createdOn)), DateUtil
.convertStringToDate(
widget
.model
.pendingOrder
.createdOn)),
fontSize: 22, fontSize: 22,
), ),
], ],
@ -247,7 +273,10 @@ class _NewHomeHealthCarePageState extends State<NewHomeHealthCarePage>
(index) => Container( (index) => Container(
width: double.infinity, width: double.infinity,
padding: EdgeInsets.only( padding: EdgeInsets.only(
left: 15, bottom: 15, top: 15,right: 15), left: 15,
bottom: 15,
top: 15,
right: 15),
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border( border: Border(
bottom: BorderSide( bottom: BorderSide(
@ -256,14 +285,14 @@ class _NewHomeHealthCarePageState extends State<NewHomeHealthCarePage>
), ),
), ),
// borderRadius: BorderRadius.circular(12), // borderRadius: BorderRadius.circular(12),
color: Colors.white), color: Theme.of(context)
.primaryColor),
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: [ children: [
Texts( Texts(
TranslationBase TranslationBase.of(context)
.of(context)
.serviceName, .serviceName,
bold: false, bold: false,
fontSize: 13, fontSize: 13,
@ -273,12 +302,16 @@ class _NewHomeHealthCarePageState extends State<NewHomeHealthCarePage>
), ),
Texts( Texts(
projectViewModel.isArabic projectViewModel.isArabic
? widget.model ? widget
.hhcAllOrderDetail[index] .model
.descriptionN .hhcAllOrderDetail[
: widget.model index]
.hhcAllOrderDetail[index] .descriptionN
.description, : widget
.model
.hhcAllOrderDetail[
index]
.description,
fontSize: 22, fontSize: 22,
bold: true, bold: true,
), ),
@ -291,18 +324,24 @@ class _NewHomeHealthCarePageState extends State<NewHomeHealthCarePage>
), ),
Center( Center(
child: Container( child: Container(
width: width: MediaQuery.of(context)
MediaQuery.of(context).size.width * 0.85, .size
.width *
0.85,
child: SecondaryButton( child: SecondaryButton(
label: TranslationBase.of(context).cancel.toUpperCase(), label: TranslationBase.of(context)
.cancel
.toUpperCase(),
onTap: () { onTap: () {
showConfirmMessage(widget.model, showConfirmMessage(
widget.model.hhcAllOrderDetail[0]); widget.model,
widget.model
.hhcAllOrderDetail[0]);
}, },
color: Colors.red[800], color: Colors.red[800],
disabled: false, disabled: false,
textColor: textColor: Theme.of(context)
Theme.of(context).backgroundColor), .backgroundColor),
), ),
), ),
SizedBox( SizedBox(
@ -315,22 +354,24 @@ class _NewHomeHealthCarePageState extends State<NewHomeHealthCarePage>
) )
: NewHomeHealthCareStepOnePage( : NewHomeHealthCareStepOnePage(
changePageViewIndex: _changeCurrentTab, changePageViewIndex: _changeCurrentTab,
patientERInsertPresOrderRequestModel: patientERInsertPresOrderRequestModel, patientERInsertPresOrderRequestModel:
patientERInsertPresOrderRequestModel,
model: widget.model, model: widget.model,
), ),
NewHomeHealthCareStepTowPage( NewHomeHealthCareStepTowPage(
latitude: _latitude, latitude: _latitude,
longitude: _longitude, longitude: _longitude,
changePageViewIndex: _changeCurrentTab, changePageViewIndex: _changeCurrentTab,
patientERInsertPresOrderRequestModel: patientERInsertPresOrderRequestModel, patientERInsertPresOrderRequestModel:
patientERInsertPresOrderRequestModel,
model: widget.model, model: widget.model,
), ),
NewHomeHealthCareStepThreePage( NewHomeHealthCareStepThreePage(
changePageViewIndex: _changeCurrentTab, changePageViewIndex: _changeCurrentTab,
patientERInsertPresOrderRequestModel: patientERInsertPresOrderRequestModel, patientERInsertPresOrderRequestModel:
patientERInsertPresOrderRequestModel,
model: widget.model, model: widget.model,
) )
], ],
), ),
), ),

@ -37,15 +37,19 @@ class _HomeHealthCarePageState extends State<HomeHealthCarePage>
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<HomeHealthCareViewModel>( return BaseView<HomeHealthCareViewModel>(
onModelReady: (model){ onModelReady: (model) {
model.getHHCAllPresOrders(); model.getHHCAllPresOrders();
}, },
builder: (_, model, widget) => AppScaffold( builder: (_, model, widget) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
description: TranslationBase.of(context).HHCNotAuthMsg, description: TranslationBase.of(context).HHCNotAuthMsg,
appBarTitle: TranslationBase.of(context).homeHealthCare, appBarTitle: TranslationBase.of(context).homeHealthCare,
imagesInfo: [ImagesInfo(imageAr: 'assets/images/Wifi-AR.png',imageEn: 'assets/images/wifi-EN.png', isAsset: true)], imagesInfo: [
ImagesInfo(
imageAr: 'assets/images/Wifi-AR.png',
imageEn: 'assets/images/wifi-EN.png',
isAsset: true)
],
body: Scaffold( body: Scaffold(
extendBodyBehindAppBar: true, extendBodyBehindAppBar: true,
appBar: PreferredSize( appBar: PreferredSize(
@ -77,7 +81,7 @@ class _HomeHealthCarePageState extends State<HomeHealthCarePage>
color: Theme.of(context).dividerColor, color: Theme.of(context).dividerColor,
width: 0.7), width: 0.7),
), ),
color: Colors.white), color: Theme.of(context).primaryColor),
child: Center( child: Center(
child: TabBar( child: TabBar(
isScrollable: true, isScrollable: true,
@ -87,19 +91,25 @@ class _HomeHealthCarePageState extends State<HomeHealthCarePage>
indicatorColor: Colors.red[800], indicatorColor: Colors.red[800],
labelColor: Theme.of(context).primaryColor, labelColor: Theme.of(context).primaryColor,
labelPadding: labelPadding:
EdgeInsets.only(top: 4.0, left: 18.0, right: 18.0), EdgeInsets.only(top: 4.0, left: 18.0, right: 18.0),
unselectedLabelColor: Colors.grey[800], unselectedLabelColor: Colors.grey[800],
tabs: [ tabs: [
Container( Container(
width: MediaQuery.of(context).size.width * 0.37, width: MediaQuery.of(context).size.width * 0.37,
child: Center( child: Center(
child: Texts(TranslationBase.of(context).homeHealthCare), child: Texts(
TranslationBase.of(context).homeHealthCare,
color: Colors.black,
),
), ),
), ),
Container( Container(
width: MediaQuery.of(context).size.width * 0.37, width: MediaQuery.of(context).size.width * 0.37,
child: Center( child: Center(
child: Texts(TranslationBase.of(context).orderLog), child: Texts(
TranslationBase.of(context).orderLog,
color: Colors.black,
),
), ),
), ),
], ],

@ -5,6 +5,7 @@ import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.da
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/%E2%80%8B%20health_calculators.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/%E2%80%8B%20health_calculators.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/e_referral_index_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/e_referral_index_page.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/e_referral_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/e_referral_page.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrders.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/h2o_index_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/h2o_index_page.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health-weather/health-weather-indicator.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health-weather/health-weather-indicator.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_converter.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_converter.dart';
@ -58,8 +59,12 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
@override @override
void initState() { void initState() {
WidgetsBinding.instance.addPostFrameCallback((timeStamp) { WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
locationUtils = new LocationUtils(isShowConfirmDialog: true, context: context); locationUtils =
WidgetsBinding.instance.addPostFrameCallback((_) => {Geolocator.getLastKnownPosition().then((value) => setLocation(value))}); new LocationUtils(isShowConfirmDialog: true, context: context);
WidgetsBinding.instance.addPostFrameCallback((_) => {
Geolocator.getLastKnownPosition()
.then((value) => setLocation(value))
});
}); });
super.initState(); super.initState();
} }
@ -98,12 +103,14 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Texts( Texts(
TranslationBase.of(context).healthWeatherIndicators, TranslationBase.of(context)
.healthWeatherIndicators,
color: Colors.white, color: Colors.white,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), ),
Texts( Texts(
TranslationBase.of(context).healthTipsBasedOnCurrentWeather, TranslationBase.of(context)
.healthTipsBasedOnCurrentWeather,
color: Colors.white, color: Colors.white,
fontSize: 14, fontSize: 14,
), ),
@ -131,7 +138,11 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
width: 60, width: 60,
height: 60, height: 60,
), ),
Directionality(textDirection: TextDirection.ltr, child: AppText(weather, fontSize: 22, color: Colors.white)) Directionality(
textDirection: TextDirection.ltr,
child: AppText(weather,
fontSize: 22,
color: Colors.white))
], ],
), ),
Texts( Texts(
@ -151,7 +162,8 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
Navigator.pop(context); Navigator.pop(context);
widget.goToMyProfile(); widget.goToMyProfile();
}, },
imageLocation: 'assets/images/new-design/my_file_bottom_bar.png', imageLocation:
'assets/images/new-design/my_file_bottom_bar.png',
title: TranslationBase.of(context).myMedicalFile, title: TranslationBase.of(context).myMedicalFile,
), ),
ServicesContainer( ServicesContainer(
@ -173,7 +185,8 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
), ),
), ),
), ),
imageLocation: 'assets/images/new-design/booking_icon_active.png', imageLocation:
'assets/images/new-design/booking_icon_active.png',
title: TranslationBase.of(context).bookAppo, title: TranslationBase.of(context).bookAppo,
), ),
ServicesContainer( ServicesContainer(
@ -183,15 +196,28 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
page: PaymentService(), page: PaymentService(),
), ),
), ),
imageLocation: 'assets/images/al-habib_online_payment_service_icon.png', imageLocation:
'assets/images/al-habib_online_payment_service_icon.png',
title: TranslationBase.of(context).onlinePaymentService, title: TranslationBase.of(context).onlinePaymentService,
), ),
ServicesContainer(
onTap: () => Navigator.push(
context,
FadePage(
page: AnicllaryOrders(),
),
),
imageLocation:
'assets/images/comprehensive_medical_checkup_logo.png',
title: TranslationBase.of(context).anicllaryOrders,
),
ServicesContainer( ServicesContainer(
onTap: () => Navigator.push( onTap: () => Navigator.push(
context, context,
FadePage(), FadePage(),
), ),
imageLocation: 'assets/images/al-habib_online_payment_service_icon.png', imageLocation:
'assets/images/al-habib_online_payment_service_icon.png',
title: TranslationBase.of(context).covid19_driveThrueTest, title: TranslationBase.of(context).covid19_driveThrueTest,
), ),
ServicesContainer( ServicesContainer(
@ -224,13 +250,17 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
page: InsuranceUpdate(), page: InsuranceUpdate(),
), ),
), ),
imageLocation: 'assets/images/medical/insurance_card_icon.png', imageLocation:
'assets/images/medical/insurance_card_icon.png',
title: TranslationBase.of(context).updateInsurance, title: TranslationBase.of(context).updateInsurance,
), ),
ServicesContainer( ServicesContainer(
onTap: () => Navigator.push( onTap: () => Navigator.push(
context, context,
FadePage(page: authUser.patientID == null ? EReferralIndexPage() : EReferralPage()), FadePage(
page: authUser.patientID == null
? EReferralIndexPage()
: EReferralPage()),
), ),
imageLocation: 'assets/images/ereferral_service_icon.png', imageLocation: 'assets/images/ereferral_service_icon.png',
title: TranslationBase.of(context).ereferral, title: TranslationBase.of(context).ereferral,
@ -242,7 +272,8 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
page: MyFamily(), page: MyFamily(),
), ),
), ),
imageLocation: 'assets/images/new-design/family_menu_icon_red.png', imageLocation:
'assets/images/new-design/family_menu_icon_red.png',
title: TranslationBase.of(context).myFamily, title: TranslationBase.of(context).myFamily,
), ),
if (projectViewModel.havePrivilege(35)) if (projectViewModel.havePrivilege(35))
@ -251,7 +282,8 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
context, context,
FadePage(page: ChildVaccinesPage()), FadePage(page: ChildVaccinesPage()),
), ),
imageLocation: 'assets/images/new-design/children_vaccines_icon.png', imageLocation:
'assets/images/new-design/children_vaccines_icon.png',
title: TranslationBase.of(context).childVaccine, title: TranslationBase.of(context).childVaccine,
), ),
ServicesContainer( ServicesContainer(
@ -261,7 +293,8 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
page: ToDo(isShowAppBar: true), page: ToDo(isShowAppBar: true),
), ),
), ),
imageLocation: 'assets/images/new-design/upcoming_icon_bottom_bar.png', imageLocation:
'assets/images/new-design/upcoming_icon_bottom_bar.png',
title: TranslationBase.of(context).todoList, title: TranslationBase.of(context).todoList,
), ),
if (projectViewModel.havePrivilege(42)) if (projectViewModel.havePrivilege(42))
@ -288,7 +321,8 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
page: (HealthCalculators()), page: (HealthCalculators()),
), ),
), ),
imageLocation: 'assets/images/new-design/health_calculator_icon.png', imageLocation:
'assets/images/new-design/health_calculator_icon.png',
title: TranslationBase.of(context).calculators, title: TranslationBase.of(context).calculators,
), ),
ServicesContainer( ServicesContainer(
@ -298,12 +332,14 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
page: HealthConverter(), page: HealthConverter(),
), ),
), ),
imageLocation: 'assets/images/new-design/health_convertor_icon.png', imageLocation:
'assets/images/new-design/health_convertor_icon.png',
title: TranslationBase.of(context).converters, title: TranslationBase.of(context).converters,
), ),
if (projectViewModel.havePrivilege(38)) if (projectViewModel.havePrivilege(38))
ServicesContainer( ServicesContainer(
onTap: () => Navigator.push(context, FadePage(page: H2OPage())), onTap: () =>
Navigator.push(context, FadePage(page: H2OPage())),
// Navigator.push( // Navigator.push(
// context, // context,
// FadePage( // FadePage(
@ -319,7 +355,8 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
context, context,
FadePage(), FadePage(),
), ),
imageLocation: 'assets/images/new-design/smartwatch_icon.png', imageLocation:
'assets/images/new-design/smartwatch_icon.png',
title: TranslationBase.of(context).smartWatches, title: TranslationBase.of(context).smartWatches,
), ),
ServicesContainer( ServicesContainer(
@ -329,12 +366,15 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
page: ParkingPage(), page: ParkingPage(),
), ),
), ),
imageLocation: 'assets/images/new-design/parking_system_icon.png', imageLocation:
'assets/images/new-design/parking_system_icon.png',
title: TranslationBase.of(context).parking, title: TranslationBase.of(context).parking,
), ),
ServicesContainer( ServicesContainer(
onTap: () => launch("https://hmgwebservices.com/vt_mobile/html/index.html"), onTap: () => launch(
imageLocation: 'assets/images/new-design/virtual_tour_icon.png', "https://hmgwebservices.com/vt_mobile/html/index.html"),
imageLocation:
'assets/images/new-design/virtual_tour_icon.png',
title: TranslationBase.of(context).vTour, title: TranslationBase.of(context).vTour,
), ),
ServicesContainer( ServicesContainer(
@ -342,10 +382,12 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
Navigator.of(context).push(MaterialPageRoute( Navigator.of(context).push(MaterialPageRoute(
builder: (BuildContext context) => MyWebView( builder: (BuildContext context) => MyWebView(
title: "HMG News", title: "HMG News",
selectedUrl: "https://twitter.com/hashtag/مجموعة_د_سليمان_الحبيب_الطبية?src=hashtag_click&f=live", selectedUrl:
"https://twitter.com/hashtag/مجموعة_د_سليمان_الحبيب_الطبية?src=hashtag_click&f=live",
))); )));
}, },
imageLocation: 'assets/images/new-design/twitter_dashboard_icon.png', imageLocation:
'assets/images/new-design/twitter_dashboard_icon.png',
title: TranslationBase.of(context).latestNews, title: TranslationBase.of(context).latestNews,
), ),
ServicesContainer( ServicesContainer(
@ -368,7 +410,8 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
getAuthUser() async { getAuthUser() async {
if (await this.sharedPref.getObject(USER_PROFILE) != null) { if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); var data = AuthenticatedUser.fromJson(
await this.sharedPref.getObject(USER_PROFILE));
setState(() { setState(() {
authUser = data; authUser = data;
}); });
@ -382,7 +425,8 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
}); });
} else { } else {
setState(() { setState(() {
weather = data != null ? data['Temperature'].toString() + '\u2103' : '--'; weather =
data != null ? data['Temperature'].toString() + '\u2103' : '--';
}); });
} }
} }

@ -0,0 +1,177 @@
import 'package:diplomaticquarterapp/core/viewModels/ancillary_orders_view_model.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
class AnicllaryOrders extends StatefulWidget {
@override
_AnicllaryOrdersState createState() => _AnicllaryOrdersState();
}
class _AnicllaryOrdersState extends State<AnicllaryOrders>
with SingleTickerProviderStateMixin {
TabController _tabController;
void initState() {
super.initState();
_tabController = TabController(length: 2, vsync: this);
}
void dispose() {
super.dispose();
_tabController.dispose();
}
@override
Widget build(BuildContext context) {
return BaseView<AnciallryOrdersViewModel>(
onModelReady: (model) => model.getOrders(),
builder: (_, model, widget) => AppScaffold(
isShowAppBar: true,
baseViewModel: model,
appBarTitle: TranslationBase.of(context).anicllaryOrders,
body: SingleChildScrollView(
padding: EdgeInsets.all(12),
child: model.ancillaryLists.length > 0
? Column(children: [
getPatientInfo(model),
getAncillaryOrdersList(model)
])
: SizedBox())));
}
Widget getPatientInfo(AnciallryOrdersViewModel model) {
print(model.ancillaryLists);
return Padding(
child: Column(
children: [
Row(
children: [
Texts(
TranslationBase.of(context).mrn,
fontWeight: FontWeight.bold,
fontSize: 22,
),
Texts(
" : ",
fontSize: 20,
),
Texts(
model.ancillaryLists[0].patientID.toString(),
)
],
),
Row(
children: [
Texts(
TranslationBase.of(context).patientName,
fontWeight: FontWeight.bold,
fontSize: 20,
),
Texts(
" : ",
fontSize: 20,
),
Texts(
model.ancillaryLists[0].patientName,
)
],
),
Divider()
],
),
padding: EdgeInsets.only(top: 5.0, bottom: 10.0),
);
}
Widget getAncillaryOrdersList(AnciallryOrdersViewModel model) {
return Column(
children: model.ancillaryLists[0].ancillaryOrderList
.map(
(item) => InkWell(
onTap: () {
ancillaryOrdersDetails(item);
},
child: Container(
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
width: 0.5,
))),
padding: EdgeInsets.all(5),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.all(3),
child: Row(
mainAxisAlignment:
MainAxisAlignment.start,
children: [
Texts(
TranslationBase.of(context)
.appointmentNo +
' : ',
fontWeight: FontWeight.bold,
),
Texts(item.appointmentNo.toString())
],
)),
Padding(
padding: EdgeInsets.all(3),
child: Row(
children: [
Texts(
TranslationBase.of(context)
.appointmentDate +
' : ',
fontWeight: FontWeight.bold),
Texts(DateUtil.getFormattedDate(
DateUtil.convertStringToDate(
item.appointmentDate),
"MMM dd,yyyy"))
],
)),
Padding(
padding: EdgeInsets.all(3),
child: Row(
children: [
Texts(
TranslationBase.of(context)
.doctorName +
' : ',
fontWeight: FontWeight.bold),
Texts(item.doctorName.toString())
],
)),
Divider(
color: Colors.black12,
height: 1,
)
]),
Icon(
Icons.arrow_right,
size: 25,
)
]))),
)
.toList());
}
ancillaryOrdersDetails(item) {
Navigator.push(
context,
FadePage(
page: AnicllaryOrdersDetails(item.appointmentNo, item.orderNo),
),
);
}
}

@ -0,0 +1,196 @@
import 'package:diplomaticquarterapp/core/viewModels/ancillary_orders_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import "package:collection/collection.dart";
class AnicllaryOrdersDetails extends StatefulWidget {
final dynamic appoNo;
final dynamic orderNo;
AnicllaryOrdersDetails(this.appoNo, this.orderNo);
@override
_AnicllaryOrdersState createState() => _AnicllaryOrdersState();
}
class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails>
with SingleTickerProviderStateMixin {
void initState() {
super.initState();
}
void dispose() {
super.dispose();
}
@override
Widget build(BuildContext context) {
return BaseView<AnciallryOrdersViewModel>(
onModelReady: (model) =>
model.getOrdersDetails(widget.appoNo, widget.orderNo),
builder: (_, model, widget) => AppScaffold(
isShowAppBar: true,
baseViewModel: model,
appBarTitle: TranslationBase.of(context).anicllaryOrders,
body: SingleChildScrollView(
padding: EdgeInsets.all(12),
child: model.ancillaryListsDetails.length > 0
? Column(children: [
getPatientInfo(model),
getInvoiceDetails(model),
getInsuranceDetails(model),
getAncillaryDetails(model)
])
: SizedBox())));
}
Widget getPatientInfo(AnciallryOrdersViewModel model) {
print(model.ancillaryListsDetails);
return Padding(
child: Column(
children: [
Row(
children: [
Texts(
TranslationBase.of(context).mrn,
fontWeight: FontWeight.bold,
fontSize: 22,
),
Texts(
" : ",
fontSize: 20,
),
Texts(
model.ancillaryListsDetails[0].patientID.toString(),
)
],
),
Row(
children: [
Texts(
TranslationBase.of(context).patientName,
fontWeight: FontWeight.bold,
fontSize: 20,
),
Texts(
" : ",
fontSize: 20,
),
Texts(
model.ancillaryLists[0].patientName,
)
],
),
Divider(
color: Colors.black26,
)
],
),
padding: EdgeInsets.only(top: 5.0, bottom: 5.0),
);
}
Widget getInvoiceDetails(model) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Texts(
TranslationBase.of(context).invoiceNo,
fontWeight: FontWeight.bold,
),
Texts(" : "),
Texts(
model.ancillaryListsDetails[0].appointmentNo.toString(),
)
],
),
Row(
children: [
Texts(
TranslationBase.of(context).date,
fontWeight: FontWeight.bold,
),
Texts(" : "),
Texts(
DateUtil.getFormattedDate(
DateUtil.convertStringToDate(
model.ancillaryListsDetails[0].appointmentDate),
"MMM dd,yyyy"),
)
],
),
Row(
children: [
Texts(
TranslationBase.of(context).date,
fontWeight: FontWeight.bold,
),
Texts(" : "),
Texts(
model.ancillaryListsDetails[0].doctorName,
),
],
),
SizedBox(
height: 10,
),
Divider(
color: Colors.black26,
)
],
);
}
Widget getInsuranceDetails(model) {
return Padding(
padding: EdgeInsets.only(top: 10, bottom: 10),
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Texts(
TranslationBase.of(context).insurance,
fontWeight: FontWeight.bold,
),
Texts(
TranslationBase.of(context).insuranceID,
fontWeight: FontWeight.bold,
)
],
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Texts(
model.ancillaryListsDetails[0].policyName,
),
Texts(
model.ancillaryListsDetails[0].insurancePolicyNo,
)
],
),
SizedBox(
height: 15,
),
Divider(
color: Colors.red[800],
thickness: 3,
)
],
));
}
Widget getAncillaryDetails(model) {
var newMap = groupBy(model.ancillaryListsDetails[0].ancillaryOrderProcList,
(obj) => obj.procedureCategoryName);
print(newMap);
return Padding(
padding: EdgeInsets.only(top: 10, bottom: 10),
child: Column(children: []));
}
}

@ -66,7 +66,7 @@ class _HealthCalculatorsState extends State<HealthCalculators>
isScrollable: true, isScrollable: true,
indicatorWeight: 4.0, indicatorWeight: 4.0,
indicatorColor: Colors.red, indicatorColor: Colors.red,
labelColor: Theme.of(context).primaryColor, labelColor: Theme.of(context).buttonColor,
labelPadding: labelPadding:
EdgeInsets.symmetric(horizontal: 13.0, vertical: 2.0), EdgeInsets.symmetric(horizontal: 13.0, vertical: 2.0),
unselectedLabelColor: Colors.grey, unselectedLabelColor: Colors.grey,
@ -74,13 +74,15 @@ class _HealthCalculatorsState extends State<HealthCalculators>
Container( Container(
width: MediaQuery.of(context).size.width * 0.35, width: MediaQuery.of(context).size.width * 0.35,
child: Center( child: Center(
child: Texts(TranslationBase.of(context).generalHealth), child: Texts(
TranslationBase.of(context).generalHealth),
), ),
), ),
Container( Container(
width: MediaQuery.of(context).size.width * 0.35, width: MediaQuery.of(context).size.width * 0.35,
child: Center( child: Center(
child: Texts(TranslationBase.of(context).womanHealth), child:
Texts(TranslationBase.of(context).womanHealth),
), ),
), ),
], ],
@ -119,7 +121,8 @@ class _HealthCalculatorsState extends State<HealthCalculators>
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).bmi, title: TranslationBase.of(context).bmi,
imagePath: 'bmi_health_calculator.png', imagePath: 'bmi_health_calculator.png',
subTitle: TranslationBase.of(context).calcHealth, subTitle:
TranslationBase.of(context).calcHealth,
), ),
), ),
), ),
@ -137,7 +140,8 @@ class _HealthCalculatorsState extends State<HealthCalculators>
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).calories, title: TranslationBase.of(context).calories,
imagePath: 'calories-calculator.png', imagePath: 'calories-calculator.png',
subTitle: TranslationBase.of(context).calcHealth, subTitle:
TranslationBase.of(context).calcHealth,
), ),
), ),
), ),
@ -159,7 +163,8 @@ class _HealthCalculatorsState extends State<HealthCalculators>
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).bmr, title: TranslationBase.of(context).bmr,
imagePath: 'BMR_calculator.png', imagePath: 'BMR_calculator.png',
subTitle: TranslationBase.of(context).calcHealth, subTitle:
TranslationBase.of(context).calcHealth,
), ),
), ),
), ),
@ -215,9 +220,11 @@ class _HealthCalculatorsState extends State<HealthCalculators>
); );
}, },
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).carbohydrate, title:
TranslationBase.of(context).carbohydrate,
imagePath: 'carb_protein.png', imagePath: 'carb_protein.png',
subTitle: TranslationBase.of(context).proteinFat, subTitle:
TranslationBase.of(context).proteinFat,
), ),
), ),
), ),

@ -101,7 +101,7 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
height: 65, height: 65,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(12),
color: Colors.white), color: Theme.of(context).primaryColor),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
@ -124,7 +124,7 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
height: 65, height: 65,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(12),
color: Colors.white), color: Theme.of(context).primaryColor),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
@ -148,7 +148,7 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
height: 65, height: 65,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(12),
color: Colors.white), color: Theme.of(context).primaryColor),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
@ -228,7 +228,7 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
children: [ children: [
Center( Center(
child: Container( child: Container(
color: Colors.white, color: Theme.of(context).primaryColor,
width: 350, width: 350,
child: InkWell( child: InkWell(
onTap: () { onTap: () {

@ -48,11 +48,11 @@ class MyBalancePage extends StatelessWidget {
children: [ children: [
Texts( Texts(
TranslationBase.of(context).totalBalance, TranslationBase.of(context).totalBalance,
color: Colors.white, color: Theme.of(context).primaryColor,
), ),
Texts( Texts(
'${model.totalAdvanceBalanceAmount ?? 0} SAR', '${model.totalAdvanceBalanceAmount ?? 0} SAR',
color: Colors.white, color: Theme.of(context).primaryColor,
bold: true, bold: true,
), ),
], ],
@ -68,7 +68,7 @@ class MyBalancePage extends StatelessWidget {
height: 65, height: 65,
margin: EdgeInsets.only(top: 8), margin: EdgeInsets.only(top: 8),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Theme.of(context).primaryColor,
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(7), borderRadius: BorderRadius.circular(7),
), ),

@ -309,13 +309,14 @@ class _SearchByClinicState extends State<SearchByClinic> {
patientDoctorAppointmentListHospital) async { patientDoctorAppointmentListHospital) async {
isProjectLoaded = false; isProjectLoaded = false;
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
page: SearchResults( page: SearchResults(
isLiveCareAppointment: false, isLiveCareAppointment: false,
doctorsList: docList, doctorsList: docList,
patientDoctorAppointmentListHospital: patientDoctorAppointmentListHospital:
patientDoctorAppointmentListHospital))).then((value) { patientDoctorAppointmentListHospital)))
.then((value) {
getProjectsList(); getProjectsList();
}); });
} }

@ -0,0 +1,76 @@
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class ConfirmExitPageDialog extends StatelessWidget {
final GestureTapCallback onTapYes;
final GestureTapCallback onTapNo;
const ConfirmExitPageDialog({Key key, this.onTapYes, this.onTapNo})
: super(key: key);
@override
Widget build(BuildContext context) {
return SimpleDialog(
contentPadding: EdgeInsets.fromLTRB(28.0, 24.0, 28.0, 0.0),
title: Center(
child: Texts(
TranslationBase.of(context).confirm,
color: Colors.black,
),
),
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Texts(
"Are you sure you want to exit this page ?",
color: Colors.grey,
),
SizedBox(
height: 5,
),
Divider(),
SizedBox(
height: 5.0,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
InkWell(
onTap: () {
onTapNo();
},
child: Container(
child: Center(
child: Texts(
TranslationBase.of(context).no,
color: Colors.red,
),
),
),
),
InkWell(
onTap: () {
Navigator.pop(context);
onTapYes();
},
child: Container(
child: Center(
child: Texts(TranslationBase.of(context).yes),
),
),
),
],
),
SizedBox(
height: 20.0,
),
],
)
],
);
}
}

@ -0,0 +1,120 @@
import 'package:diplomaticquarterapp/core/model/er/TriageInformationRequest.dart';
import 'package:diplomaticquarterapp/core/model/er/TriageQuestionsModel.dart';
import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'EdOnlineAgreementPage.dart';
import 'EdOnlineNotesPage.dart';
import 'EdOnlineQuestionsPage.dart';
import 'EdOnlineSelectedHospitalPage.dart';
import 'EdPaymentInformationPage.dart';
import 'ConfirmExitPageDialog.dart';
class DdServicesPage extends StatefulWidget {
@override
_DdServicesPageState createState() => _DdServicesPageState();
}
class _DdServicesPageState extends State<DdServicesPage> {
PageController pageController;
bool isAgree = false;
TriageInformationRequest triageInformationRequest = new TriageInformationRequest();
List<TriageQuestionsModel> selectedQuestions = List();
@override
void initState() {
super.initState();
pageController = new PageController();
}
_changePageViewIndex(int tab) {
setState(() {
pageController.jumpToPage(tab);
pageController.animateToPage(tab,
duration: Duration(milliseconds: 800), curve: Curves.easeOutQuart);
});
}
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return Scaffold(
appBar: AppBar(
elevation: 0,
textTheme: TextTheme(
headline6: TextStyle(
color: Theme.of(context).textTheme.headline1.color,
fontWeight: FontWeight.bold),
),
title: Text(
'ED Online',
style: TextStyle(
fontWeight: FontWeight.bold,
color: Theme.of(context).textTheme.headline1.color,
fontFamily: projectViewModel.isArabic ? 'Cairo' : 'WorkSans'),
// bold: true,
// color: Colors.white,
),
leading: Builder(
builder: (BuildContext context) {
return IconButton(
icon: Icon(Icons.arrow_back),
color: Theme.of(context).textTheme.headline1.color,
onPressed: () {
showConfirmMessage(context);
},
);
},
),
centerTitle: true,
),
body: PageView(
physics: NeverScrollableScrollPhysics(),
controller: pageController,
onPageChanged: _changePageViewIndex,
children: [
EdOnlineSelectedHospitalPage(
changePageViewIndex: _changePageViewIndex,
triageInformationRequest: triageInformationRequest,
),
EdOnlineAgreementPage(
changePageViewIndex: _changePageViewIndex,
isAgree: isAgree,
),
EdOnlineQuestionsPage(
changePageViewIndex: _changePageViewIndex,
selectedQuestions: selectedQuestions,
),
EdOnlineNotesPage(
changePageViewIndex: _changePageViewIndex,
selectedQuestions: selectedQuestions,
triageInformationRequest: triageInformationRequest,
),
EdPaymentInformationPage(selectedHospital: triageInformationRequest.selectedHospital,)
],
),
);
}
void showConfirmMessage(
BuildContext context,
) {
showDialog(
context: context,
child: ConfirmExitPageDialog(
onTapYes: () {
Navigator.pop(context);
},
onTapNo: () {
Navigator.pop(context);
},
),
);
}
}

@ -0,0 +1,99 @@
import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class EdOnlineAgreementPage extends StatefulWidget {
final HospitalsModel selectedHospital;
final Function changePageViewIndex;
bool isAgree;
EdOnlineAgreementPage({Key key, this.selectedHospital, this.changePageViewIndex,this.isAgree}) : super(key: key);
@override
_EdOnlineAgreementPageState createState() => _EdOnlineAgreementPageState();
}
class _EdOnlineAgreementPageState extends State<EdOnlineAgreementPage> {
@override
Widget build(BuildContext context) {
return AppScaffold(
body: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Column(
children: [
SizedBox(),
InkWell(
onTap: (){
setState(() {
widget.isAgree = !widget.isAgree;
});
},
child: Row(
children: [
Checkbox(
value: widget.isAgree,
activeColor: Colors.red[800],
onChanged: (bool newValue) {
setState(() {
widget.isAgree = !widget.isAgree;
});
}),
Expanded(
child: Padding(
padding: const EdgeInsets.all(20.0),
child: Texts(
TranslationBase.of(context).onlineCheckInAgreement,
fontSize: 15,
),
),
),
],
),
),
SizedBox(),
],
),
),
bottomSheet: Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
height: 56,
child: Row(
children: [
Expanded(
child: Container(
margin: EdgeInsets.only(left: 5,right: 5),
child: SecondaryButton(
textColor: Colors.white,
color: Theme.of(context).primaryColor,
label: TranslationBase.of(context).back.toUpperCase(),
onTap: () => widget.changePageViewIndex(0),
),
),
),
SizedBox(width: 10,),
Expanded(
child: Container(
margin: EdgeInsets.only(left: 5,right: 5),
child: SecondaryButton(
textColor: Colors.white,
color: Theme.of(context).primaryColor,
label: TranslationBase.of(context).next.toUpperCase(),
disabled: !widget.isAgree,
onTap: () => widget.changePageViewIndex(2),
),
),
),
],
),
),
),
);
}
}

@ -0,0 +1,177 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/er/TriageInformationRequest.dart';
import 'package:diplomaticquarterapp/core/model/er/TriageQuestionsModel.dart';
import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/er/EdOnlineViewModel.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/Blood/new_text_Field.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/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_datetime_picker/flutter_datetime_picker.dart';
import 'package:provider/provider.dart';
class EdOnlineNotesPage extends StatefulWidget {
final List<TriageQuestionsModel> selectedQuestions;
final Function changePageViewIndex;
TriageInformationRequest triageInformationRequest;
EdOnlineNotesPage(
{Key key, this.selectedQuestions, this.changePageViewIndex,this.triageInformationRequest})
;
@override
_EdOnlineNotesPageState createState() => _EdOnlineNotesPageState();
}
class _EdOnlineNotesPageState extends State<EdOnlineNotesPage> {
TextEditingController _chiefComplaintsTextController =
TextEditingController();
TextEditingController _noteTextController = TextEditingController();
DateTime selectedTime;
final _formKey = GlobalKey<FormState>();
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<EdOnlineViewModel>(
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
body: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
children: [
Form(
key: _formKey,
child: NewTextFields(
controller: _chiefComplaintsTextController,
maxLines: 15,
minLines: 5,
hintText: TranslationBase.of(context).chiefComplaints,
validator: (value) {
if (value.isEmpty) return TranslationBase.of(context).errorChiefComplaints;
return null;
},
),
),
SizedBox(
height: 8,
),
InkWell(
onTap: () {
DatePicker.showDateTimePicker(
context,
showTitleActions: true,
minTime: DateTime.now(),
maxTime: DateTime.now().add(Duration(hours: 24)),
onConfirm: (date) {
setState(() {
selectedTime = date;
});
},
currentTime: DateTime.now(),
locale: projectViewModel.localeType,
);
},
child: Container(
padding: EdgeInsets.all(12),
width: double.infinity,
// height: 65,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(selectedTime == null ?TranslationBase.of(context).errorExpectedArrivalTime:TranslationBase.of(context).expectedArrivalTime),
Texts(getDate(context)),
],
),
),
),
SizedBox(
height: 8,
),
NewTextFields(
controller: _noteTextController,
maxLines: 15,
minLines: 5,
hintText: TranslationBase.of(context).notes,
),
],
),
),
),
bottomSheet: Container(
height: 56,
margin: EdgeInsets.only(bottom: 5),
width: double.infinity,
child: Row(
children: [
Expanded(
child: Container(
margin: EdgeInsets.only(left: 5,right: 5),
child: SecondaryButton(
textColor: Colors.white,
color: Theme.of(context).primaryColor,
label: TranslationBase.of(context).back.toUpperCase(),
onTap: () => widget.changePageViewIndex(2),
),
),
),
SizedBox(width: 10,),
Expanded(
child: Container(
margin: EdgeInsets.only(left: 5,right: 5),
child: SecondaryButton(
textColor: Colors.white,
color: Theme.of(context).primaryColor,
label: TranslationBase.of(context).save.toUpperCase(),
disabled: selectedTime == null,
onTap: () async {
if (_formKey.currentState.validate()) {
GifLoaderDialogUtils.showMyDialog(context);
model.saveQuestionsInformation(
chiefComplaint:
_chiefComplaintsTextController.text.toString(),
notes: _noteTextController.text.toString(),
selectedQuestions: widget.selectedQuestions,
projectId: widget.triageInformationRequest.projectID,selectedTime: selectedTime).then((value) {
GifLoaderDialogUtils.hideDialog(context);
if(model.state == ViewState.ErrorLocal)
AppToast.showErrorToast(message: model.error);
else
{
widget.changePageViewIndex(4);
}
}).catchError((onError){
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: onError.toString());
});
}
}),
),
),
],
),
),
),
);
}
getDate(BuildContext context) {
String message = "";
if (selectedTime != null) {
message = "${selectedTime.hour}:${selectedTime.minute}";
}
return message;
}
}

@ -0,0 +1,127 @@
import 'package:diplomaticquarterapp/core/model/er/TriageQuestionsModel.dart';
import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/er/EdOnlineViewModel.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
// ignore: must_be_immutable
class EdOnlineQuestionsPage extends StatefulWidget {
final HospitalsModel selectedHospital;
final Function changePageViewIndex;
List<TriageQuestionsModel> selectedQuestions;
EdOnlineQuestionsPage({Key key, this.selectedHospital,this.selectedQuestions, this.changePageViewIndex});
@override
_EdOnlineQuestionsPageState createState() => _EdOnlineQuestionsPageState();
}
class _EdOnlineQuestionsPageState extends State<EdOnlineQuestionsPage> {
@override
Widget build(BuildContext context) {
return BaseView<EdOnlineViewModel>(
onModelReady: (model) => model.getQuestions(),
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
body: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Column(
children: [
...List.generate(
model.triageQuestionsModelList.length,
(index) =>
InkWell(
onTap: (){
setState(() {
if (widget.selectedQuestions
.contains(model.triageQuestionsModelList[index])) {
widget.selectedQuestions
.remove(model.triageQuestionsModelList[index]);
} else {
widget.selectedQuestions
.add(model.triageQuestionsModelList[index]);
}
});
},
child: Row(
children: [
Checkbox(
value: widget.selectedQuestions.contains(model.triageQuestionsModelList[index]),
activeColor: Colors.red[800],
onChanged: (bool newValue) {
setState(() {
if (widget.selectedQuestions
.contains(model.triageQuestionsModelList[index])) {
widget.selectedQuestions
.remove(model.triageQuestionsModelList[index]);
} else {
widget.selectedQuestions
.add(model.triageQuestionsModelList[index]);
}
});
}),
Expanded(
child: Padding(
padding: const EdgeInsets.all(20.0),
child: Texts(
model.triageQuestionsModelList[index].question,
fontSize: 15,
),
),
),
],
),
),
),
SizedBox(height: 80,)
],
),
),
bottomSheet: Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
height: 56,
child: Row(
children: [
Expanded(
child: Container(
margin: EdgeInsets.only(left: 5,right: 5),
child: SecondaryButton(
textColor: Colors.white,
color: Theme.of(context).primaryColor,
label: TranslationBase.of(context).back.toUpperCase(),
onTap: () => widget.changePageViewIndex(1),
),
),
),
SizedBox(width: 10,),
Expanded(
child: Container(
margin: EdgeInsets.only(left: 5,right: 5),
child: SecondaryButton(
textColor: Colors.white,
color: Theme.of(context).primaryColor,
label: TranslationBase.of(context).next.toUpperCase(),
disabled: widget.selectedQuestions.isEmpty,
onTap: () => widget.changePageViewIndex(3),
),
),
),
],
),
),
),
),
);
}
}

@ -0,0 +1,102 @@
import 'package:diplomaticquarterapp/core/model/er/TriageInformationRequest.dart';
import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/er/EdOnlineViewModel.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import '../../../Constants.dart';
class EdOnlineSelectedHospitalPage extends StatefulWidget {
final Function changePageViewIndex;
TriageInformationRequest triageInformationRequest;
EdOnlineSelectedHospitalPage(
{Key key, this.changePageViewIndex,this.triageInformationRequest})
: super(key: key);
@override
_EdOnlineSelectedHospitalPageState createState() =>
_EdOnlineSelectedHospitalPageState();
}
class _EdOnlineSelectedHospitalPageState
extends State<EdOnlineSelectedHospitalPage> {
@override
Widget build(BuildContext context) {
return BaseView<EdOnlineViewModel>(
onModelReady: (model) => model.getHospitals(),
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
body: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Column(
children: [
...List.generate(
model.hospitals.length,
(index) => Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 2,
),
Row(
children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
setState(() {
widget.triageInformationRequest.selectedHospital = model.hospitals[index];
widget.triageInformationRequest.projectID = model.hospitals[index].iD;
});
},
child: ListTile(
title: Text(model.hospitals[index].name +
' ${model.hospitals[index].distanceInKilometers} ' +
TranslationBase.of(context).km),
leading: Radio(
value: model.hospitals[index],
groupValue: widget.triageInformationRequest.selectedHospital,
activeColor: secondaryColor,
onChanged: (value) {
setState(() {
widget.triageInformationRequest.selectedHospital = model.hospitals[index];
widget.triageInformationRequest.projectID = model.hospitals[index].iD;
});
},
),
),
),
)
],
),
SizedBox(
height: 5.0,
),
],
),
)
],
),
),
bottomSheet: Container(
height: 76,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: SecondaryButton(
// textColor: Colors.white,
color: Theme.of(context).primaryColor,
label: TranslationBase.of(context).next.toUpperCase(),
disabled: widget.triageInformationRequest.selectedHospital==null,
onTap: () => widget.changePageViewIndex(1)),
),
),
),
);
}
}

@ -0,0 +1,112 @@
import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/er/EdOnlineViewModel.dart';
import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class EdPaymentInformationPage extends StatefulWidget {
final HospitalsModel selectedHospital;
const EdPaymentInformationPage({Key key, this.selectedHospital}) : super(key: key);
@override
_EdPaymentInformationPageState createState() =>
_EdPaymentInformationPageState();
}
class _EdPaymentInformationPageState extends State<EdPaymentInformationPage> {
@override
Widget build(BuildContext context) {
return BaseView<EdOnlineViewModel>(
onModelReady: (model) => model.getPatientPaymentInformation(),
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
body: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Column(
children: [
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10.0),
color: Colors.white),
margin: EdgeInsets.fromLTRB(0.0, 30.0, 0.0, 5.0),
padding: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 20.0),
child: Column(
children: <Widget>[
Container(
alignment: Alignment.center,
margin:
EdgeInsets.only(left: 0.0, right: 20.0, top: 30.0),
child: Text(TranslationBase.of(context).testFee,
style: TextStyle(
color: Colors.black,
fontSize: 22.0,
fontWeight: FontWeight.bold)),
),
if(model.erPatientShareModel!=null)
Table(
children: [
TableRow(children: [
TableCell(
child:
Texts(TranslationBase.of(context).testFee)),
TableCell(
child: Texts(model
.erPatientShareModel.patientShare
.toStringAsFixed(2))),
]),
TableRow(children: [
TableCell(
child: Texts(
TranslationBase.of(context).patientTaxToDo)),
TableCell(
child: Texts(model
.erPatientShareModel.patientTaxAmount
.toStringAsFixed(2))),
]),
TableRow(children: [
TableCell(
child: Texts(TranslationBase.of(context)
.patientShareTotalToDo)),
TableCell(
child: Texts(model
.erPatientShareModel.patientShareWithTax
.toStringAsFixed(2))),
]),
],
),
],
),
),
],
),
),
bottomSheet: Container(
height: 76,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: SecondaryButton(
color: Theme.of(context).primaryColor,
label: TranslationBase.of(context).next.toUpperCase(),
onTap: () {
Navigator.push(context, FadePage(page: PaymentMethod())).then(
(value) {
//TODO Haroun call API here
},
);
},
),
),
),
),
);
}
}

@ -1,10 +1,16 @@
import 'package:diplomaticquarterapp/uitl/location_util.dart'; import 'package:diplomaticquarterapp/uitl/location_util.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../../uitl/translations_delegate_base.dart'; import '../../uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/pages/ErService/widgets/card_common.dart'; import 'package:diplomaticquarterapp/pages/ErService/widgets/card_common.dart';
import 'AmbulanceReq.dart';
import 'EdOnline/DdServicesPage.dart';
import 'EdOnline/EdOnlineSelectedHospitalPage.dart';
import 'NearestEr.dart';
class ErOptions extends StatefulWidget { class ErOptions extends StatefulWidget {
final bool isAppbar; final bool isAppbar;
@ -49,7 +55,12 @@ class _ErOptionsState extends State<ErOptions> {
image: 'assets/images/new-design/AM.PNG', image: 'assets/images/new-design/AM.PNG',
text: TranslationBase.of(context).ambulancerequest, text: TranslationBase.of(context).ambulancerequest,
subText: TranslationBase.of(context).requestA, subText: TranslationBase.of(context).requestA,
type: 0, onTap: (){
Navigator.push(
context,
FadePage(
page: AmbulanceReq()));
},
), ),
), ),
@ -58,8 +69,39 @@ class _ErOptionsState extends State<ErOptions> {
image: 'assets/images/new-design/emergency_icon.png', image: 'assets/images/new-design/emergency_icon.png',
text: TranslationBase.of(context).nearester, text: TranslationBase.of(context).nearester,
subText: TranslationBase.of(context).locationa, subText: TranslationBase.of(context).locationa,
type: 1), onTap:(){
Navigator.push(
context,
FadePage(
page: NearestEr()));
}),
)
],
),
),
Container(
margin: EdgeInsets.fromLTRB(0.0, 10.0, 0.0, 10.0),
child: Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Expanded(
child: CardCommonEr(
image: 'assets/images/new-design/AM.PNG',
text:'ED service',
subText: 'ED service',
onTap: (){
Navigator.push(
context,
FadePage(
page: DdServicesPage()));
},
),
),
Expanded(
child: Container(),
) )
], ],
), ),

@ -10,20 +10,18 @@ class CardCommonEr extends StatelessWidget {
final image; final image;
final text; final text;
final subText; final subText;
final type;
final Function onTap;
const CardCommonEr( const CardCommonEr(
{@required this.image, {@required this.image,
@required this.text, @required this.text,
@required this.subText, @required this.subText,
@required this.type}); @required this.onTap});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return GestureDetector( return GestureDetector(
onTap: () { onTap: () => onTap(),
navigateToSearch(context, this.type);
},
child: Container( child: Container(
margin: EdgeInsets.fromLTRB(9.0, 9.0, 9.0, 9.0), margin: EdgeInsets.fromLTRB(9.0, 9.0, 9.0, 9.0),
decoration: BoxDecoration(boxShadow: [ decoration: BoxDecoration(boxShadow: [
@ -59,25 +57,4 @@ class CardCommonEr extends StatelessWidget {
); );
} }
Future navigateToSearch(context, type) async {
//===Switch case===
if(type==0)
{
Navigator.push(
context,
FadePage(
page: AmbulanceReq()));
}
else{
Navigator.push(
context,
FadePage(
page: NearestEr()));
}
}
} }

@ -1,6 +1,8 @@
import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_page.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_page.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/all_habib_medical_service_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/all_habib_medical_service_page.dart';
@ -11,6 +13,7 @@ import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart'; import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart';
import 'package:diplomaticquarterapp/pages/paymentService/payment_service.dart'; import 'package:diplomaticquarterapp/pages/paymentService/payment_service.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -33,6 +36,9 @@ class HomePage extends StatefulWidget {
} }
class _HomePageState extends State<HomePage> { class _HomePageState extends State<HomePage> {
PharmacyModuleViewModel pharmacyModuleViewModel =
locator<PharmacyModuleViewModel>();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
@ -503,8 +509,7 @@ class _HomePageState extends State<HomePage> {
), ),
if (projectViewModel.havePrivilege(65)) if (projectViewModel.havePrivilege(65))
DashboardItem( DashboardItem(
onTap: () => Navigator.push( onTap: () => getPharmacyToken(model),
context, FadePage(page: LandingPagePharmacy())),
child: Center( child: Center(
child: Padding( child: Padding(
padding: const EdgeInsets.all(15.0), padding: const EdgeInsets.all(15.0),
@ -799,10 +804,24 @@ class _HomePageState extends State<HomePage> {
); );
} }
// openBrowser() { getPharmacyToken(DashboardViewModel model) async {
// InAppBrowser browser = new InAppBrowser(); if(!model.isLogin) {
// browser.openUrl(url: "https://uat.hmgwebservices.com/epharmacy/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID=ca9dd276-0a20-4924-a768-fafa9a855ef1&&CustomerId=1367368"); Navigator.push(context, FadePage(page: LandingPagePharmacy()));
// } } else {
GifLoaderDialogUtils.showMyDialog(context);
await pharmacyModuleViewModel.generatePharmacyToken().then((value) async {
if (pharmacyModuleViewModel.error.isNotEmpty) {
await pharmacyModuleViewModel.createUser().then((value) {
GifLoaderDialogUtils.hideDialog(context);
Navigator.push(context, FadePage(page: LandingPagePharmacy()));
});
} else {
GifLoaderDialogUtils.hideDialog(context);
Navigator.push(context, FadePage(page: LandingPagePharmacy()));
}
});
}
}
navigateToCovidDriveThru() { navigateToCovidDriveThru() {
Navigator.push(context, FadePage(page: CovidDrivethruLocation())); Navigator.push(context, FadePage(page: CovidDrivethruLocation()));

@ -185,7 +185,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
if (results[Permission.camera].isGranted) ; if (results[Permission.camera].isGranted) ;
if (results[Permission.photos].isGranted) ; if (results[Permission.photos].isGranted) ;
if (results[Permission.accessMediaLocation].isGranted) ; if (results[Permission.accessMediaLocation].isGranted) ;
if (results[Permission.calendar].isGranted) ; // if (results[Permission.calendar].isGranted) ;
}); });
requestPermissions(); requestPermissions();
// }); // });
@ -327,15 +327,15 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
Permission.photos, Permission.photos,
Permission.notification, Permission.notification,
Permission.accessMediaLocation, Permission.accessMediaLocation,
Permission.calendar, // Permission.calendar,
Permission.activityRecognition Permission.activityRecognition
].request(); ].request();
var permissionsGranted = await deviceCalendarPlugin.hasPermissions(); // var permissionsGranted = await deviceCalendarPlugin.hasPermissions();
if (permissionsGranted.isSuccess && !permissionsGranted.data) { // if (permissionsGranted.isSuccess && !permissionsGranted.data) {
permissionsGranted = await deviceCalendarPlugin.requestPermissions(); // permissionsGranted = await deviceCalendarPlugin.requestPermissions();
if (!permissionsGranted.isSuccess || !permissionsGranted.data) {} // if (!permissionsGranted.isSuccess || !permissionsGranted.data) {}
} // }
return permissionResults; return permissionResults;
} }

@ -658,10 +658,9 @@ class _ConfirmLogin extends State<ConfirmLogin> {
SizedBox( SizedBox(
height: 20, height: 20,
), ),
Texts( Texts(TranslationBase.of(context).verifyWhatsApp,
TranslationBase.of(context).verifyWhatsApp, fontSize: SizeConfig.textMultiplier * 2,
fontSize: SizeConfig.textMultiplier * 2, color: Colors.black)
)
], ],
), ),
))); )));
@ -690,11 +689,10 @@ class _ConfirmLogin extends State<ConfirmLogin> {
: SizedBox( : SizedBox(
height: 20, height: 20,
), ),
Texts( Texts(TranslationBase.of(context).verifySMS,
TranslationBase.of(context).verifySMS, fontSize: SizeConfig.textMultiplier * 2,
fontSize: SizeConfig.textMultiplier * 2, textAlign: TextAlign.center,
textAlign: TextAlign.center, color: Colors.black)
)
], ],
), ),
))); )));
@ -721,10 +719,9 @@ class _ConfirmLogin extends State<ConfirmLogin> {
SizedBox( SizedBox(
height: 20, height: 20,
), ),
Texts( Texts(TranslationBase.of(context).verifyFingerprint,
TranslationBase.of(context).verifyFingerprint, fontSize: SizeConfig.textMultiplier * 2,
fontSize: SizeConfig.textMultiplier * 2, color: Colors.black)
)
], ],
), ),
))); )));
@ -752,10 +749,9 @@ class _ConfirmLogin extends State<ConfirmLogin> {
SizedBox( SizedBox(
height: 20, height: 20,
), ),
Texts( Texts(TranslationBase.of(context).verifyFaceID,
TranslationBase.of(context).verifyFaceID, fontSize: SizeConfig.textMultiplier * 2,
fontSize: SizeConfig.textMultiplier * 2, color: Colors.black)
)
], ],
), ),
))); )));
@ -791,11 +787,10 @@ class _ConfirmLogin extends State<ConfirmLogin> {
: SizedBox( : SizedBox(
height: 20, height: 20,
), ),
Texts( Texts(TranslationBase.of(context).moreVerification,
TranslationBase.of(context).moreVerification, fontSize: SizeConfig.textMultiplier * 1.8,
fontSize: SizeConfig.textMultiplier * 1.8, textAlign: TextAlign.center,
textAlign: TextAlign.center, color: Colors.black)
)
], ],
), ),
))); )));

@ -94,7 +94,7 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
height: 65, height: 65,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(12),
color: Colors.white), color: Theme.of(context).primaryColor),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
@ -125,7 +125,7 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
height: 65, height: 65,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(12),
color: Colors.white), color: Theme.of(context).primaryColor),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
@ -168,7 +168,7 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
height: 65, height: 65,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(12),
color: Colors.white), color: Theme.of(context).primaryColor),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
@ -189,7 +189,7 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
height: 65, height: 65,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(12),
color: Colors.white), color: Theme.of(context).primaryColor),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [

@ -13,12 +13,15 @@ import 'package:hexcolor/hexcolor.dart';
import 'advance_payment_page.dart'; import 'advance_payment_page.dart';
class MyBalancePage extends StatelessWidget { class MyBalancePage extends StatelessWidget {
List<ImagesInfo> imagesInfo = List(); List<ImagesInfo> imagesInfo = List();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/my-balance/en/0.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/my-balance/ar/0.png')); imagesInfo.add(ImagesInfo(
imageEn:
'https://hmgwebservices.com/Images/MobileApp/images-info-home/my-balance/en/0.png',
imageAr:
'https://hmgwebservices.com/Images/MobileApp/images-info-home/my-balance/ar/0.png'));
return BaseView<MyBalanceViewModel>( return BaseView<MyBalanceViewModel>(
onModelReady: (model) => model.getPatientAdvanceBalanceAmount(), onModelReady: (model) => model.getPatientAdvanceBalanceAmount(),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
@ -53,9 +56,9 @@ class MyBalancePage extends StatelessWidget {
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Texts( Texts(
'${model.totalAdvanceBalanceAmount ?? 0} '+ TranslationBase.of(context).sar, '${model.totalAdvanceBalanceAmount ?? 0} ' +
TranslationBase.of(context).sar,
color: Colors.white, color: Colors.white,
bold: true, bold: true,
), ),
@ -76,16 +79,16 @@ class MyBalancePage extends StatelessWidget {
height: 65, height: 65,
margin: EdgeInsets.only(top: 8), margin: EdgeInsets.only(top: 8),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Theme.of(context).primaryColor,
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(7), borderRadius: BorderRadius.circular(7),
), ),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Texts( Texts(
'${model.patientAdvanceBalanceAmountList[index].patientAdvanceBalanceAmount} '+TranslationBase.of(context).sar, '${model.patientAdvanceBalanceAmountList[index].patientAdvanceBalanceAmount} ' +
TranslationBase.of(context).sar,
bold: true, bold: true,
), ),
Texts(model.patientAdvanceBalanceAmountList[index] Texts(model.patientAdvanceBalanceAmountList[index]
@ -94,7 +97,9 @@ class MyBalancePage extends StatelessWidget {
), ),
), ),
), ),
SizedBox(height: MediaQuery.of(context).size.height * 0.13 ,) SizedBox(
height: MediaQuery.of(context).size.height * 0.13,
)
], ],
), ),
), ),

@ -42,38 +42,39 @@ final _mobileFormatter = NumberTextInputFormatter();
class NewTextFields extends StatefulWidget { class NewTextFields extends StatefulWidget {
NewTextFields( NewTextFields(
{Key key, {Key key,
this.type, this.type,
this.hintText, this.hintText,
this.suffixIcon, this.suffixIcon,
this.autoFocus, this.autoFocus,
this.onChanged, this.onChanged,
this.initialValue, this.initialValue,
this.minLines, this.minLines,
this.maxLines, this.maxLines,
this.inputFormatters, this.inputFormatters,
this.padding, this.padding,
this.focus = false, this.focus = false,
this.maxLengthEnforced = true, this.maxLengthEnforced = true,
this.suffixIconColor, this.suffixIconColor,
this.inputAction, this.inputAction,
this.onSubmit, this.onSubmit,
this.keepPadding = true, this.keepPadding = true,
this.textCapitalization = TextCapitalization.none, this.textCapitalization = TextCapitalization.none,
this.controller, this.controller,
this.keyboardType, this.keyboardType,
this.validator, this.validator,
this.borderOnlyError = false, this.borderOnlyError = false,
this.onSaved, this.onSaved,
this.onSuffixTap, this.onSuffixTap,
this.readOnly: false, this.readOnly: false,
this.maxLength, this.maxLength,
this.prefixIcon, this.prefixIcon,
this.bare = false, this.bare = false,
this.onTap, this.onTap,
this.fontSize = 16.0, this.fontSize = 16.0,
this.fontWeight = FontWeight.w700, this.fontWeight = FontWeight.w700,
this.autoValidate = false, this.autoValidate = false,
this.hintColor,this.isEnabled=true}) this.hintColor,
this.isEnabled = true})
: super(key: key); : super(key: key);
final String hintText; final String hintText;
@ -142,7 +143,6 @@ class _NewTextFieldsState extends State<NewTextFields> {
super.dispose(); super.dispose();
} }
bool _determineReadOnly() { bool _determineReadOnly() {
if (widget.readOnly != null && widget.readOnly) { if (widget.readOnly != null && widget.readOnly) {
_focusNode.unfocus(); _focusNode.unfocus();
@ -156,12 +156,11 @@ class _NewTextFieldsState extends State<NewTextFields> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AnimatedContainer( return AnimatedContainer(
duration: Duration(milliseconds: 300), duration: Duration(milliseconds: 300),
decoration:BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(12),
color: Colors.white), color: Theme.of(context).primaryColor),
child: Container( child: Container(
margin: EdgeInsets.only(top: 8), margin: EdgeInsets.only(top: 8),
child: TextFormField( child: TextFormField(
enabled: widget.isEnabled, enabled: widget.isEnabled,
initialValue: widget.initialValue, initialValue: widget.initialValue,
@ -171,10 +170,10 @@ class _NewTextFieldsState extends State<NewTextFields> {
textCapitalization: widget.textCapitalization, textCapitalization: widget.textCapitalization,
onFieldSubmitted: widget.inputAction == TextInputAction.next onFieldSubmitted: widget.inputAction == TextInputAction.next
? (widget.onSubmit != null ? (widget.onSubmit != null
? widget.onSubmit ? widget.onSubmit
: (val) { : (val) {
_focusNode.nextFocus(); _focusNode.nextFocus();
}) })
: widget.onSubmit, : widget.onSubmit,
textInputAction: widget.inputAction, textInputAction: widget.inputAction,
minLines: widget.minLines ?? 1, minLines: widget.minLines ?? 1,
@ -190,45 +189,36 @@ class _NewTextFieldsState extends State<NewTextFields> {
autofocus: widget.autoFocus ?? false, autofocus: widget.autoFocus ?? false,
validator: widget.validator, validator: widget.validator,
onSaved: widget.onSaved, onSaved: widget.onSaved,
style: Theme.of(context).textTheme.body2.copyWith(
style: Theme.of(context) fontSize: widget.fontSize, fontWeight: widget.fontWeight),
.textTheme
.body2
.copyWith(fontSize: widget.fontSize, fontWeight: widget.fontWeight),
inputFormatters: widget.keyboardType == TextInputType.phone inputFormatters: widget.keyboardType == TextInputType.phone
? <TextInputFormatter>[ ? <TextInputFormatter>[
WhitelistingTextInputFormatter.digitsOnly, WhitelistingTextInputFormatter.digitsOnly,
_mobileFormatter, _mobileFormatter,
] ]
: widget.inputFormatters, : widget.inputFormatters,
decoration: InputDecoration( decoration: InputDecoration(
labelText: widget.hintText, labelText: widget.hintText,
labelStyle: TextStyle(color: Colors.black), labelStyle:
TextStyle(color: Theme.of(context).textTheme.bodyText1.color),
errorBorder: OutlineInputBorder( errorBorder: OutlineInputBorder(
borderSide: BorderSide( borderSide: BorderSide(
color: Theme.of(context) color: Theme.of(context).errorColor.withOpacity(0.5),
.errorColor
.withOpacity(0.5),
width: 1.0), width: 1.0),
borderRadius: BorderRadius.circular(12.0)), borderRadius: BorderRadius.circular(12.0)),
focusedErrorBorder: OutlineInputBorder( focusedErrorBorder: OutlineInputBorder(
borderSide: BorderSide( borderSide: BorderSide(
color: Theme.of(context) color: Theme.of(context).errorColor.withOpacity(0.5),
.errorColor
.withOpacity(0.5),
width: 1.0), width: 1.0),
borderRadius: BorderRadius.circular(8.0)), borderRadius: BorderRadius.circular(8.0)),
focusedBorder: OutlineInputBorder( focusedBorder: OutlineInputBorder(
borderSide: borderSide: BorderSide(color: Colors.white, width: 1.0),
BorderSide(color: Colors.white, width: 1.0),
borderRadius: BorderRadius.circular(12)), borderRadius: BorderRadius.circular(12)),
disabledBorder: OutlineInputBorder( disabledBorder: OutlineInputBorder(
borderSide: borderSide: BorderSide(color: Colors.white, width: 1.0),
BorderSide(color: Colors.white, width: 1.0),
borderRadius: BorderRadius.circular(12)), borderRadius: BorderRadius.circular(12)),
enabledBorder: OutlineInputBorder( enabledBorder: OutlineInputBorder(
borderSide: borderSide: BorderSide(color: Colors.white, width: 1.0),
BorderSide(color: Colors.white, width: 1.0),
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(12),
), ),
), ),

File diff suppressed because it is too large Load Diff

@ -28,6 +28,7 @@ class _ProductBrandsPageState extends State<ProductBrandsPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<BrandsViewModel>( return BaseView<BrandsViewModel>(
allowAny: true,
onModelReady: (model) => model.getBrandsData(), onModelReady: (model) => model.getBrandsData(),
builder: (_, model, wi) => AppScaffold( builder: (_, model, wi) => AppScaffold(
appBarTitle: 'Brands page', appBarTitle: 'Brands page',
@ -142,6 +143,7 @@ class _ProductBrandsPageState extends State<ProductBrandsPage> {
topBrand(BuildContext context) { topBrand(BuildContext context) {
return BaseView<BrandsViewModel>( return BaseView<BrandsViewModel>(
allowAny: true,
onModelReady: (model) => model.getTopBrandsData(), onModelReady: (model) => model.getTopBrandsData(),
builder: (_, model, wi) => GridView.count( builder: (_, model, wi) => GridView.count(
crossAxisCount: 4, crossAxisCount: 4,

@ -1,23 +1,22 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/recommendedProduct_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/product_detail_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/product_detail_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/login/welcome.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/compare-list.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scafold_detail_page.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scafold_detail_page.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:rating_bar/rating_bar.dart'; import 'package:rating_bar/rating_bar.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'screens/cart-order-page.dart'; import 'screens/cart-order-page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/compare-list.dart';
int price = 0; int price = 0;
var languageID; var languageID;
@ -30,7 +29,9 @@ PharmacyProduct specificationData;
class ProductDetailPage extends StatefulWidget { class ProductDetailPage extends StatefulWidget {
final PharmacyProduct product; final PharmacyProduct product;
ProductDetailPage(this.product); ProductDetailPage(this.product);
@override @override
__ProductDetailPageState createState() => __ProductDetailPageState(); __ProductDetailPageState createState() => __ProductDetailPageState();
} }
@ -42,8 +43,10 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
bool isAvailabilty = false; bool isAvailabilty = false;
dynamic wishlistItems; dynamic wishlistItems;
var model; var model;
// String ProductId="4561"; // String ProductId="4561";
String productId = ""; String productId = "";
checkWishlist() async { checkWishlist() async {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
ProductDetailViewModel x = new ProductDetailViewModel(); ProductDetailViewModel x = new ProductDetailViewModel();
@ -62,6 +65,7 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
setState(() {}); setState(() {});
} }
void initState() { void initState() {
price = 1; price = 1;
specificationData = widget.product; specificationData = widget.product;
@ -613,21 +617,20 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
Container( Container(
width: 410, width: 410,
height: 50, height: 50,
// margin: EdgeInsets.only(bottom: 5), // margin: EdgeInsets.only(bottom: 5),
color: Colors.white, color: Colors.white,
child: Texts( child: Texts(
TranslationBase.of(context).recommended, TranslationBase.of(context).recommended,
bold: true, bold: true,
), ),
), ),
], ],
), ),
SingleChildScrollView( SingleChildScrollView(
child: Container( child: Container(
color: Colors.white, color: Colors.white,
child: Column( child: Column(
// crossAxisAlignment: CrossAxisAlignment.start, // crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
// mainAxisSize: MainAxisSize.min, // mainAxisSize: MainAxisSize.min,
children: [ children: [
@ -636,208 +639,252 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
height: 210, height: 210,
margin: EdgeInsets.only(bottom: 75), margin: EdgeInsets.only(bottom: 75),
padding: EdgeInsets.only(bottom: 5), padding: EdgeInsets.only(bottom: 5),
// margin: EdgeInsets.symmetric(horizontal: 6, vertical: 4), // margin: EdgeInsets.symmetric(horizontal: 6, vertical: 4),
child: BaseView<PharmacyModuleViewModel>( child: BaseView<PharmacyModuleViewModel>(
onModelReady: (model) => onModelReady: (model) =>
model.getRecommendedProducts(widget.product.id.toString()), model.getRecommendedProducts(
builder: (_, model, wi) => widget.product.id.toString()),
Container( builder: (_, model, wi) => Container(
child: child:
// Text(model.recommendedProductList[0].id), // Text(model.recommendedProductList[0].id),
model.recommendedProductList.length != null model.recommendedProductList.length !=
? Expanded( null
child: ListView.builder( ? Expanded(
scrollDirection: Axis.horizontal, child: ListView.builder(
shrinkWrap: true, scrollDirection:
physics: ScrollPhysics(), Axis.horizontal,
// physics: NeverScrollableScrollPhysics(), shrinkWrap: true,
itemCount: model.recommendedProductList.length, physics: ScrollPhysics(),
itemBuilder: (context, index) { // physics: NeverScrollableScrollPhysics(),
return Card( itemCount: model
elevation: 2, .recommendedProductList
shape: RoundedRectangleBorder( .length,
side: BorderSide( itemBuilder:
color: Colors.grey[300], width: 2), (context, index) {
borderRadius: BorderRadius.circular(10)), return Card(
margin: EdgeInsets.symmetric( elevation: 2,
horizontal: 8, shape: RoundedRectangleBorder(
vertical: 0, side: BorderSide(
), color: Colors
child: Container( .grey[
decoration: BoxDecoration( 300],
borderRadius: BorderRadius.all( width: 2),
Radius.circular(15), borderRadius:
), BorderRadius
), .circular(
padding: EdgeInsets.symmetric(horizontal: 4), 10)),
width: MediaQuery.of(context).size.width / 3, margin: EdgeInsets
child: Column( .symmetric(
crossAxisAlignment: horizontal: 8,
CrossAxisAlignment.start, vertical: 0,
children: [
Stack(children: [
Container(
child: Align(
alignment: Alignment.topRight,
child: //true
itemID.contains(model.recommendedProductList[index].id)
// !isInWishlist
? IconButton(
icon: Icon(Icons
.favorite_border),
color: Colors.grey,
iconSize: 30,
onPressed: () {
setState(() {
addToWishlistFunction(itemID);
});
},
)
: IconButton(
icon: Icon(
Icons.favorite),
color: Colors.red,
iconSize: 30,
onPressed: () {
setState(() {
deleteFromWishlistFunction(itemID);
});
},
)
//
), ),
), child: Container(
Container( decoration:
margin: EdgeInsets.fromLTRB( BoxDecoration(
0, 16, 10, 16), borderRadius:
alignment: Alignment.center, BorderRadius
.all(
Radius.circular(
15),
),
),
padding: EdgeInsets
.symmetric(
horizontal:
4),
width: MediaQuery.of(
context)
.size
.width /
3,
child: Column(
crossAxisAlignment:
CrossAxisAlignment
.start,
children: [
Stack(
children: [
Container(
child: Align(
alignment: Alignment.topRight,
child: //true
itemID.contains(model.recommendedProductList[index].id)
// !isInWishlist
? IconButton(
icon: Icon(Icons.favorite_border),
color: Colors.grey,
iconSize: 30,
onPressed: () {
setState(() {
addToWishlistFunction(itemID);
});
},
)
: IconButton(
icon: Icon(Icons.favorite),
color: Colors.red,
iconSize: 30,
onPressed: () {
setState(() {
deleteFromWishlistFunction(itemID);
});
},
)
//
),
),
Container(
margin: EdgeInsets.fromLTRB(
0,
16,
10,
16),
alignment:
Alignment.center,
// padding: EdgeInsets.only(left: 25, bottom: 20), // padding: EdgeInsets.only(left: 25, bottom: 20),
child: (model.recommendedProductList[index].images != null && child: (model.recommendedProductList[index].images != null &&
model.recommendedProductList[index].images.length > 0) model.recommendedProductList[index].images.length > 0)
? Image.network( ? Image.network(
model.recommendedProductList[index].images[0].src.toString(), model.recommendedProductList[index].images[0].src.toString(),
// item.images[0].src, // item.images[0].src,
fit: BoxFit.cover, fit: BoxFit.cover,
height: 60, height: 60,
) )
: Image.asset( : Image.asset(
"assets/images/no_image.png", "assets/images/no_image.png",
fit: BoxFit.cover, fit: BoxFit.cover,
height: 60, height: 60,
), ),
), ),
Container( Container(
width: model width: model.recommendedProductList[index].rxMessage !=
.recommendedProductList[ null
index] ? MediaQuery.of(context).size.width /
.rxMessage != 5
null : 0,
? MediaQuery.of(context) padding:
.size EdgeInsets.all(4),
.width / decoration:
5 BoxDecoration(
: 0, color:
padding: EdgeInsets.all(4), Color(0xffb23838),
decoration: BoxDecoration( borderRadius:
color: Color(0xffb23838), BorderRadius.only(topLeft: Radius.circular(6)),
borderRadius: BorderRadius.only( ),
topLeft: Radius.circular(6)), child:
), Texts(
child: Texts( model.recommendedProductList[index].rxMessage != null
model.recommendedProductList[index] ? model.recommendedProductList[index].rxMessage
.rxMessage != : "",
null color:
? model Colors.white,
.recommendedProductList[ regular:
index] true,
.rxMessage fontSize:
: "", 10,
color: Colors.white, fontWeight:
regular: true, FontWeight.w400,
fontSize: 10, ),
fontWeight: FontWeight.w400, ),
), ]),
), Container(
]), margin: EdgeInsets
Container( .symmetric(
margin: EdgeInsets.symmetric( horizontal:
horizontal: 6, 6,
vertical: 0, vertical: 0,
), ),
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment
children: [ .start,
Text( children: [
languageID == "ar" Text(
? model.recommendedProductList[index].namen languageID ==
: model.recommendedProductList[index].name, "ar"
style: TextStyle( ? model.recommendedProductList[index].namen
color: Colors.black, : model.recommendedProductList[index].name,
fontSize: 13.0, style:
TextStyle(
color:
Colors.black,
fontSize:
13.0,
// fontWeight: FontWeight.bold, // fontWeight: FontWeight.bold,
), ),
), ),
Padding( Padding(
// padding: const EdgeInsets.only(top: 15, bottom: 10), // padding: const EdgeInsets.only(top: 15, bottom: 10),
padding: const EdgeInsets.only( padding: const EdgeInsets.only(
top: 10, bottom: 5), top:
child: Texts( 10,
"SAR ${model.recommendedProductList[index].price}", bottom:
bold: true, 5),
fontSize: 14, child:
), Texts(
), "SAR ${model.recommendedProductList[index].price}",
], bold:
), true,
), fontSize:
Row( 14,
crossAxisAlignment: ),
CrossAxisAlignment.start, ),
children: <Widget>[ ],
Container( ),
padding: ),
EdgeInsets.only(right: 10), Row(
crossAxisAlignment:
CrossAxisAlignment
.start,
children: <
Widget>[
Container(
padding:
EdgeInsets.only(right: 10),
// margin: EdgeInsets.only(left: 5), // margin: EdgeInsets.only(left: 5),
child: Align( child:
alignment: Alignment.topLeft, Align(
child: RatingBar.readOnly( alignment:
initialRating: model Alignment.topLeft,
.recommendedProductList[ child:
index] RatingBar.readOnly(
.approvedRatingSum initialRating:
.toDouble(), model.recommendedProductList[index].approvedRatingSum.toDouble(),
// initialRating: productRate, // initialRating: productRate,
size: 13.0, size:
filledColor: 13.0,
Colors.yellow[700], filledColor:
emptyColor: Colors.grey[500], Colors.yellow[700],
isHalfAllowed: true, emptyColor:
halfFilledIcon: Colors.grey[500],
Icons.star_half, isHalfAllowed:
filledIcon: Icons.star, true,
emptyIcon: Icons.star, halfFilledIcon:
), Icons.star_half,
), filledIcon:
), Icons.star,
Texts( emptyIcon:
"(${model.recommendedProductList[index].approvedTotalReviews.toString()})", Icons.star,
),
),
),
Texts(
"(${model.recommendedProductList[index].approvedTotalReviews.toString()})",
// bold: true, // bold: true,
fontSize: 12, fontSize:
12,
),
]),
],
), ),
]), ),
], );
), }),
), )
); : Container(
}),
)
: Container(
// child: Text("NO DATA"), // child: Text("NO DATA"),
), ),
) )),
),
), ),
], ],
), ),
@ -1341,8 +1388,10 @@ class footerWidget extends StatefulWidget {
final int minQuantity; final int minQuantity;
final int quantityLimit; final int quantityLimit;
final PharmacyProduct item; final PharmacyProduct item;
footerWidget(this.isAvailble, this.maxQuantity, this.minQuantity, footerWidget(this.isAvailble, this.maxQuantity, this.minQuantity,
this.quantityLimit, this.item); this.quantityLimit, this.item);
@override @override
_footerWidgetState createState() => _footerWidgetState(); _footerWidgetState createState() => _footerWidgetState();
} }
@ -1350,6 +1399,7 @@ class footerWidget extends StatefulWidget {
class _footerWidgetState extends State<footerWidget> { class _footerWidgetState extends State<footerWidget> {
double quantityUI = 70; double quantityUI = 70;
bool showUI = false; bool showUI = false;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
@ -1752,7 +1802,7 @@ class _footerWidgetState extends State<footerWidget> {
) )
: InkWell( : InkWell(
onTap: () { onTap: () {
addToCartFunction(price, widget.item.id); addToCartFunction(price, widget.item.id, context);
}, },
child: Container( child: Container(
alignment: Alignment.center, alignment: Alignment.center,
@ -1792,11 +1842,10 @@ class _footerWidgetState extends State<footerWidget> {
: InkWell( : InkWell(
onTap: () { onTap: () {
print('buy now'); print('buy now');
addToCartFunction(price, widget.item.id); addToCartFunction(price, widget.item.id, context);
Navigator.push( Navigator.push(
context, context,
FadePage(page: FadePage(page: CartOrderPage()),
CartOrderPage()),
); );
}, },
child: Container( child: Container(
@ -1824,7 +1873,9 @@ class _footerWidgetState extends State<footerWidget> {
class productNameAndPrice extends StatefulWidget { class productNameAndPrice extends StatefulWidget {
BuildContext context; BuildContext context;
PharmacyProduct item; PharmacyProduct item;
productNameAndPrice(this.context, this.item); productNameAndPrice(this.context, this.item);
@override @override
_productNameAndPriceState createState() => _productNameAndPriceState(); _productNameAndPriceState createState() => _productNameAndPriceState();
} }
@ -2014,9 +2065,12 @@ getSpecificationData(itemID) async {
specificationData = await x.productSpecificationData(itemID); specificationData = await x.productSpecificationData(itemID);
} }
addToCartFunction(quantity, itemID) async { addToCartFunction(quantity, itemID, BuildContext context) async {
GifLoaderDialogUtils.showMyDialog(context);
ProductDetailViewModel x = new ProductDetailViewModel(); ProductDetailViewModel x = new ProductDetailViewModel();
await x.addToCartData(quantity, itemID); await x.addToCartData(quantity, itemID).then((value) {
GifLoaderDialogUtils.hideDialog(context);
});
} }
notifyMeWhenAvailable(context, itemId) async { notifyMeWhenAvailable(context, itemId) async {
@ -2071,7 +2125,7 @@ settingModalBottomSheet(context) {
title: Text('Add to cart'), title: Text('Add to cart'),
onTap: () => { onTap: () => {
if (price > 0) if (price > 0)
{addToCartFunction(price, itemID)} {addToCartFunction(price, itemID, context)}
else else
{ {
AppToast.showErrorToast( AppToast.showErrorToast(

@ -1,3 +1,4 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/Addresses.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/Addresses.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/ShoppingCartResponse.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/ShoppingCartResponse.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart';
@ -7,6 +8,7 @@ import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-order-preview
import 'package:diplomaticquarterapp/pages/pharmacies/screens/pharmacy-terms-conditions-page.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/pharmacy-terms-conditions-page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/widgets/ProductOrderItem.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/widgets/ProductOrderItem.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/buttons/GestureIconButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/GestureIconButton.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -32,7 +34,7 @@ class CartOrderPage extends StatelessWidget {
baseViewModel: model, baseViewModel: model,
backgroundColor: Colors.white, backgroundColor: Colors.white,
body: !(model.cartResponse.shoppingCarts == null || body: !(model.cartResponse.shoppingCarts == null ||
model.cartResponse.shoppingCarts.length == 0) model.cartResponse.shoppingCarts.length == 0)
? Container( ? Container(
height: height * 0.85, height: height * 0.85,
width: double.infinity, width: double.infinity,
@ -70,8 +72,16 @@ class CartOrderPage extends StatelessWidget {
cart.shoppingCarts[index], () { cart.shoppingCarts[index], () {
print(cart.shoppingCarts[index] print(cart.shoppingCarts[index]
.quantity); .quantity);
model.changeProductQuantity( model
cart.shoppingCarts[index]); .changeProductQuantity(
cart.shoppingCarts[index])
.then((value) {
if (model.state ==
ViewState.ErrorLocal) {
Utils.showErrorToast(
model.error);
}
});
}, },
() => model.deleteProduct( () => model.deleteProduct(
cart.shoppingCarts[index]))) cart.shoppingCarts[index])))
@ -246,64 +256,62 @@ class _OrderBottomWidgetState extends State<OrderBottomWidget> {
height: widget.height * 0.070, height: widget.height * 0.070,
color: Color(0xffe6ffe0), color: Color(0xffe6ffe0),
padding: EdgeInsets.symmetric(horizontal: 4), padding: EdgeInsets.symmetric(horizontal: 4),
child: Expanded( child: Row(
child: Row( children: [
children: [ InkWell(
InkWell( onTap: () {
onTap: () { setState(() {
setState(() { isAgree = !isAgree;
isAgree = !isAgree; });
}); },
}, child: Container(
child: Container( width: 25.0,
width: 25.0, height: widget.height * 0.070,
height: widget.height * 0.070, decoration: new BoxDecoration(
decoration: new BoxDecoration( color: !isAgree
color: !isAgree ? Color(0xffeeeeee)
? Color(0xffeeeeee) : Colors.green,
: Colors.green, shape: BoxShape.circle,
shape: BoxShape.circle, ),
child: !isAgree
? null
: Padding(
padding: const EdgeInsets.all(0.0),
child: Icon(
Icons.check,
color: Colors.white,
size: 25,
), ),
child: !isAgree
? null
: Padding(
padding: const EdgeInsets.all(0.0),
child: Icon(
Icons.check,
color: Colors.white,
size: 25,
),
),
), ),
), ),
Expanded( ),
child: Container( Expanded(
padding: EdgeInsets.symmetric(horizontal: 4), child: Container(
margin: const EdgeInsets.symmetric(vertical: 4), padding: EdgeInsets.symmetric(horizontal: 4),
child: Texts( margin: const EdgeInsets.symmetric(vertical: 4),
TranslationBase.of(context) child: Texts(
.pharmacyServiceTermsCondition, TranslationBase.of(context)
fontSize: 13, .pharmacyServiceTermsCondition,
color: Colors.grey.shade800, fontSize: 13,
fontWeight: FontWeight.normal, color: Colors.grey.shade800,
), fontWeight: FontWeight.normal,
), ),
), ),
InkWell( ),
onTap: () => { InkWell(
Navigator.push(context, onTap: () => {
FadePage(page: PharmacyTermsConditions())) Navigator.push(context,
}, FadePage(page: PharmacyTermsConditions()))
child: Container( },
child: Icon( child: Container(
Icons.info, child: Icon(
size: 25, Icons.info,
color: Color(0xff005aff), size: 25,
), color: Color(0xff005aff),
), ),
), ),
], ),
), ],
), ),
), ),
Container( Container(

File diff suppressed because it is too large Load Diff

@ -72,7 +72,7 @@ class _ProductOrderItemState extends State<ProductOrderItem> {
child: Texts( child: Texts(
projectProvider.isArabic projectProvider.isArabic
? widget.item.product.namen ? widget.item.product.namen
: widget.item.product.name, : "${widget.item.product.name}",
regular: true, regular: true,
textAlign: TextAlign.justify, textAlign: TextAlign.justify,
fontSize: 12, fontSize: 12,
@ -88,91 +88,90 @@ class _ProductOrderItemState extends State<ProductOrderItem> {
), ),
margin: const EdgeInsets.only(bottom: 4), margin: const EdgeInsets.only(bottom: 4),
), ),
Row( Container(
children: [ margin: EdgeInsets.symmetric(vertical: 4),
InkWell( child: Row(
onTap: () => children: [
{_quantityOnChangeClick(Operation.dec)}, InkWell(
child: Container( onTap: () =>
width: 25, {_quantityOnChangeClick(Operation.dec)},
height: 25, child: Container(
child: Center( width: 25,
child: Texts( height: 25,
"-", child: Icon(
color: Colors.grey.shade400, Icons.remove, color: Colors.grey.shade400, size: 20,
)), ),
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border.all( border: Border.all(
color: Colors.grey.shade400, color: Colors.grey.shade400,
width: 1.0, width: 1.0,
),
), ),
), ),
), ),
), Container(
Container( margin:
margin: const EdgeInsets.symmetric(horizontal: 4),
const EdgeInsets.symmetric(horizontal: 4),
width: 25,
height: 25,
color: Colors.grey.shade300,
child: Center(
child: TextField(
cursorColor: Colors.black,
keyboardType: TextInputType.number,
controller: _quantityController,
textAlign: TextAlign.center,
onChanged: (text) {
setState(() {
var value = int.tryParse(text);
if (value == null) {
widget.item.quantity = 0;
} else {
widget.item.quantity = int.parse(text);
}
_totalPrice =
"${(widget.item.product.price * widget.item.quantity).toStringAsFixed(2)}";
});
},
)),
),
InkWell(
onTap: () =>
{_quantityOnChangeClick(Operation.inc)},
child: Container(
width: 25, width: 25,
height: 25, height: 25,
color: Colors.grey.shade300,
child: Center( child: Center(
child: Texts( child: TextField(
"+", cursorColor: Colors.black,
color: Colors.grey.shade400, keyboardType: TextInputType.number,
controller: _quantityController,
textAlign: TextAlign.center,
onChanged: (text) {
setState(() {
var value = int.tryParse(text);
if (value == null) {
widget.item.quantity = 0;
} else {
widget.item.quantity = int.parse(text);
}
_totalPrice =
"${(widget.item.product.price * widget.item.quantity).toStringAsFixed(2)}";
});
},
)), )),
decoration: BoxDecoration(
border: Border.all(
color: Colors.grey.shade400,
width: 1.0,
),
),
), ),
), InkWell(
Expanded( onTap: () =>
child: Column( {_quantityOnChangeClick(Operation.inc)},
crossAxisAlignment: CrossAxisAlignment.end, child: Container(
children: [ width: 25,
Texts( height: 25,
TranslationBase.of(context).total, child: Icon(
color: Colors.grey.shade500, Icons.add, color: Colors.grey.shade400, size: 20,
fontWeight: FontWeight.bold, ),
fontSize: 12, decoration: BoxDecoration(
border: Border.all(
color: Colors.grey.shade400,
width: 1.0,
),
), ),
Texts( ),
"$_totalPrice ${projectProvider.isArabic ? widget.item.currencyn : widget.item.currency}",
fontSize: 12,
fontWeight: FontWeight.bold,
)
],
), ),
) Expanded(
], child: Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Texts(
TranslationBase.of(context).total,
color: Colors.grey.shade500,
fontWeight: FontWeight.bold,
fontSize: 12,
),
Texts(
"$_totalPrice ${projectProvider.isArabic ? widget.item.currencyn : widget.item.currency}",
fontSize: 12,
fontWeight: FontWeight.bold,
)
],
),
)
],
),
) )
], ],
), ),

@ -104,7 +104,17 @@ class _PharmacyCategorisePageState extends State<PharmacyCategorisePage> {
child: Padding( child: Padding(
padding: EdgeInsets.all(4.0), padding: EdgeInsets.all(4.0),
child: InkWell( child: InkWell(
onTap: () {}, onTap: () {
Navigator.push(
context,
FadePage(
page: FinalProductsPage(
id: "",
productType: 4,
),
),
);
},
child: Container( child: Container(
height: 50.0, height: 50.0,
width: 55.0, width: 55.0,
@ -181,7 +191,15 @@ class _PharmacyCategorisePageState extends State<PharmacyCategorisePage> {
padding: EdgeInsets.all(4.0), padding: EdgeInsets.all(4.0),
child: InkWell( child: InkWell(
onTap: () { onTap: () {
// _scanQrAndGetPatient(context, model); Navigator.push(
context,
FadePage(
page: FinalProductsPage(
id: "",
productType: 3,
),
),
);
}, },
child: Container( child: Container(
height: 50.0, height: 50.0,

@ -1,9 +1,11 @@
import 'package:diplomaticquarterapp/core/model/pharmacy/categorise_parent_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacy_categorise_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacy_categorise_view_model.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/product_detail.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/product_detail.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/StarRating.dart'; import 'package:diplomaticquarterapp/widgets/others/StarRating.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_pharmacy_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_pharmacy_widget.dart';
import 'package:diplomaticquarterapp/widgets/others/entity_checkbox_list.dart';
import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart'; import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -40,9 +42,12 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
color: Colors.blue, color: Colors.blue,
size: 29.0, size: 29.0,
); );
List<CategoriseParentModel> entityList = List();
List<CategoriseParentModel> entityListBrands = List();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
TextEditingController minField = TextEditingController();
TextEditingController maxField = TextEditingController();
return BaseView<PharmacyCategoriseViewModel>( return BaseView<PharmacyCategoriseViewModel>(
onModelReady: (model) => model.getSubCategorise(i: id), onModelReady: (model) => model.getSubCategorise(i: id),
builder: (BuildContext context, PharmacyCategoriseViewModel model, builder: (BuildContext context, PharmacyCategoriseViewModel model,
@ -56,7 +61,6 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
baseViewModel: model, baseViewModel: model,
body: SingleChildScrollView( body: SingleChildScrollView(
child: Container( child: Container(
height: MediaQuery.of(context).size.height * 5.97,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -282,6 +286,7 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
return SingleChildScrollView( return SingleChildScrollView(
controller: scrollController, controller: scrollController,
child: Container( child: Container(
color: Colors.white,
height: MediaQuery.of(context) height: MediaQuery.of(context)
.size .size
.height * .height *
@ -333,45 +338,34 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
title: title:
Texts('Categorise'), Texts('Categorise'),
children: [ children: [
Container( ProcedureListWidget(
height: 350, model: model,
child: ListView masterList: model
.builder( .subCategorise,
controller: removeHistory:
scrollController, (item) {
scrollDirection: setState(() {
Axis entityList
.vertical, .remove(
shrinkWrap: item);
true, });
itemCount: model },
.categoriseParent addHistory:
.length, (history) {
itemBuilder: setState(() {
(BuildContext entityList.add(
context, history);
int index) { });
return CheckboxListTile( },
tristate: addSelectedHistories:
true, () {
title: Texts(model //TODO build your fun herr
.categoriseParent[index] // widget.addSelectedHistories();
.name), },
controlAffinity: isEntityListSelected:
ListTileControlAffinity.leading, (master) =>
value: isEntityListSelected(
checkedCategorise, master),
onChanged:
(bool
value) {
setState(
() {
checkedCategorise =
value;
});
},
);
}),
) )
], ],
), ),
@ -382,45 +376,35 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
ExpansionTile( ExpansionTile(
title: Texts('Brands'), title: Texts('Brands'),
children: [ children: [
Container( ProcedureListWidget(
height: 350, model: model,
child: ListView masterList: model
.builder( .brandsList,
scrollDirection: removeHistory:
Axis (item) {
.vertical, setState(() {
shrinkWrap: entityListBrands
true, .remove(
itemCount: model item);
.brandsList });
.length, },
itemBuilder: addHistory:
(BuildContext (history) {
context, setState(() {
int index) { entityListBrands
return CheckboxListTile( .add(
tristate: history);
true, });
title: Texts(model },
.brandsList[index] addSelectedHistories:
.name), () {
controlAffinity: //TODO build your fun herr
ListTileControlAffinity.leading, // widget.addSelectedHistories();
value: },
checkedBrands, isEntityListSelected:
onChanged: (master) =>
(bool isEntityListSelectedBrands(
value) { master),
setState(
() {
checkedBrands =
value;
});
},
autofocus:
true,
);
}),
) )
], ],
), ),
@ -460,6 +444,8 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
border: border:
OutlineInputBorder(), OutlineInputBorder(),
), ),
controller:
minField,
), ),
), ),
], ],
@ -485,6 +471,8 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
border: border:
OutlineInputBorder(), OutlineInputBorder(),
), ),
controller:
maxField,
), ),
), ),
], ],
@ -527,6 +515,50 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
Container( Container(
width: 200, width: 200,
child: Button( child: Button(
onTap: () {
String
categoriesId =
"";
for (CategoriseParentModel category
in entityList) {
if (categoriesId ==
"") {
categoriesId =
category
.id;
} else {
categoriesId =
"$categoriesId,${category.id}";
}
}
String
brandIds =
"";
for (CategoriseParentModel brand
in entityListBrands) {
if (brandIds ==
"") {
brandIds =
brand
.id;
} else {
brandIds =
"$brandIds,${brand.id}";
}
}
model.getFilteredProducts(
min: minField
.text
.toString(),
max: maxField
.text
.toString(),
categoryId:
categoriesId,
brandId:
brandIds);
},
label: 'Apply', label: 'Apply',
backgroundColor: backgroundColor:
Colors Colors
@ -596,7 +628,9 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
), ),
styleOne == true styleOne == true
? Container( ? Container(
height: MediaQuery.of(context).size.height * 3.85, height: model.subProducts.length *
MediaQuery.of(context).size.height *
0.15,
child: GridView.builder( child: GridView.builder(
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
gridDelegate: gridDelegate:
@ -604,7 +638,7 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
crossAxisCount: 2, crossAxisCount: 2,
crossAxisSpacing: 0.5, crossAxisSpacing: 0.5,
mainAxisSpacing: 2.0, mainAxisSpacing: 2.0,
childAspectRatio: 1.0, childAspectRatio: 0.9,
), ),
itemCount: model.subProducts.length, itemCount: model.subProducts.length,
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
@ -798,7 +832,9 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
), ),
) )
: Container( : Container(
height: MediaQuery.of(context).size.height * 5.0, height: model.subProducts.length *
MediaQuery.of(context).size.height *
0.122,
child: ListView.builder( child: ListView.builder(
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
itemCount: model.subProducts.length, itemCount: model.subProducts.length,
@ -991,4 +1027,22 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
), ),
)); ));
} }
bool isEntityListSelected(CategoriseParentModel masterKey) {
Iterable<CategoriseParentModel> history =
entityList.where((element) => masterKey.id == element.id);
if (history.length > 0) {
return true;
}
return false;
}
bool isEntityListSelectedBrands(CategoriseParentModel masterKey) {
Iterable<CategoriseParentModel> history =
entityListBrands.where((element) => masterKey.id == element.id);
if (history.length > 0) {
return true;
}
return false;
}
} }

@ -88,7 +88,7 @@ class ProductDetailService extends BaseService {
"language_id": 1 "language_id": 1
} }
}; };
await baseAppClient.pharmacyPost(GET_SHOPPING_CART, await baseAppClient.pharmacyPost(GET_SHOPPING_CART, isExternal: false,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
_addToCartModel.clear(); _addToCartModel.clear();
response['shopping_carts'].forEach((item) { response['shopping_carts'].forEach((item) {

@ -36,6 +36,7 @@ defaultTheme({fontName}) {
highlightColor: Colors.grey[100].withOpacity(0.4), highlightColor: Colors.grey[100].withOpacity(0.4),
splashColor: Colors.transparent, splashColor: Colors.transparent,
primaryColor: Color(0xffffffff), primaryColor: Color(0xffffffff),
buttonColor: Colors.black,
toggleableActiveColor: secondaryColor, toggleableActiveColor: secondaryColor,
indicatorColor: secondaryColor, indicatorColor: secondaryColor,
bottomSheetTheme: bottomSheetTheme:
@ -86,6 +87,7 @@ invertThemes({fontName}) {
highlightColor: Colors.grey[100].withOpacity(0.4), highlightColor: Colors.grey[100].withOpacity(0.4),
splashColor: Colors.transparent, splashColor: Colors.transparent,
primaryColor: Color(0xff515A5D), primaryColor: Color(0xff515A5D),
buttonColor: Colors.black,
toggleableActiveColor: secondaryColor, toggleableActiveColor: secondaryColor,
indicatorColor: secondaryColor, indicatorColor: secondaryColor,
bottomSheetTheme: bottomSheetTheme:

@ -1394,9 +1394,12 @@ class TranslationBase {
String get convertFrom => localizedValues["convertFrom"][locale.languageCode]; String get convertFrom => localizedValues["convertFrom"][locale.languageCode];
String get result => localizedValues["result"][locale.languageCode]; String get result => localizedValues["result"][locale.languageCode];
String get sort => localizedValues["sort"][locale.languageCode]; String get sort => localizedValues["sort"][locale.languageCode];
String get bloodSugarConversion => localizedValues["bloodSugarConversion"][locale.languageCode]; String get bloodSugarConversion =>
String get convertCholesterolStatement => localizedValues["convertCholesterolStatement"][locale.languageCode]; localizedValues["bloodSugarConversion"][locale.languageCode];
String get triglyceridesConvertStatement => localizedValues["triglyceridesConvertStatement"][locale.languageCode]; String get convertCholesterolStatement =>
localizedValues["convertCholesterolStatement"][locale.languageCode];
String get triglyceridesConvertStatement =>
localizedValues["triglyceridesConvertStatement"][locale.languageCode];
String get bloodDEnterDesc => String get bloodDEnterDesc =>
localizedValues["bloodD-enter-desc"][locale.languageCode]; localizedValues["bloodD-enter-desc"][locale.languageCode];
String get viewTermsConditions => String get viewTermsConditions =>
@ -1570,6 +1573,21 @@ class TranslationBase {
String get shippingAddresss => String get shippingAddresss =>
localizedValues["shipping-address"][locale.languageCode]; localizedValues["shipping-address"][locale.languageCode];
String get covidAlert => localizedValues["covid-alert"][locale.languageCode]; String get covidAlert => localizedValues["covid-alert"][locale.languageCode];
String get pharmacyRelogin => localizedValues["pharmacy-relogin"][locale.languageCode];
String get onlineCheckInAgreement => localizedValues["onlineCheckInAgreement"][locale.languageCode];
String get chiefComplaints => localizedValues["chiefComplaints"][locale.languageCode];
String get errorChiefComplaints => localizedValues["errorChiefComplaints"][locale.languageCode];
String get expectedArrivalTime => localizedValues["expectedArrivalTime"][locale.languageCode];
String get errorExpectedArrivalTime => localizedValues["errorExpectedArrivalTimes"][locale.languageCode];
String get anicllaryOrders =>
localizedValues["ancillary-orders"][locale.languageCode];
String get mrn => localizedValues["MRN"][locale.languageCode];
String get appointmentDate =>
localizedValues["appointment-date"][locale.languageCode];
String get appointmentNo =>
localizedValues["appointment-no"][locale.languageCode];
String get insuranceID =>
localizedValues["insurance-id"][locale.languageCode];
} }
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> { class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -18,7 +18,8 @@ class BottomNavigationItem extends StatelessWidget {
final int currentIndex; final int currentIndex;
final String name; final String name;
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>(); AuthenticatedUserObject authenticatedUserObject =
locator<AuthenticatedUserObject>();
BottomNavigationItem( BottomNavigationItem(
{this.icon, {this.icon,
@ -52,7 +53,7 @@ class BottomNavigationItem extends StatelessWidget {
child: Icon(currentIndex == index ? activeIcon : icon, child: Icon(currentIndex == index ? activeIcon : icon,
color: currentIndex == index color: currentIndex == index
? secondaryColor ? secondaryColor
: Theme.of(context).dividerColor, : Colors.grey,
size: 22.0), size: 22.0),
), ),
SizedBox( SizedBox(

@ -22,7 +22,7 @@ class SecondaryButton extends StatefulWidget {
this.label = "", this.label = "",
this.icon, this.icon,
this.iconOnly = false, this.iconOnly = false,
this.color , this.color,
this.textColor = Colors.white, this.textColor = Colors.white,
this.onTap, this.onTap,
this.loading: false, this.loading: false,
@ -144,8 +144,10 @@ class _SecondaryButtonState extends State<SecondaryButton>
onTapCancel: () { onTapCancel: () {
_animationController.forward(); _animationController.forward();
}, },
onTap: () =>{ widget.disabled ? null : widget.onTap(), }, onTap: () => {
// onTap: widget.disabled?null:Feedback.wrapForTap(widget.onTap, context), widget.disabled ? null : widget.onTap(),
},
// onTap: widget.disabled?null:Feedback.wrapForTap(widget.onTap, context),
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,
child: Transform.scale( child: Transform.scale(
scale: _buttonSize, scale: _buttonSize,
@ -177,8 +179,9 @@ class _SecondaryButtonState extends State<SecondaryButton>
width: MediaQuery.of(context).size.width, width: MediaQuery.of(context).size.width,
height: 100, height: 100,
decoration: BoxDecoration( decoration: BoxDecoration(
color: widget.disabled? Colors.grey: widget.color ?? Theme.of(context).primaryColor, color: widget.disabled
), ? Colors.grey
: widget.color ?? Theme.of(context).buttonColor),
), ),
), ),
Positioned( Positioned(
@ -191,7 +194,9 @@ class _SecondaryButtonState extends State<SecondaryButton>
height: MediaQuery.of(context).size.width * 2.2, height: MediaQuery.of(context).size.width * 2.2,
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.circle, shape: BoxShape.circle,
color: widget.disabled? Colors.grey: widget.color ?? Theme.of(context).primaryColor, color: widget.disabled
? Colors.grey
: widget.color ?? Theme.of(context).buttonColor,
), ),
), ),
), ),
@ -237,8 +242,10 @@ class _SecondaryButtonState extends State<SecondaryButton>
style: TextStyle( style: TextStyle(
color: widget.textColor, color: widget.textColor,
fontSize: widget.small ? 12.0 : 15.0, fontSize: widget.small ? 12.0 : 15.0,
// fontWeight: FontWeight.w800, // fontWeight: FontWeight.w800,
fontFamily: projectViewModel.isArabic ? 'Cairo' : 'WorkSans'), fontFamily: projectViewModel.isArabic
? 'Cairo'
: 'WorkSans'),
), ),
) )
], ],

@ -15,7 +15,7 @@ class ServicesContainer extends StatelessWidget {
height: 60, height: 60,
margin: EdgeInsets.all(8), margin: EdgeInsets.all(8),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Theme.of(context).primaryColor,
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(7), borderRadius: BorderRadius.circular(7),
), ),

@ -203,7 +203,10 @@ class _TextsState extends State<Texts> {
Stack( Stack(
children: <Widget>[ children: <Widget>[
Text( Text(
!hidden ? text : (text.substring(0, !hidden
? text
: (text.substring(
0,
text.length > widget.maxLength text.length > widget.maxLength
? widget.maxLength ? widget.maxLength
: text.length)), : text.length)),
@ -217,13 +220,16 @@ class _TextsState extends State<Texts> {
style: widget.style != null style: widget.style != null
? _getFontStyle().copyWith( ? _getFontStyle().copyWith(
fontStyle: widget.italic ? FontStyle.italic : null, fontStyle: widget.italic ? FontStyle.italic : null,
color: widget.color != null ? widget.color : null, color: widget.color != null
? widget.color
: Theme.of(context).textTheme.bodyText1.color,
fontWeight: widget.fontWeight ?? _getFontWeight(), fontWeight: widget.fontWeight ?? _getFontWeight(),
) )
: TextStyle( : TextStyle(
decoration: widget.decoration, decoration: widget.decoration,
fontStyle: widget.italic ? FontStyle.italic : null, fontStyle: widget.italic ? FontStyle.italic : null,
color: widget.color ?? Colors.black, color: widget.color ??
Theme.of(context).textTheme.bodyText1.color,
fontSize: widget.fontSize ?? _getFontSize(), fontSize: widget.fontSize ?? _getFontSize(),
letterSpacing: widget.variant == "overline" ? 1 : null, letterSpacing: widget.variant == "overline" ? 1 : null,
fontWeight: widget.fontWeight ?? _getFontWeight(), fontWeight: widget.fontWeight ?? _getFontWeight(),

@ -81,7 +81,7 @@ class _AppDrawerState extends State<AppDrawer> {
children: <Widget>[ children: <Widget>[
Container( Container(
child: child:
Image.asset('assets/images/DQ/DQ_logo.png'), Image.asset('assets/images/logo_HMG.png'),
margin: EdgeInsets.all( margin: EdgeInsets.all(
SizeConfig.imageSizeMultiplier * 4), SizeConfig.imageSizeMultiplier * 4),
), ),

@ -9,20 +9,23 @@ import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:flutter_inappwebview/flutter_inappwebview.dart'; import 'package:flutter_inappwebview/flutter_inappwebview.dart';
class MyInAppBrowser extends InAppBrowser { class MyInAppBrowser extends InAppBrowser {
// static String SERVICE_URL =
// 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT
static String SERVICE_URL = static String SERVICE_URL =
'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE
// static String SERVICE_URL = // static String PREAUTH_SERVICE_URL =
// 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE // 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort PreAuth Payment Gateway URL UAT
static String PREAUTH_SERVICE_URL = static String PREAUTH_SERVICE_URL =
'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort PreAuth Payment Gateway URL UAT 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store
// static String PREAUTH_SERVICE_URL = // static String PRESCRIPTION_PAYMENT_WITH_ORDERID =
// 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store // 'https://uat.hmgwebservices.com/epharmacy/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID=';
static String PRESCRIPTION_PAYMENT_WITH_ORDERID = static String PRESCRIPTION_PAYMENT_WITH_ORDERID =
'https://uat.hmgwebservices.com/epharmacy/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID='; 'https://mdlaboratories.com/exacartapi/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID='; //Live
static List<String> successURLS = [ static List<String> successURLS = [
'success', 'success',
@ -260,7 +263,6 @@ class MyInAppBrowser extends InAppBrowser {
String patientName, String patientName,
dynamic patientID, dynamic patientID,
AuthenticatedUser authUser) async { AuthenticatedUser authUser) async {
String pharmacyURL = PRESCRIPTION_PAYMENT_WITH_ORDERID + String pharmacyURL = PRESCRIPTION_PAYMENT_WITH_ORDERID +
order.orderGuid + order.orderGuid +
'&&CustomerId=' + '&&CustomerId=' +
@ -336,7 +338,6 @@ class MyInAppBrowser extends InAppBrowser {
'</body>' + '</body>' +
'</html>'; '</html>';
} }
} }
class MyChromeSafariBrowser extends ChromeSafariBrowser { class MyChromeSafariBrowser extends ChromeSafariBrowser {

@ -93,7 +93,7 @@ class PharmacyAppScaffold extends StatelessWidget {
) )
: buildBodyWidget(), : buildBodyWidget(),
bottomSheet: bottomSheet, bottomSheet: bottomSheet,
floatingActionButton: floatingActionButton ?? floatingActionButton, // floatingActionButton: floatingActionButton ?? floatingActionButton,
// bottomNavigationBar: // bottomNavigationBar:
// this.isBottomBar == true ? BottomBarSearch() : SizedBox() // this.isBottomBar == true ? BottomBarSearch() : SizedBox()
// floatingActionButton: FloatingSearchButton(), // floatingActionButton: FloatingSearchButton(),
@ -105,7 +105,7 @@ class PharmacyAppScaffold extends StatelessWidget {
} }
buildBodyWidget() { buildBodyWidget() {
// return body; //Stack(children: <Widget>[body, buildAppLoaderWidget(isLoading)]); return body; //Stack(children: <Widget>[body, buildAppLoaderWidget(isLoading)]);
return Stack(children: <Widget>[body, FloatingSearchButton()]); //return Stack(children: <Widget>[body, FloatingSearchButton()]);
} }
} }

@ -0,0 +1,170 @@
import 'package:diplomaticquarterapp/core/model/pharmacy/categorise_parent_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacy_categorise_view_model.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/input/text_field.dart';
import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart';
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class ProcedureListWidget extends StatefulWidget {
final PharmacyCategoriseViewModel model;
final Function addSelectedHistories;
final Function(CategoriseParentModel) removeHistory;
final Function(CategoriseParentModel) addHistory;
final Function(CategoriseParentModel) addRemarks;
final bool Function(CategoriseParentModel) isEntityListSelected;
final List<CategoriseParentModel> masterList;
ProcedureListWidget(
{Key key,
this.model,
this.addSelectedHistories,
this.removeHistory,
this.masterList,
this.addHistory,
this.isEntityListSelected,
this.addRemarks})
: super(key: key);
@override
_ProcedureListWidgetState createState() => _ProcedureListWidgetState();
}
class _ProcedureListWidgetState extends State<ProcedureListWidget> {
int selectedType = 0;
int typeUrgent;
int typeRegular;
setSelectedType(int val) {
setState(() {
selectedType = val;
});
}
List<CategoriseParentModel> items = List();
List<String> remarksList = List();
List<int> typeList = List();
@override
void initState() {
items.addAll(widget.masterList);
super.initState();
}
TextEditingController remarksController = TextEditingController();
@override
Widget build(BuildContext context) {
return Container(
child: Column(
children: [
NetworkBaseView(
baseViewModel: widget.model,
child: Container(
height: MediaQuery.of(context).size.height * 0.35,
child: Center(
child: Container(
margin: EdgeInsets.only(top: 15),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: ListView(
children: [
// TextFields(
// hintText:
// 'sss', //TranslationBase.of(context).searchProcedures,
// suffixIcon: EvaIcons.search,
// onChanged: (value) {
// filterSearchResults(value);
// },
// ),
SizedBox(
height: 15,
),
items.length != 0
? Column(
children: items.map((historyInfo) {
return Column(
children: [
Row(
children: [
Checkbox(
value: widget.isEntityListSelected(
historyInfo),
activeColor: Colors.red[800],
onChanged: (bool newValue) {
setState(() {
if (widget.isEntityListSelected(
historyInfo)) {
widget
.removeHistory(historyInfo);
} else {
widget.addHistory(historyInfo);
}
});
}),
Expanded(
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 10, vertical: 0),
child: Texts(historyInfo.name,
variant: "bodyText",
bold: true,
color: Colors.black),
),
),
],
),
Divider(
height: 1,
),
],
);
}).toList(),
)
: Center(
child: Container(
child: AppText(
"There's no procedures for this category",
color: Color(0xFFB9382C)),
),
)
],
),
)),
),
),
SizedBox(
height: 10,
),
],
),
);
}
void filterSearchResults(String query) {
List<CategoriseParentModel> dummySearchList = List();
dummySearchList.addAll(widget.masterList);
if (query.isNotEmpty) {
List<CategoriseParentModel> dummyListData = List();
dummySearchList.forEach((item) {
if (item.name.toLowerCase().contains(query.toLowerCase())) {
dummyListData.add(item);
}
});
setState(() {
items.clear();
items.addAll(dummyListData);
});
return;
} else {
setState(() {
items.clear();
items.addAll(widget.masterList);
});
}
}
}

@ -834,11 +834,13 @@ class _FloatingSearchButton extends State<FloatingSearchButton>
if (isInit == true) { if (isInit == true) {
event.setValue({"animationEnable": 'true'}); event.setValue({"animationEnable": 'true'});
} }
if (isArabic == false && results['ReturnMessage'] != null) { if (isArabic == false &&
results['ReturnMessage'] != null &&
isInit == false) {
await flutterTts await flutterTts
.setVoice({"name": "en-au-x-aub-network", "locale": "en-AU"}); .setVoice({"name": "en-au-x-aub-network", "locale": "en-AU"});
await flutterTts.speak(results['ReturnMessage']); await flutterTts.speak(results['ReturnMessage']);
} else if (results['ReturnMessage_Ar'] != null) { } else if (results['ReturnMessage_Ar'] != null && isInit == false) {
await flutterTts await flutterTts
.setVoice({"name": "ar-xa-x-ard-network", "locale": "ar"}); .setVoice({"name": "ar-xa-x-ard-network", "locale": "ar"});
await flutterTts.speak(results['ReturnMessage_Ar']); await flutterTts.speak(results['ReturnMessage_Ar']);
@ -889,6 +891,21 @@ class _FloatingSearchButton extends State<FloatingSearchButton>
stopAnimation({isInit}) async { stopAnimation({isInit}) async {
if (isInit == true) { if (isInit == true) {
IS_TEXT_COMPLETED = true; IS_TEXT_COMPLETED = true;
Future.delayed(const Duration(seconds: 10), () {
event.setValue({"animationEnable": 'false'});
setState(() {
this.networkImage = null;
this.isAnimationEnable = false;
});
});
} else {
flutterTts.setCompletionHandler(() async {
event.setValue({"animationEnable": 'false'});
setState(() {
this.networkImage = null;
this.isAnimationEnable = false;
});
});
} }
flutterTts.setCompletionHandler(() async { flutterTts.setCompletionHandler(() async {
event.setValue({"animationEnable": 'false'}); event.setValue({"animationEnable": 'false'});

@ -1,3 +1,4 @@
import 'package:diplomaticquarterapp/Constants.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -48,9 +49,8 @@ class BottomNavPharmacyItem extends StatelessWidget {
), ),
Container( Container(
child: Icon(currentIndex == index ? activeIcon : icon, child: Icon(currentIndex == index ? activeIcon : icon,
color: currentIndex == index color:
? Theme.of(context).primaryColor currentIndex == index ? secondaryColor : Colors.grey,
: Theme.of(context).primaryColor,
size: 22.0), size: 22.0),
), ),
SizedBox( SizedBox(
@ -61,9 +61,7 @@ class BottomNavPharmacyItem extends StatelessWidget {
Texts( Texts(
title, title,
textAlign: TextAlign.center, textAlign: TextAlign.center,
color: currentIndex == index color: currentIndex == index ? secondaryColor : Colors.grey,
? Theme.of(context).primaryColor
: Theme.of(context).primaryColor,
fontSize: 11, fontSize: 11,
), ),
], ],

Loading…
Cancel
Save