Merge branch 'development' of https://gitlab.com/Cloud_Solution/diplomatic-quarter into pharmacy-bugs

merge-requests/282/head
hussam al-habibeh 5 years ago
commit b39e88d9c8

@ -0,0 +1,4 @@
-keep class tvi.webrtc.** { *; }
-keep class com.twilio.video.** { *; }
-keep class com.twilio.common.** { *; }
-keepattributes InnerClasses

@ -3,6 +3,9 @@ buildscript {
repositories { repositories {
google() google()
jcenter() jcenter()
// maven {
// url "https://dl.bintray.com/kotlin/kotlin-eap/"
// }
} }
dependencies { dependencies {

@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-all.zip

@ -0,0 +1,6 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="14.769" viewBox="0 0 16 14.769">
<g id="Group_1463" data-name="Group 1463" transform="translate(-236)">
<path id="Icon_ionic-md-heart-empty" data-name="Icon ionic-md-heart-empty" d="M14.975,4.5a4.732,4.732,0,0,0-3.6,1.688A4.732,4.732,0,0,0,7.775,4.5a4.35,4.35,0,0,0-4.4,4.427c0,3.058,2.719,5.512,6.838,9.3l1.162,1.046,1.162-1.046c4.119-3.785,6.838-6.238,6.838-9.3A4.35,4.35,0,0,0,14.975,4.5ZM11.867,17.165l-.162.15-.331.3-.331-.3-.162-.15a48.887,48.887,0,0,1-4.719-4.692A5.643,5.643,0,0,1,4.61,8.927a3.2,3.2,0,0,1,.912-2.281,3.13,3.13,0,0,1,2.254-.915,3.527,3.527,0,0,1,2.658,1.25L11.375,8.1l.942-1.119a3.514,3.514,0,0,1,2.658-1.25,3.145,3.145,0,0,1,2.258.915,3.206,3.206,0,0,1,.912,2.281,5.673,5.673,0,0,1-1.554,3.546A48.986,48.986,0,0,1,11.867,17.165Z" transform="translate(232.625 -4.5)" fill="#ed1c2b"/>
<path id="Path_1790" data-name="Path 1790" d="M251.438,12.227,249.66,10.76l-3.555.651a15.239,15.239,0,0,0-1.295,2.378c.072.2,1.295,4.436,1.295,4.436l4.258,4.295,1.609,1.241L253.7,22.52l3.551-3.5,1.979-3.813-.72-3.488-1.741-.962-3.069.651-1.883,1.342Z" transform="translate(-8 -10)" fill="#ed1c2b" stroke="#ed1c2b" stroke-width="1"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="14.769" viewBox="0 0 16 14.769">
<path id="Icon_ionic-md-heart-empty" data-name="Icon ionic-md-heart-empty" d="M14.975,4.5a4.732,4.732,0,0,0-3.6,1.688A4.732,4.732,0,0,0,7.775,4.5a4.35,4.35,0,0,0-4.4,4.427c0,3.058,2.719,5.512,6.838,9.3l1.162,1.046,1.162-1.046c4.119-3.785,6.838-6.238,6.838-9.3A4.35,4.35,0,0,0,14.975,4.5ZM11.867,17.165l-.162.15-.331.3-.331-.3-.162-.15a48.887,48.887,0,0,1-4.719-4.692A5.643,5.643,0,0,1,4.61,8.927a3.2,3.2,0,0,1,.912-2.281,3.13,3.13,0,0,1,2.254-.915,3.527,3.527,0,0,1,2.658,1.25L11.375,8.1l.942-1.119a3.514,3.514,0,0,1,2.658-1.25,3.145,3.145,0,0,1,2.258.915,3.206,3.206,0,0,1,.912,2.281,5.673,5.673,0,0,1-1.554,3.546A48.986,48.986,0,0,1,11.867,17.165Z" transform="translate(-3.375 -4.5)" fill="#b5b5b5"/>
</svg>

After

Width:  |  Height:  |  Size: 804 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 212 B

@ -12,8 +12,8 @@ const EXA_CART_API_BASE_URL = 'https://mdlaboratories.com/exacartapi';
const PACKAGES_CATEGORIES = '/api/categories'; 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/';
//const BASE_PHARMACY_URL = 'http://swd-pharapp-01:7200/api/'; //const BASE_PHARMACY_URL = 'http://swd-pharapp-01:7200/api/';
const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/';
@ -292,7 +292,7 @@ const GET_PATIENT_HEALTH_STATS =
const CHANNEL = 3; const CHANNEL = 3;
const GENERAL_ID = 'Cs2020@2016\$2958'; const GENERAL_ID = 'Cs2020@2016\$2958';
const IP_ADDRESS = '10.20.10.20'; const IP_ADDRESS = '10.20.10.20';
const VERSION_ID = 6.1; const VERSION_ID = 8.8;
const SETUP_ID = '91877'; const SETUP_ID = '91877';
const LANGUAGE = 2; const LANGUAGE = 2;
const PATIENT_OUT_SA = 0; const PATIENT_OUT_SA = 0;
@ -435,6 +435,11 @@ 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';
//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/";
@ -478,6 +483,7 @@ const TRANSFER_YAHALA_LOYALITY_POINTS =
const LAKUM_GET_USER_TERMS_AND_CONDITIONS = const LAKUM_GET_USER_TERMS_AND_CONDITIONS =
"Services/ERP.svc/REST/GetUserTermsAndConditionsForEPharmcy"; "Services/ERP.svc/REST/GetUserTermsAndConditionsForEPharmcy";
const PRESCRIPTION = 'Services/Patients.svc/REST/GetPrescriptionApptList'; const PRESCRIPTION = 'Services/Patients.svc/REST/GetPrescriptionApptList';
const GET_RECOMMENDED_PRODUCT = 'alsoProduct/';
// Home Health Care // Home Health Care
const HHC_GET_ALL_SERVICES = const HHC_GET_ALL_SERVICES =

@ -1651,10 +1651,8 @@ const Map localizedValues = {
"calculate": {"en": "calculate", "ar": "حساب"}, "calculate": {"en": "calculate", "ar": "حساب"},
"enterReadingValue": {"en": "Enter the reading value", "ar": "ادخل القيمة"}, "enterReadingValue": {"en": "Enter the reading value", "ar": "ادخل القيمة"},
"result": {"en": "Result", "ar": "النتيجة"}, "result": {"en": "Result", "ar": "النتيجة"},
"bloodSugarConversion": { "sort": {"en": "Sort", "ar": "فرز"},
"en": "Blood Sugar Conversion", "bloodSugarConversion": {"en": "Blood Sugar Conversion", "ar": "السكر في الدم"},
"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.",
@ -1956,4 +1954,6 @@ 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": "عنوان التوصيل"},
"ancillary-orders": {"en": "Ancillary Orders", "ar": "الأوامر التبعية"},
}; };

@ -107,7 +107,12 @@ class Customer {
lastLoginDateUtc = json['last_login_date_utc']; lastLoginDateUtc = json['last_login_date_utc'];
lastActivityDateUtc = json['last_activity_date_utc']; lastActivityDateUtc = json['last_activity_date_utc'];
registeredInStoreId = json['registered_in_store_id']; registeredInStoreId = json['registered_in_store_id'];
roleIds = json['role_ids'].cast<int>(); if (json['role_ids'] != null) {
roleIds = new List<int>();
json['role_ids'].forEach((v) {
roleIds.add(v);
});
}
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {

@ -10,13 +10,13 @@ class Reviews {
bool isApproved; bool isApproved;
String title; String title;
String reviewText; String reviewText;
Null replyText; String replyText;
int rating; int rating;
int helpfulYesTotal; int helpfulYesTotal;
int helpfulNoTotal; int helpfulNoTotal;
String createdOnUtc; String createdOnUtc;
Customer customer; Customer customer;
Null product; //Null product;
Reviews( Reviews(
{this.id, {this.id,
@ -34,7 +34,8 @@ class Reviews {
this.helpfulNoTotal, this.helpfulNoTotal,
this.createdOnUtc, this.createdOnUtc,
this.customer, this.customer,
this.product}); // this.product
});
Reviews.fromJson(Map<String, dynamic> json) { Reviews.fromJson(Map<String, dynamic> json) {
id = json['id']; id = json['id'];
@ -54,7 +55,7 @@ class Reviews {
customer = json['customer'] != null customer = json['customer'] != null
? new Customer.fromJson(json['customer']) ? new Customer.fromJson(json['customer'])
: null; : null;
product = json['product']; // product = json['product'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -76,7 +77,7 @@ class Reviews {
if (this.customer != null) { if (this.customer != null) {
data['customer'] = this.customer.toJson(); data['customer'] = this.customer.toJson();
} }
data['product'] = this.product; // data['product'] = this.product;
return data; return data;
} }
} }

@ -312,7 +312,7 @@ class IngAddress {
DateTime createdOnUtc; DateTime createdOnUtc;
dynamic province; dynamic province;
String latLong; String latLong;
LatLng getLocation(){ LatLng getLocation(){
if(latLong.contains(',')){ if(latLong.contains(',')){
var parts = latLong.trim().split(','); var parts = latLong.trim().split(',');
@ -477,10 +477,10 @@ class OrderModelCustomer {
}); });
String id; String id;
Username username; dynamic username;
BillingAddressEmail email; dynamic email;
FirstName firstName; dynamic firstName;
LastName lastName; dynamic lastName;
String languageId; String languageId;
dynamic adminComment; dynamic adminComment;
bool isTaxExempt; bool isTaxExempt;
@ -489,10 +489,10 @@ class OrderModelCustomer {
bool deleted; bool deleted;
bool isSystemAccount; bool isSystemAccount;
dynamic systemName; dynamic systemName;
LastIpAddress lastIpAddress; dynamic lastIpAddress;
DateTime createdOnUtc; dynamic createdOnUtc;
DateTime lastLoginDateUtc; dynamic lastLoginDateUtc;
DateTime lastActivityDateUtc; dynamic lastActivityDateUtc;
dynamic registeredInStoreId; dynamic registeredInStoreId;
List<dynamic> roleIds; List<dynamic> roleIds;
@ -578,6 +578,7 @@ final customerTaxDisplayTypeValues = EnumValues({
"ExcludingTax": CustomerTaxDisplayType.EXCLUDING_TAX "ExcludingTax": CustomerTaxDisplayType.EXCLUDING_TAX
}); });
class OrderItem { class OrderItem {
OrderItem({ OrderItem({
this.quantity, this.quantity,
@ -868,9 +869,9 @@ class Product {
dynamic displayOrder; dynamic displayOrder;
bool published; bool published;
bool deleted; bool deleted;
DateTime createdOnUtc; dynamic createdOnUtc;
DateTime updatedOnUtc; dynamic updatedOnUtc;
ProductType productType; dynamic productType;
dynamic parentGroupedProductId; dynamic parentGroupedProductId;
dynamic roleIds; dynamic roleIds;
dynamic discountIds; dynamic discountIds;
@ -1147,14 +1148,14 @@ class Review {
dynamic productId; dynamic productId;
dynamic storeId; dynamic storeId;
bool isApproved; bool isApproved;
Title title; dynamic title;
ReviewText reviewText; dynamic reviewText;
dynamic replyText; dynamic replyText;
dynamic rating; dynamic rating;
dynamic helpfulYesTotal; dynamic helpfulYesTotal;
dynamic helpfulNoTotal; dynamic helpfulNoTotal;
DateTime createdOnUtc; dynamic createdOnUtc;
ReviewCustomer customer; dynamic customer;
dynamic product; dynamic product;
factory Review.fromJson(Map<String, dynamic> json) => Review( factory Review.fromJson(Map<String, dynamic> json) => Review(
@ -1236,7 +1237,7 @@ class ReviewCustomer {
dynamic isOutSa; dynamic isOutSa;
dynamic patientType; dynamic patientType;
dynamic gender; dynamic gender;
DateTime birthDate; dynamic birthDate;
dynamic phone; dynamic phone;
dynamic countryCode; dynamic countryCode;
dynamic yahalaAccountno; dynamic yahalaAccountno;
@ -1245,7 +1246,7 @@ class ReviewCustomer {
List<dynamic> addresses; List<dynamic> addresses;
String id; String id;
String username; String username;
PurpleEmail email; dynamic email;
dynamic firstName; dynamic firstName;
dynamic lastName; dynamic lastName;
dynamic languageId; dynamic languageId;

@ -32,6 +32,10 @@ class Orders {
bool canCancel; bool canCancel;
bool canRefund; bool canRefund;
dynamic customerId; dynamic customerId;
double orderSubtotalExclTax;
dynamic orderShippingExclTax;
double orderTax;
Orders( Orders(
{this.id, {this.id,
@ -43,7 +47,10 @@ class Orders {
this.orderStatusn, this.orderStatusn,
this.canCancel, this.canCancel,
this.canRefund, this.canRefund,
this.customerId,}); this.customerId,
this.orderShippingExclTax,
this.orderSubtotalExclTax,
this.orderTax,});
Orders.fromJson(Map<String, dynamic> json) { Orders.fromJson(Map<String, dynamic> json) {
try { try {
@ -57,6 +64,9 @@ class Orders {
canCancel = json['can_cancel']; canCancel = json['can_cancel'];
canRefund = json['can_refund']; canRefund = json['can_refund'];
customerId = json['customer_id']; customerId = json['customer_id'];
orderSubtotalExclTax= json["order_subtotal_excl_tax"].toDouble();
orderShippingExclTax= json["order_shipping_excl_tax"];
orderTax= json["order_tax"].toDouble();
}catch(e){ }catch(e){
print(e); print(e);
} }
@ -72,6 +82,9 @@ class Orders {
data['order_status_id'] = this.orderStatusId; data['order_status_id'] = this.orderStatusId;
data['order_status'] = this.orderStatus; data['order_status'] = this.orderStatus;
data['order_statusn'] = this.orderStatusn; data['order_statusn'] = this.orderStatusn;
data ["order_subtotal_excl_tax"] = this.orderSubtotalExclTax;
data ["order_shipping_excl_tax"]= this.orderShippingExclTax;
data ["order_tax"]= this.orderTax;
return data; return data;
} }
} }

@ -0,0 +1,486 @@
class RecommendedProductModel {
List<Products> products;
RecommendedProductModel({this.products});
RecommendedProductModel.fromJson(Map<String, dynamic> json) {
if (json['products'] != null) {
products = new List<Products>();
json['products'].forEach((v) {
products.add(new Products.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.products != null) {
data['products'] = this.products.map((v) => v.toJson()).toList();
}
return data;
}
}
class Products {
String id;
bool visibleIndividually;
String name;
String namen;
String shortDescription;
String shortDescriptionn;
String fullDescription;
String fullDescriptionn;
bool markasNew;
bool showOnHomePage;
dynamic metaKeywords;
dynamic metaDescription;
dynamic metaTitle;
bool allowCustomerReviews;
dynamic approvedRatingSum;
dynamic notApprovedRatingSum;
dynamic approvedTotalReviews;
dynamic notApprovedTotalReviews;
String sku;
bool isRx;
bool prescriptionRequired;
dynamic rxMessage;
dynamic rxMessagen;
dynamic manufacturerPartNumber;
dynamic gtin;
bool isGiftCard;
bool requireOtherProducts;
bool automaticallyAddRequiredProducts;
bool isDownload;
bool unlimitedDownloads;
dynamic maxNumberOfDownloads;
dynamic downloadExpirationDays;
bool hasSampleDownload;
bool hasUserAgreement;
bool isRecurring;
dynamic recurringCycleLength;
dynamic recurringTotalCycles;
bool isRental;
dynamic rentalPriceLength;
bool isShipEnabled;
bool isFreeShipping;
bool shipSeparately;
dynamic additionalShippingCharge;
bool isTaxExempt;
bool isTelecommunicationsOrBroadcastingOrElectronicServices;
bool useMultipleWarehouses;
dynamic manageInventoryMethodId;
dynamic stockQuantity;
String stockAvailability;
String stockAvailabilityn;
bool displayStockAvailability;
bool displayStockQuantity;
dynamic minStockQuantity;
dynamic notifyAdminForQuantityBelow;
bool allowBackInStockSubscriptions;
dynamic orderMinimumQuantity;
dynamic orderMaximumQuantity;
dynamic allowedQuantities;
bool allowAddingOnlyExistingAttributeCombinations;
bool disableBuyButton;
bool disableWishlistButton;
bool availableForPreOrder;
dynamic preOrderAvailabilityStartDateTimeUtc;
bool callForPrice;
dynamic price;
dynamic oldPrice;
dynamic productCost;
dynamic specialPrice;
dynamic specialPriceStartDateTimeUtc;
dynamic specialPriceEndDateTimeUtc;
bool customerEntersPrice;
dynamic minimumCustomerEnteredPrice;
dynamic maximumCustomerEnteredPrice;
bool basepriceEnabled;
dynamic basepriceAmount;
dynamic basepriceBaseAmount;
bool hasTierPrices;
bool hasDiscountsApplied;
dynamic discountName;
dynamic discountNamen;
dynamic discountDescription;
dynamic discountDescriptionn;
dynamic discountPercentage;
String currency;
String currencyn;
double weight;
dynamic length;
dynamic width;
dynamic height;
dynamic availableStartDateTimeUtc;
dynamic availableEndDateTimeUtc;
dynamic displayOrder;
bool published;
bool deleted;
String createdOnUtc;
String updatedOnUtc;
String productType;
dynamic parentGroupedProductId;
dynamic vendorId;
String seName;
List<Images> images;
Products({
this.id,
this.visibleIndividually,
this.name,
this.namen,
this.shortDescription,
this.shortDescriptionn,
this.fullDescription,
this.fullDescriptionn,
this.markasNew,
this.showOnHomePage,
this.metaKeywords,
this.metaDescription,
this.metaTitle,
this.allowCustomerReviews,
this.approvedRatingSum,
this.notApprovedRatingSum,
this.approvedTotalReviews,
this.notApprovedTotalReviews,
this.sku,
this.isRx,
this.prescriptionRequired,
this.rxMessage,
this.rxMessagen,
this.manufacturerPartNumber,
this.gtin,
this.isGiftCard,
this.requireOtherProducts,
this.automaticallyAddRequiredProducts,
this.isDownload,
this.unlimitedDownloads,
this.maxNumberOfDownloads,
this.downloadExpirationDays,
this.hasSampleDownload,
this.hasUserAgreement,
this.isRecurring,
this.recurringCycleLength,
this.recurringTotalCycles,
this.isRental,
this.rentalPriceLength,
this.isShipEnabled,
this.isFreeShipping,
this.shipSeparately,
this.additionalShippingCharge,
this.isTaxExempt,
this.isTelecommunicationsOrBroadcastingOrElectronicServices,
this.useMultipleWarehouses,
this.manageInventoryMethodId,
this.stockQuantity,
this.stockAvailability,
this.stockAvailabilityn,
this.displayStockAvailability,
this.displayStockQuantity,
this.minStockQuantity,
this.notifyAdminForQuantityBelow,
this.allowBackInStockSubscriptions,
this.orderMinimumQuantity,
this.orderMaximumQuantity,
this.allowedQuantities,
this.allowAddingOnlyExistingAttributeCombinations,
this.disableBuyButton,
this.disableWishlistButton,
this.availableForPreOrder,
this.preOrderAvailabilityStartDateTimeUtc,
this.callForPrice,
this.price,
this.oldPrice,
this.productCost,
this.specialPrice,
this.specialPriceStartDateTimeUtc,
this.specialPriceEndDateTimeUtc,
this.customerEntersPrice,
this.minimumCustomerEnteredPrice,
this.maximumCustomerEnteredPrice,
this.basepriceEnabled,
this.basepriceAmount,
this.basepriceBaseAmount,
this.hasTierPrices,
this.hasDiscountsApplied,
this.discountName,
this.discountNamen,
this.discountDescription,
this.discountDescriptionn,
this.discountPercentage,
this.currency,
this.currencyn,
this.weight,
this.length,
this.width,
this.height,
this.availableStartDateTimeUtc,
this.availableEndDateTimeUtc,
this.displayOrder,
this.published,
this.deleted,
this.createdOnUtc,
this.updatedOnUtc,
this.productType,
this.parentGroupedProductId,
this.vendorId,
this.seName,
this.images,
});
Products.fromJson(Map<String, dynamic> json) {
id = json['id'];
visibleIndividually = json['visible_individually'];
name = json['name'];
namen = json['namen'];
shortDescription = json['short_description'];
shortDescriptionn = json['short_descriptionn'];
fullDescription = json['full_description'];
fullDescriptionn = json['full_descriptionn'];
markasNew = json['markas_new'];
showOnHomePage = json['show_on_home_page'];
metaKeywords = json['meta_keywords'];
metaDescription = json['meta_description'];
metaTitle = json['meta_title'];
allowCustomerReviews = json['allow_customer_reviews'];
approvedRatingSum = json['approved_rating_sum'];
notApprovedRatingSum = json['not_approved_rating_sum'];
approvedTotalReviews = json['approved_total_reviews'];
notApprovedTotalReviews = json['not_approved_total_reviews'];
sku = json['sku'];
isRx = json['is_rx'];
prescriptionRequired = json['prescription_required'];
rxMessage = json['rx_message'];
rxMessagen = json['rx_messagen'];
manufacturerPartNumber = json['manufacturer_part_number'];
gtin = json['gtin'];
isGiftCard = json['is_gift_card'];
requireOtherProducts = json['require_other_products'];
automaticallyAddRequiredProducts =
json['automatically_add_required_products'];
isDownload = json['is_download'];
unlimitedDownloads = json['unlimited_downloads'];
maxNumberOfDownloads = json['max_number_of_downloads'];
downloadExpirationDays = json['download_expiration_days'];
hasSampleDownload = json['has_sample_download'];
hasUserAgreement = json['has_user_agreement'];
isRecurring = json['is_recurring'];
recurringCycleLength = json['recurring_cycle_length'];
recurringTotalCycles = json['recurring_total_cycles'];
isRental = json['is_rental'];
rentalPriceLength = json['rental_price_length'];
isShipEnabled = json['is_ship_enabled'];
isFreeShipping = json['is_free_shipping'];
shipSeparately = json['ship_separately'];
additionalShippingCharge = json['additional_shipping_charge'];
isTaxExempt = json['is_tax_exempt'];
isTelecommunicationsOrBroadcastingOrElectronicServices =
json['is_telecommunications_or_broadcasting_or_electronic_services'];
useMultipleWarehouses = json['use_multiple_warehouses'];
manageInventoryMethodId = json['manage_inventory_method_id'];
stockQuantity = json['stock_quantity'];
stockAvailability = json['stock_availability'];
stockAvailabilityn = json['stock_availabilityn'];
displayStockAvailability = json['display_stock_availability'];
displayStockQuantity = json['display_stock_quantity'];
minStockQuantity = json['min_stock_quantity'];
notifyAdminForQuantityBelow = json['notify_admin_for_quantity_below'];
allowBackInStockSubscriptions = json['allow_back_in_stock_subscriptions'];
orderMinimumQuantity = json['order_minimum_quantity'];
orderMaximumQuantity = json['order_maximum_quantity'];
allowedQuantities = json['allowed_quantities'];
allowAddingOnlyExistingAttributeCombinations =
json['allow_adding_only_existing_attribute_combinations'];
disableBuyButton = json['disable_buy_button'];
disableWishlistButton = json['disable_wishlist_button'];
availableForPreOrder = json['available_for_pre_order'];
preOrderAvailabilityStartDateTimeUtc =
json['pre_order_availability_start_date_time_utc'];
callForPrice = json['call_for_price'];
price = json['price'];
oldPrice = json['old_price'];
productCost = json['product_cost'];
specialPrice = json['special_price'];
specialPriceStartDateTimeUtc = json['special_price_start_date_time_utc'];
specialPriceEndDateTimeUtc = json['special_price_end_date_time_utc'];
customerEntersPrice = json['customer_enters_price'];
minimumCustomerEnteredPrice = json['minimum_customer_entered_price'];
maximumCustomerEnteredPrice = json['maximum_customer_entered_price'];
basepriceEnabled = json['baseprice_enabled'];
basepriceAmount = json['baseprice_amount'];
basepriceBaseAmount = json['baseprice_base_amount'];
hasTierPrices = json['has_tier_prices'];
hasDiscountsApplied = json['has_discounts_applied'];
discountName = json['discount_name'];
discountNamen = json['discount_namen'];
discountDescription = json['discount_description'];
discountDescriptionn = json['discount_Descriptionn'];
discountPercentage = json['discount_percentage'];
currency = json['currency'];
currencyn = json['currencyn'];
weight = json['weight'];
length = json['length'];
width = json['width'];
height = json['height'];
availableStartDateTimeUtc = json['available_start_date_time_utc'];
availableEndDateTimeUtc = json['available_end_date_time_utc'];
displayOrder = json['display_order'];
published = json['published'];
deleted = json['deleted'];
createdOnUtc = json['created_on_utc'];
updatedOnUtc = json['updated_on_utc'];
productType = json['product_type'];
parentGroupedProductId = json['parent_grouped_product_id'];
vendorId = json['vendor_id'];
seName = json['se_name'];
if (json['images'] != null) {
images = new List<Images>();
json['images'].forEach((v) {
images.add(new Images.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['visible_individually'] = this.visibleIndividually;
data['name'] = this.name;
data['namen'] = this.namen;
data['short_description'] = this.shortDescription;
data['short_descriptionn'] = this.shortDescriptionn;
data['full_description'] = this.fullDescription;
data['full_descriptionn'] = this.fullDescriptionn;
data['markas_new'] = this.markasNew;
data['show_on_home_page'] = this.showOnHomePage;
data['meta_keywords'] = this.metaKeywords;
data['meta_description'] = this.metaDescription;
data['meta_title'] = this.metaTitle;
data['allow_customer_reviews'] = this.allowCustomerReviews;
data['approved_rating_sum'] = this.approvedRatingSum;
data['not_approved_rating_sum'] = this.notApprovedRatingSum;
data['approved_total_reviews'] = this.approvedTotalReviews;
data['not_approved_total_reviews'] = this.notApprovedTotalReviews;
data['sku'] = this.sku;
data['is_rx'] = this.isRx;
data['prescription_required'] = this.prescriptionRequired;
data['rx_message'] = this.rxMessage;
data['rx_messagen'] = this.rxMessagen;
data['manufacturer_part_number'] = this.manufacturerPartNumber;
data['gtin'] = this.gtin;
data['is_gift_card'] = this.isGiftCard;
data['require_other_products'] = this.requireOtherProducts;
data['automatically_add_required_products'] =
this.automaticallyAddRequiredProducts;
data['is_download'] = this.isDownload;
data['unlimited_downloads'] = this.unlimitedDownloads;
data['max_number_of_downloads'] = this.maxNumberOfDownloads;
data['download_expiration_days'] = this.downloadExpirationDays;
data['has_sample_download'] = this.hasSampleDownload;
data['has_user_agreement'] = this.hasUserAgreement;
data['is_recurring'] = this.isRecurring;
data['recurring_cycle_length'] = this.recurringCycleLength;
data['recurring_total_cycles'] = this.recurringTotalCycles;
data['is_rental'] = this.isRental;
data['rental_price_length'] = this.rentalPriceLength;
data['is_ship_enabled'] = this.isShipEnabled;
data['is_free_shipping'] = this.isFreeShipping;
data['ship_separately'] = this.shipSeparately;
data['additional_shipping_charge'] = this.additionalShippingCharge;
data['is_tax_exempt'] = this.isTaxExempt;
data['is_telecommunications_or_broadcasting_or_electronic_services'] =
this.isTelecommunicationsOrBroadcastingOrElectronicServices;
data['use_multiple_warehouses'] = this.useMultipleWarehouses;
data['manage_inventory_method_id'] = this.manageInventoryMethodId;
data['stock_quantity'] = this.stockQuantity;
data['stock_availability'] = this.stockAvailability;
data['stock_availabilityn'] = this.stockAvailabilityn;
data['display_stock_availability'] = this.displayStockAvailability;
data['display_stock_quantity'] = this.displayStockQuantity;
data['min_stock_quantity'] = this.minStockQuantity;
data['notify_admin_for_quantity_below'] = this.notifyAdminForQuantityBelow;
data['allow_back_in_stock_subscriptions'] =
this.allowBackInStockSubscriptions;
data['order_minimum_quantity'] = this.orderMinimumQuantity;
data['order_maximum_quantity'] = this.orderMaximumQuantity;
data['allowed_quantities'] = this.allowedQuantities;
data['allow_adding_only_existing_attribute_combinations'] =
this.allowAddingOnlyExistingAttributeCombinations;
data['disable_buy_button'] = this.disableBuyButton;
data['disable_wishlist_button'] = this.disableWishlistButton;
data['available_for_pre_order'] = this.availableForPreOrder;
data['pre_order_availability_start_date_time_utc'] =
this.preOrderAvailabilityStartDateTimeUtc;
data['call_for_price'] = this.callForPrice;
data['price'] = this.price;
data['old_price'] = this.oldPrice;
data['product_cost'] = this.productCost;
data['special_price'] = this.specialPrice;
data['special_price_start_date_time_utc'] =
this.specialPriceStartDateTimeUtc;
data['special_price_end_date_time_utc'] = this.specialPriceEndDateTimeUtc;
data['customer_enters_price'] = this.customerEntersPrice;
data['minimum_customer_entered_price'] = this.minimumCustomerEnteredPrice;
data['maximum_customer_entered_price'] = this.maximumCustomerEnteredPrice;
data['baseprice_enabled'] = this.basepriceEnabled;
data['baseprice_amount'] = this.basepriceAmount;
data['baseprice_base_amount'] = this.basepriceBaseAmount;
data['has_tier_prices'] = this.hasTierPrices;
data['has_discounts_applied'] = this.hasDiscountsApplied;
data['discount_name'] = this.discountName;
data['discount_namen'] = this.discountNamen;
data['discount_description'] = this.discountDescription;
data['discount_Descriptionn'] = this.discountDescriptionn;
data['discount_percentage'] = this.discountPercentage;
data['currency'] = this.currency;
data['currencyn'] = this.currencyn;
data['weight'] = this.weight;
data['length'] = this.length;
data['width'] = this.width;
data['height'] = this.height;
data['available_start_date_time_utc'] = this.availableStartDateTimeUtc;
data['available_end_date_time_utc'] = this.availableEndDateTimeUtc;
data['display_order'] = this.displayOrder;
data['published'] = this.published;
data['deleted'] = this.deleted;
data['created_on_utc'] = this.createdOnUtc;
data['updated_on_utc'] = this.updatedOnUtc;
data['product_type'] = this.productType;
data['parent_grouped_product_id'] = this.parentGroupedProductId;
data['vendor_id'] = this.vendorId;
data['se_name'] = this.seName;
if (this.images != null) {
data['images'] = this.images.map((v) => v.toJson()).toList();
}
return data;
}
}
class Images {
int id;
int position;
String src;
String thumb;
String attachment;
Images({this.id, this.position, this.src, this.thumb, this.attachment});
Images.fromJson(Map<String, dynamic> json) {
id = json['id'];
position = json['position'];
src = json['src'];
thumb = json['thumb'];
attachment = json['attachment'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['position'] = this.position;
data['src'] = this.src;
data['thumb'] = this.thumb;
data['attachment'] = this.attachment;
return data;
}
}

@ -0,0 +1,24 @@
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';
class AncillaryOrdersService extends BaseService {
List<AncillaryOrdersListModel> _ancillaryLists = List();
List<AncillaryOrdersListModel> get ancillaryLists => _ancillaryLists;
Future getOrders() async {
Map<String, dynamic> body = Map();
hasError = false;
await baseAppClient.post(GET_ANCILLARY_ORDERS,
onSuccess: (dynamic response, int statusCode) {
response['AncillaryOrderList'].forEach((item) {
ancillaryLists.add(AncillaryOrdersListModel.fromJson(item));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
}

@ -385,4 +385,175 @@ class BaseAppClient {
return params; return params;
} }
pharmacyPost(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 {
String url;
if (isExternal) {
url = endPoint;
} else {
url = BASE_PHARMACY_URL + endPoint;
}
try {
//Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
if (!isExternal) {
String token = await sharedPref.getString(TOKEN);
var languageID =
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
var user = await sharedPref.getObject(USER_PROFILE);
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; //getSessionId(token);
}
}
}
print("URL : $url");
print("Body : ${json.encode(body)}");
var ss = json.encode(body);
if (await Utils.checkConnection()) {
final response = await http.post(url.trim(),
body: json.encode(body),
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9',
});
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());
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['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);
}
}
} }

@ -20,15 +20,19 @@ class PharmacyModuleService extends BaseService {
List<PharmacyProduct> lastVisitedProducts = List(); List<PharmacyProduct> lastVisitedProducts = List();
Future makeVerifyCustomer(dynamic data) async { Future makeVerifyCustomer(dynamic data) async {
Map<String, String> queryParams = {'FileNumber': data['PatientID'].toString()}; Map<String, String> queryParams = {
'FileNumber': data['PatientID'].toString()
};
hasError = false; hasError = false;
try { try {
await baseAppClient.getPharmacy(PHARMACY_VERIFY_CUSTOMER, onSuccess: (dynamic response, int statusCode)async { await baseAppClient.getPharmacy(PHARMACY_VERIFY_CUSTOMER,
onSuccess: (dynamic response, int statusCode) async {
if (response['UserName'] != null) { if (response['UserName'] != null) {
sharedPref.setString(PHARMACY_CUSTOMER_ID, response['CustomerId'].toString()); sharedPref.setString(
PHARMACY_CUSTOMER_ID, response['CustomerId'].toString());
print(response); print(response);
} else { } else {
await createUser(); await createUser();
} }
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
@ -55,7 +59,8 @@ class PharmacyModuleService extends BaseService {
}; };
hasError = false; hasError = false;
try { try {
await baseAppClient.get(PHARMACY_CREATE_CUSTOMER, onSuccess: (dynamic response, int statusCode) async{ await baseAppClient.get(PHARMACY_CREATE_CUSTOMER,
onSuccess: (dynamic response, int statusCode) async {
if (!response['IsRegistered']) {} if (!response['IsRegistered']) {}
await generatePharmacyToken(); await generatePharmacyToken();
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
@ -68,16 +73,18 @@ class PharmacyModuleService extends BaseService {
} }
Future generatePharmacyToken() async { Future generatePharmacyToken() async {
await getUser(); await getUser();
Map<String, String> queryParams = { Map<String, String> queryParams = {
'Filenumber':user.patientID.toString(), 'Filenumber': user.patientID.toString(),
'MobileNumber':Utils.getPhoneNumberWithoutZero(user.mobileNumber), 'MobileNumber': Utils.getPhoneNumberWithoutZero(user.mobileNumber),
}; };
hasError = false; hasError = false;
try { try {
await baseAppClient.get(PHARMACY_AUTORZIE_CUSTOMER, onSuccess: (dynamic response, int statusCode) async{ await baseAppClient.get(PHARMACY_AUTORZIE_CUSTOMER,
onSuccess: (dynamic response, int statusCode) async {
if (response['Status'] == 200) { if (response['Status'] == 200) {
await sharedPref.setString(PHARMACY_AUTORZIE_TOKEN, response['token'].toString()); await sharedPref.setString(
PHARMACY_AUTORZIE_TOKEN, response['token'].toString());
} }
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
@ -91,7 +98,8 @@ class PharmacyModuleService extends BaseService {
Future getBannerListList() async { Future getBannerListList() async {
hasError = false; hasError = false;
try { try {
await baseAppClient.getPharmacy(GET_PHARMACY_BANNER, onSuccess: (dynamic response, int statusCode) { await baseAppClient.getPharmacy(GET_PHARMACY_BANNER,
onSuccess: (dynamic response, int statusCode) {
bannerItems.clear(); bannerItems.clear();
response['images'].forEach((item) { response['images'].forEach((item) {
bannerItems.add(PharmacyImageObject.fromJson(item)); bannerItems.add(PharmacyImageObject.fromJson(item));
@ -108,7 +116,8 @@ class PharmacyModuleService extends BaseService {
Future getTopManufacturerList() async { Future getTopManufacturerList() async {
Map<String, String> queryParams = {'page': '1', 'limit': '8'}; Map<String, String> queryParams = {'page': '1', 'limit': '8'};
try { try {
await baseAppClient.getPharmacy(GET_PHARMACY_TOP_MANUFACTURER, onSuccess: (dynamic response, int statusCode) { await baseAppClient.getPharmacy(GET_PHARMACY_TOP_MANUFACTURER,
onSuccess: (dynamic response, int statusCode) {
manufacturerList.clear(); manufacturerList.clear();
response['manufacturer'].forEach((item) { response['manufacturer'].forEach((item) {
Manufacturer manufacturer = Manufacturer.fromJson(item); Manufacturer manufacturer = Manufacturer.fromJson(item);
@ -131,7 +140,8 @@ class PharmacyModuleService extends BaseService {
'id,discount_ids,name,namen,localized_names,display_order,short_description,full_description,full_descriptionn,sku,order_minimum_quantity,order_maximum_quantity,price,old_price,images,is_rx,rx_message,rx_messagen,discount_name,discount_namen,approved_rating_sum,approved_total_reviews,allow_back_in_stock_subscriptions,stock_quantity,stock_availability,stock_availabilityn,discount_percentage,reviews', 'id,discount_ids,name,namen,localized_names,display_order,short_description,full_description,full_descriptionn,sku,order_minimum_quantity,order_maximum_quantity,price,old_price,images,is_rx,rx_message,rx_messagen,discount_name,discount_namen,approved_rating_sum,approved_total_reviews,allow_back_in_stock_subscriptions,stock_quantity,stock_availability,stock_availabilityn,discount_percentage,reviews',
}; };
try { try {
await baseAppClient.getPharmacy(GET_PHARMACY_BEST_SELLER_PRODUCT, onSuccess: (dynamic response, int statusCode) { await baseAppClient.getPharmacy(GET_PHARMACY_BEST_SELLER_PRODUCT,
onSuccess: (dynamic response, int statusCode) {
bestSellerProducts.clear(); bestSellerProducts.clear();
response['products'].forEach((item) { response['products'].forEach((item) {
bestSellerProducts.add(PharmacyProduct.fromJson(item)); bestSellerProducts.add(PharmacyProduct.fromJson(item));
@ -147,10 +157,14 @@ class PharmacyModuleService extends BaseService {
Future getLastVisitedProducts() async { Future getLastVisitedProducts() async {
String lastVisited = ""; String lastVisited = "";
if (await this.sharedPref.getString(PHARMACY_LAST_VISITED_PRODUCTS) != null) { if (await this.sharedPref.getString(PHARMACY_LAST_VISITED_PRODUCTS) !=
lastVisited = await this.sharedPref.getString(PHARMACY_LAST_VISITED_PRODUCTS); null) {
lastVisited =
await this.sharedPref.getString(PHARMACY_LAST_VISITED_PRODUCTS);
try { try {
await baseAppClient.getPharmacy("$GET_PHARMACY_PRODUCTs_BY_IDS$lastVisited", onSuccess: (dynamic response, int statusCode) { await baseAppClient
.getPharmacy("$GET_PHARMACY_PRODUCTs_BY_IDS$lastVisited",
onSuccess: (dynamic response, int statusCode) {
lastVisitedProducts.clear(); lastVisitedProducts.clear();
response['products'].forEach((item) { response['products'].forEach((item) {
lastVisitedProducts.add(PharmacyProduct.fromJson(item)); lastVisitedProducts.add(PharmacyProduct.fromJson(item));

@ -1,11 +1,9 @@
import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/Prescriptions.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/Prescriptions.dart';
class PrescriptionService extends BaseService { class PrescriptionService extends BaseService {
final AppSharedPreferences sharedPref = AppSharedPreferences(); final AppSharedPreferences sharedPref = AppSharedPreferences();
bool isFinished = true; bool isFinished = true;
@ -16,38 +14,42 @@ class PrescriptionService extends BaseService {
List<Prescriptions> _prescriptionsList = List(); List<Prescriptions> _prescriptionsList = List();
List<Prescriptions> get prescriptionsList => _prescriptionsList; List<Prescriptions> get prescriptionsList => _prescriptionsList;
Future getPrescription() async {
hasError = false;
url = PRESCRIPTION;
print("Print PRESCRIPTION url" + url);
await baseAppClient.post(url,
onSuccess: (dynamic response, int statusCode) {
_prescriptionsList.clear();
response['PatientPrescriptionList'].forEach((item) {
_prescriptionsList.add(Prescriptions.fromJson(item));
});
print(_prescriptionsList.length);
print(response);
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
});
}
// Future getPrescription() async { // Future getPrescription() async {
// hasError = false; // hasError = false;
// Map<String, dynamic> body = Map(); // url = PRESCRIPTION;
// body['isDentalAllowedBackend'] = false; // print("Print PRESCRIPTION url" + url);
// await baseAppClient.post(PRESCRIPTION, // await baseAppClient.get(url,
// onSuccess: (dynamic response, int statusCode) { // onSuccess: (dynamic response, int statusCode) {
// prescriptionsList.clear(); // _prescriptionsList.clear();
// response['PatientPrescriptionList'].forEach((prescriptions) { // response['PatientPrescriptionList'].forEach((item) {
// prescriptionsList.add(Prescriptions.fromJson(prescriptions)); // _prescriptionsList.add(Prescriptions.fromJson(item));
// }); // });
// print(_prescriptionsList.length);
// print(response);
// }, onFailure: (String error, int statusCode) { // }, onFailure: (String error, int statusCode) {
// hasError = true; // hasError = true;
// super.error = error; // super.error = error;
// }, body: body); // });
// } // }
Future getPrescription() async {
} url = PRESCRIPTION;
print("Print PRESCRIPTION url" + url);
hasError = false;
Map<String, dynamic> body = Map();
body['isDentalAllowedBackend'] = false;
print("Print PRESCRIPTION url" + url);
await baseAppClient.post(url,
onSuccess: (dynamic response, int statusCode) {
_prescriptionsList.clear();
response['PatientPrescriptionList'].forEach((prescriptions) {
_prescriptionsList.add(Prescriptions.fromJson(prescriptions));
});
print(_prescriptionsList.length);
print("response is -------------"+response);
print(response);
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
}

@ -1,6 +1,7 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HealthCalculator/ClinicCategory.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HealthCalculator/ClinicCategory.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HealthCalculator/DiseasesByClinic.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HealthCalculator/DiseasesByClinic.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HealthCalculator/ClinicCategory.dart';
import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/health-calculator/bariatrics-service.dart'; import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/health-calculator/bariatrics-service.dart';
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';

@ -0,0 +1,22 @@
import 'package:diplomaticquarterapp/core/service/ancillary_orders_service.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>();
Future getOrders() async {
hasError = false;
setState(ViewState.Busy);
await _ancillaryService.getOrders();
if (_ancillaryService.hasError) {
error = _ancillaryService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
}
}

@ -4,11 +4,14 @@ import 'package:diplomaticquarterapp/core/model/pharmacies/Manufacturer.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyImageObject.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyImageObject.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/Prescriptions.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/Prescriptions.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/recommendedProduct_model.dart';
import 'package:diplomaticquarterapp/core/service/medical/prescriptions_service.dart';
//import 'package:diplomaticquarterapp/core/model/prescriptions/perscription_pharmacy.dart'; //import 'package:diplomaticquarterapp/core/model/prescriptions/perscription_pharmacy.dart';
//import 'package:diplomaticquarterapp/core/service/medical/prescriptions_service.dart';
import 'package:diplomaticquarterapp/core/service/parmacyModule/parmacy_module_service.dart'; import 'package:diplomaticquarterapp/core/service/parmacyModule/parmacy_module_service.dart';
import 'package:diplomaticquarterapp/core/service/parmacyModule/prescription_service.dart'; import 'package:diplomaticquarterapp/core/service/parmacyModule/prescription_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
import 'package:diplomaticquarterapp/services/pharmacy_services/recommendedProduct_service.dart';
import '../../../locator.dart'; import '../../../locator.dart';
@ -17,6 +20,9 @@ class PharmacyModuleViewModel extends BaseViewModel {
PrescriptionService _prescriptionService = locator<PrescriptionService>(); PrescriptionService _prescriptionService = locator<PrescriptionService>();
RecommendedProductService _recommendedProductService = locator<RecommendedProductService>();
List<PharmacyImageObject> get bannerList => _pharmacyService.bannerItems; List<PharmacyImageObject> get bannerList => _pharmacyService.bannerItems;
List<Manufacturer> get manufacturerList => _pharmacyService.manufacturerList; List<Manufacturer> get manufacturerList => _pharmacyService.manufacturerList;
@ -27,9 +33,14 @@ class PharmacyModuleViewModel extends BaseViewModel {
List<PharmacyProduct> get lastVisitedProducts => List<PharmacyProduct> get lastVisitedProducts =>
_pharmacyService.lastVisitedProducts; _pharmacyService.lastVisitedProducts;
List<Products> get recommendedProductList =>
_recommendedProductService.recommendedList;
List<Prescriptions> get prescriptionsList => List<Prescriptions> get prescriptionsList =>
_prescriptionService.prescriptionsList; _prescriptionService.prescriptionsList;
bool hasError = false;
// List<PharmacyProduct> get pharmacyPrescriptionsList => PharmacyProduct.pharmacyPrescriptionsList ; // List<PharmacyProduct> get pharmacyPrescriptionsList => PharmacyProduct.pharmacyPrescriptionsList ;
Future getPharmacyHomeData() async { Future getPharmacyHomeData() async {
@ -125,15 +136,17 @@ class PharmacyModuleViewModel extends BaseViewModel {
} }
/////////////RecommendedProducts /////////////RecommendedProducts
// _getRecommendedProducts() async { getRecommendedProducts(productId) async {
// await _pharmacyService.getRecommendedProducts(); hasError = false;
// if (_pharmacyService.hasError) { setState(ViewState.Busy);
// error = _pharmacyService.error; await _recommendedProductService.getRecommendedProducts(productId);
// setState(ViewState.Error); if (_recommendedProductService.hasError) {
// } else { error = _recommendedProductService.error;
// setState(ViewState.Idle); setState(ViewState.Error);
// } } else {
// } setState(ViewState.Idle);
}
}
Future<bool> checkUserIsActivated() async { Future<bool> checkUserIsActivated() async {
if (authenticatedUserObject.isLogin) { if (authenticatedUserObject.isLogin) {
@ -161,4 +174,19 @@ class PharmacyModuleViewModel extends BaseViewModel {
} }
} }
///////////////////////or
// getPrescriptions() async {
// setState(ViewState.Busy);
// await _prescriptionsService.getPrescriptions();
// if (_prescriptionsService.hasError) {
// error = _prescriptionsService.error;
// setState(ViewState.Error);
// } else {
// _filterList();
// await _getPrescriptionsOrders();
// setState(ViewState.Idle);
// }
// }
} }

@ -24,7 +24,6 @@ class ProductDetailViewModel extends BaseViewModel{
Future getProductReviewsData(productID) async { Future getProductReviewsData(productID) async {
print('ENAD REview');
hasError = false; hasError = false;
setState(ViewState.Busy); setState(ViewState.Busy);
await _productDetailService.getProductReviews(productID); await _productDetailService.getProductReviews(productID);
@ -36,7 +35,6 @@ class ProductDetailViewModel extends BaseViewModel{
} }
Future getProductLocationData() async { Future getProductLocationData() async {
print('ENAD in model view');
hasError = false; hasError = false;
setState(ViewState.Busy); setState(ViewState.Busy);
await _productDetailService.getProductAvailabiltyDetail(); await _productDetailService.getProductAvailabiltyDetail();

@ -5,6 +5,7 @@ import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_v
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';
import 'package:diplomaticquarterapp/services/pharmacy_services/recommendedProduct_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/weather/weather_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/weather/weather_view_model.dart';
// import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/PharmacyAddressesViewModel.dart'; // import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/PharmacyAddressesViewModel.dart';
// import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/order_model_view_model.dart'; // import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/order_model_view_model.dart';
@ -217,6 +218,8 @@ void setupLocator() {
locator.registerLazySingleton(() => TermsConditionService()); locator.registerLazySingleton(() => TermsConditionService());
locator.registerLazySingleton(() => CancelOrderService()); locator.registerLazySingleton(() => CancelOrderService());
locator.registerLazySingleton(() => PrescriptionService()); locator.registerLazySingleton(() => PrescriptionService());
locator.registerLazySingleton(() => RecommendedProductService());
locator.registerLazySingleton(() => PrivilegeService()); locator.registerLazySingleton(() => PrivilegeService());
locator.registerLazySingleton(() => WeatherService()); locator.registerLazySingleton(() => WeatherService());

@ -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;
}
}

@ -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),
), ),
), ),
], ],

@ -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,
),
), ),
), ),
], ],

@ -58,8 +58,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 +102,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 +137,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 +161,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 +184,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 +195,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: PaymentService(),
),
),
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 +249,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 +271,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 +281,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 +292,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 +320,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 +331,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 +354,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 +365,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 +381,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 +409,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 +424,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,43 @@
import 'package:diplomaticquarterapp/core/viewModels/ancillary_orders_view_model.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/bmi_calculator/bmi_calculator.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/carbs/carbs.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/ovulation_period/ovulation_period.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.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';
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,
appBarTitle: TranslationBase.of(context).parking,
body: SingleChildScrollView(
padding: EdgeInsets.all(12), child: Container())));
}
}

@ -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();
}); });
} }

@ -147,7 +147,7 @@ class _LandingPagePharmacyState extends State<LandingPagePharmacy> {
PharmacyPage(), PharmacyPage(),
PharmacyCategorisePage(), PharmacyCategorisePage(),
// OffersCategorisePage(), // OffersCategorisePage(),
WishlistPage(), WishlistPage(false),
PharmacyProfilePage(), PharmacyProfilePage(),
// Container( // Container(
// child: Text('text'), // child: Text('text'),

@ -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),
), ),
), ),

@ -196,7 +196,9 @@ class _slideDetailState extends State<slideDetail> {
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
child: RichText( child: RichText(
text: TextSpan( text: TextSpan(
text: widget.data[index].specifications[0].name, text: widget.data[index].specifications != null ?
widget.data[index].specifications[0].name :
"No data",
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.black, color: Colors.black,
@ -211,7 +213,9 @@ class _slideDetailState extends State<slideDetail> {
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
child: RichText( child: RichText(
text: TextSpan( text: TextSpan(
text: widget.data[index].specifications[1].name, text: widget.data[index].specifications != null ?
widget.data[index].specifications[1].name :
"No data",
style: TextStyle( style: TextStyle(
color: Colors.black54, color: Colors.black54,
fontSize: 15, fontSize: 15,
@ -234,7 +238,9 @@ class _slideDetailState extends State<slideDetail> {
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
child: RichText( child: RichText(
text: TextSpan( text: TextSpan(
text: widget.data[index].specifications[2].name, text:widget.data[index].specifications != null ?
widget.data[index].specifications[2].name :
"No data",
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.black, color: Colors.black,
@ -249,7 +255,9 @@ class _slideDetailState extends State<slideDetail> {
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
child: RichText( child: RichText(
text: TextSpan( text: TextSpan(
text: widget.data[index].specifications[3].name, text: widget.data[index].specifications != null ?
widget.data[index].specifications[3].name :
"No data",
style: TextStyle( style: TextStyle(
color: Colors.black54, color: Colors.black54,
fontSize: 15, fontSize: 15,
@ -272,7 +280,9 @@ class _slideDetailState extends State<slideDetail> {
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
child: RichText( child: RichText(
text: TextSpan( text: TextSpan(
text: widget.data[index].specifications[4].name, text:widget.data[index].specifications != null ?
widget.data[index].specifications[4].name :
"No data",
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.black, color: Colors.black,
@ -287,7 +297,9 @@ class _slideDetailState extends State<slideDetail> {
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
child: RichText( child: RichText(
text: TextSpan( text: TextSpan(
text: widget.data[index].specifications[5].name, text:widget.data[index].specifications != null ?
widget.data[index].specifications[5].name :
"No data",
style: TextStyle( style: TextStyle(
color: Colors.black54, color: Colors.black54,
fontSize: 15, fontSize: 15,

@ -1,3 +1,6 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/pages/final_products_page.dart';
import 'package:diplomaticquarterapp/pages/login/register-info.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/brand_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/brand_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
@ -52,7 +55,7 @@ class _ProductBrandsPageState extends State<ProductBrandsPage> {
height: 220, height: 220,
width: double.infinity, width: double.infinity,
color: Colors.white, color: Colors.white,
child: topBrand(), child: topBrand(context),
), ),
SizedBox( SizedBox(
height: 10, height: 10,
@ -93,7 +96,7 @@ class _ProductBrandsPageState extends State<ProductBrandsPage> {
height: 10, height: 10,
), ),
Container( Container(
height: 230, height: 290,
width: double.infinity, width: double.infinity,
color: Colors.white, color: Colors.white,
child: ListView.builder( child: ListView.builder(
@ -117,7 +120,14 @@ class _ProductBrandsPageState extends State<ProductBrandsPage> {
), ),
), ),
onTap: () { onTap: () {
print("ENAD"); Navigator.push(
context,
MaterialPageRoute(
builder: (context) => FinalProductsPage(
id: model.brandsListList[index].id
.toString(),
)),
);
}, },
); );
}), }),
@ -130,7 +140,7 @@ class _ProductBrandsPageState extends State<ProductBrandsPage> {
} }
} }
topBrand() { topBrand(BuildContext context) {
return BaseView<BrandsViewModel>( return BaseView<BrandsViewModel>(
onModelReady: (model) => model.getTopBrandsData(), onModelReady: (model) => model.getTopBrandsData(),
builder: (_, model, wi) => GridView.count( builder: (_, model, wi) => GridView.count(
@ -173,7 +183,13 @@ topBrand() {
), ),
), ),
onTap: () { onTap: () {
print("ENAD"); Navigator.push(
context,
MaterialPageRoute(
builder: (context) => FinalProductsPage(
id: model.topBrandsListList[index].id.toString(),
)),
);
}, },
), ),
], ],

@ -1,9 +1,13 @@
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/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/login/welcome.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/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -19,8 +23,7 @@ int price = 0;
var languageID; var languageID;
bool isOverQuantity = false; bool isOverQuantity = false;
bool isInWishlit = false; bool isInWishlit = false;
var itemID; String itemID;
var product;
var customerId; var customerId;
CompareList compareItems = new CompareList(); CompareList compareItems = new CompareList();
PharmacyProduct specificationData; PharmacyProduct specificationData;
@ -38,16 +41,48 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
bool isReviews = false; bool isReviews = false;
bool isAvailabilty = false; bool isAvailabilty = false;
dynamic wishlistItems; dynamic wishlistItems;
var model;
// String ProductId="4561";
String productId = "";
checkWishlist() async {
GifLoaderDialogUtils.showMyDialog(context);
ProductDetailViewModel x = new ProductDetailViewModel();
await x.checkWishlistData();
// isInWishlit = x.wishListItems.map((e) => e.id.toString()).toList().contains(itemID);
for (int i = 0; i < x.wishListItems.length; i++) {
if (itemID == x.wishListItems[i].product.id) {
isInWishlit = true;
break;
} else {
isInWishlit = false;
}
}
GifLoaderDialogUtils.hideDialog(context);
setState(() {});
}
void initState() { void initState() {
price = 1; price = 1;
specificationData = widget.product; specificationData = widget.product;
setState(() { userInfo();
customerId = userInfo(widget.product.id, widget.product);
});
super.initState(); super.initState();
} }
void userInfo() async {
print(specificationData);
customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID);
if (customerId != null) {
itemID = widget.product.id;
checkWishlist();
// getSpecificationData(itemID);
}
print("customerId:$customerId");
setState(() {});
// getSpecificationData(itemID);
}
Widget build(BuildContext context) { Widget build(BuildContext context) {
return customerId != null return customerId != null
? DetailPageScafold( ? DetailPageScafold(
@ -161,7 +196,7 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
), ),
Container( Container(
width: 500, width: 500,
margin: EdgeInsets.only(bottom: 100), margin: EdgeInsets.only(bottom: 6),
// height: 350, // height: 350,
color: Colors.white, color: Colors.white,
child: Column( child: Column(
@ -266,60 +301,89 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
? Padding( ? Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment:
children: [ CrossAxisAlignment.start,
Container( children: [
child: Text( Container(
TranslationBase.of(context).description, child: Text(
style: TextStyle( TranslationBase.of(context)
fontSize: 17, .description,
color: Colors.grey, style: TextStyle(
fontWeight: FontWeight.w600), fontSize: 17,
color: Colors.grey,
fontWeight: FontWeight.w600),
),
), ),
), SizedBox(
SizedBox( height: 10,
height: 10,
),
Container(
child: Text(
languageID == 'ar'
? widget.product.shortDescriptionn
: widget.product.shortDescription ??
"",
style: TextStyle(
fontSize: 16,
fontFamily: 'WorkSans-Regular'),
), ),
), Divider(height: 1, color: Colors.grey),
SizedBox( SizedBox(
height: 10, height: 15,
),
Container(
child: Text(
TranslationBase.of(context).howToUse,
style: TextStyle(
fontSize: 17,
color: Colors.grey,
fontWeight: FontWeight.w600),
), ),
), Container(
SizedBox( child: Text(
height: 10, languageID == 'ar'
), ? widget.product.fullDescriptionn
Container( : widget.product
child: Text( .fullDescription ??
languageID == 'ar' "",
? widget.product.fullDescriptionn style: TextStyle(
: widget.product.fullDescription, fontSize: 16,
style: TextStyle( fontFamily: 'WorkSans-Regular'),
fontSize: 16, ),
fontFamily: 'WorkSans-Regular'),
), ),
), SizedBox(
], height: 20,
), ),
]),
) )
// Container(
// child: Text(
// languageID == 'ar'
// ? widget.product.fullDescriptionn
// : widget.product.fullDescription,
// style: TextStyle(
// fontSize: 16,
// fontFamily: 'WorkSans-Regular'),
// ),
// ),
// SizedBox(
// height: 10,
// ),
// Container(
// child: Text(
// TranslationBase.of(context).howToUse,
// style: TextStyle(
// fontSize: 17,
// color: Colors.grey,
// fontWeight: FontWeight.w600),
// ),
// ),
// SizedBox(
// height: 6,
// ),
// Divider(
// height: 2,
// color: Colors.grey),
// SizedBox(
// height: 10,
// ),
// Container(
// child: Text(
// languageID == 'ar'
// ? widget.product.shortDescriptionn
// : widget.product.shortDescription,
// style: TextStyle(
// fontSize: 16,
// fontFamily: 'WorkSans-Regular'),
// ),
// ),
// ],
// ),
// )
: isReviews : isReviews
? BaseView<ProductDetailViewModel>( ? BaseView<ProductDetailViewModel>(
onModelReady: (model) => onModelReady: (model) =>
@ -537,7 +601,248 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
], ],
), ),
), ),
// ListView(scrollDirection: Axis.vertical, shrinkWrap: true, children: [Text('ENAD')]), Row(
children: [
// Container(
// width: 500,
// height: 100,
// margin: EdgeInsets.only(bottom: 100),
// color: Colors.white,
// child: Text("ENAD TEST"),
// ),
Container(
width: 410,
height: 50,
// margin: EdgeInsets.only(bottom: 5),
color: Colors.white,
child: Texts(
TranslationBase.of(context).recommended,
bold: true,
),
),
],
),
SingleChildScrollView(
child: Container(
color: Colors.white,
child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
// mainAxisSize: MainAxisSize.min,
children: [
Container(
color: Colors.white,
height: 210,
margin: EdgeInsets.only(bottom: 75),
padding: EdgeInsets.only(bottom: 5),
// margin: EdgeInsets.symmetric(horizontal: 6, vertical: 4),
child: BaseView<PharmacyModuleViewModel>(
onModelReady: (model) =>
model.getRecommendedProducts(widget.product.id.toString()),
builder: (_, model, wi) =>
Container(
child:
// Text(model.recommendedProductList[0].id),
model.recommendedProductList.length != null
? Expanded(
child: ListView.builder(
scrollDirection: Axis.horizontal,
shrinkWrap: true,
physics: ScrollPhysics(),
// physics: NeverScrollableScrollPhysics(),
itemCount: model.recommendedProductList.length,
itemBuilder: (context, index) {
return Card(
elevation: 2,
shape: RoundedRectangleBorder(
side: BorderSide(
color: Colors.grey[300], width: 2),
borderRadius: BorderRadius.circular(10)),
margin: EdgeInsets.symmetric(
horizontal: 8,
vertical: 0,
),
child: Container(
decoration: BoxDecoration(
borderRadius: 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),
child: (model.recommendedProductList[index].images != null &&
model.recommendedProductList[index].images.length > 0)
? Image.network(
model.recommendedProductList[index].images[0].src.toString(),
// item.images[0].src,
fit: BoxFit.cover,
height: 60,
)
: Image.asset(
"assets/images/no_image.png",
fit: BoxFit.cover,
height: 60,
),
),
Container(
width: model
.recommendedProductList[
index]
.rxMessage !=
null
? MediaQuery.of(context)
.size
.width /
5
: 0,
padding: EdgeInsets.all(4),
decoration: BoxDecoration(
color: Color(0xffb23838),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(6)),
),
child: Texts(
model.recommendedProductList[index]
.rxMessage !=
null
? model
.recommendedProductList[
index]
.rxMessage
: "",
color: Colors.white,
regular: true,
fontSize: 10,
fontWeight: FontWeight.w400,
),
),
]),
Container(
margin: EdgeInsets.symmetric(
horizontal: 6,
vertical: 0,
),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
languageID == "ar"
? model.recommendedProductList[index].namen
: model.recommendedProductList[index].name,
style: TextStyle(
color: Colors.black,
fontSize: 13.0,
// fontWeight: FontWeight.bold,
),
),
Padding(
// padding: const EdgeInsets.only(top: 15, bottom: 10),
padding: const EdgeInsets.only(
top: 10, bottom: 5),
child: Texts(
"SAR ${model.recommendedProductList[index].price}",
bold: true,
fontSize: 14,
),
),
],
),
),
Row(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
Container(
padding:
EdgeInsets.only(right: 10),
// margin: EdgeInsets.only(left: 5),
child: Align(
alignment: Alignment.topLeft,
child: RatingBar.readOnly(
initialRating: model
.recommendedProductList[
index]
.approvedRatingSum
.toDouble(),
// initialRating: productRate,
size: 13.0,
filledColor:
Colors.yellow[700],
emptyColor: Colors.grey[500],
isHalfAllowed: true,
halfFilledIcon:
Icons.star_half,
filledIcon: Icons.star,
emptyIcon: Icons.star,
),
),
),
Texts(
"(${model.recommendedProductList[index].approvedTotalReviews.toString()})",
// bold: true,
fontSize: 12,
),
]),
],
),
),
);
}),
)
: Container(
// child: Text("NO DATA"),
),
)
),
),
],
),
),
)
], ],
), ),
), ),
@ -768,6 +1073,39 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
fontWeight: FontWeight.w600), fontWeight: FontWeight.w600),
), ),
), ),
SizedBox(
height: 6,
),
Divider(height: 1, color: Colors.grey),
SizedBox(
height: 10,
),
Container(
child: Text(
languageID == 'ar'
? widget.product.shortDescriptionn
: widget.product.shortDescription,
style: TextStyle(
fontSize: 16,
fontFamily: 'WorkSans-Regular'),
),
),
SizedBox(
height: 10,
),
Container(
child: Text(
TranslationBase.of(context).howToUse,
style: TextStyle(
fontSize: 17,
color: Colors.grey,
fontWeight: FontWeight.w600),
),
),
SizedBox(
height: 6,
),
Divider(height: 2, color: Colors.grey),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
@ -1394,7 +1732,9 @@ class _footerWidgetState extends State<footerWidget> {
}, },
), ),
), ),
!widget.isAvailble && price > 0 || price > widget.quantityLimit !widget.isAvailble && price > 0 ||
price > widget.quantityLimit ||
widget.item.rxMessage != null
? Container( ? Container(
width: 190, width: 190,
height: 46, height: 46,
@ -1431,7 +1771,9 @@ class _footerWidgetState extends State<footerWidget> {
SizedBox( SizedBox(
width: 5, width: 5,
), ),
!widget.isAvailble && price > 0 || price > widget.quantityLimit !widget.isAvailble && price > 0 ||
price > widget.quantityLimit ||
widget.item.rxMessage != null
? Container( ? Container(
width: 120, width: 120,
height: 46, height: 46,
@ -1498,7 +1840,7 @@ class _productNameAndPriceState extends State<productNameAndPrice> {
child: Row( child: Row(
children: [ children: [
Text( Text(
widget.item.price.toString(), widget.item.price.toString() + " " + "SAR",
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 30), style: TextStyle(fontWeight: FontWeight.bold, fontSize: 30),
), ),
SizedBox( SizedBox(
@ -1543,27 +1885,24 @@ class _productNameAndPriceState extends State<productNameAndPrice> {
color: Colors.grey, color: Colors.grey,
borderRadius: BorderRadius.circular(30), borderRadius: BorderRadius.circular(30),
), ),
child: !isInWishlit child: IconButton(
? IconButton( icon: Icon(!isInWishlit
icon: Icon(Icons.favorite_border), ? Icons.favorite_border
color: Colors.white, : Icons.favorite),
onPressed: () { color: !isInWishlit ? Colors.white : Colors.red,
setState(() { onPressed: () async {
addToWishlistFunction(widget.item.id); if (customerId != null) {
}); if (!isInWishlit) {
// MyStatelessWidget(); await addToWishlistFunction(widget.item.id);
}, } else {
) await deleteFromWishlistFunction(widget.item.id);
: IconButton( }
icon: Icon(Icons.favorite), } else {
color: Colors.red, return;
onPressed: () { }
setState(() { setState(() {});
deleteFromWishlistFunction(widget.item.id); },
}); )),
// MyStatelessWidget();
},
)),
], ],
), ),
), ),
@ -1630,135 +1969,6 @@ class _productNameAndPriceState extends State<productNameAndPrice> {
} }
} }
//productNameAndPrice(BuildContext context, item) {
// return Column(
// mainAxisAlignment: MainAxisAlignment.start,
// children: [
// Padding(
// padding: const EdgeInsets.all(8.0),
// child: Row(
// children: [
// Text(
// item.price.toString(),
// style: TextStyle(fontWeight: FontWeight.bold, fontSize: 30),
// ),
// SizedBox(
// width: 40,
// ),
// Text(
// item.stockAvailability,
// style: item.stockAvailability == 'Out of stock'
// ? TextStyle(fontWeight: FontWeight.bold, color: Colors.red)
// : TextStyle(fontWeight: FontWeight.bold, color: Colors.green),
// ),
// SizedBox(width: 20),
// item.stockAvailability == 'Out of stock'
// ? Text(
// TranslationBase.of(context).notifyMe,
// style: TextStyle(
// color: Colors.blue,
// decoration: TextDecoration.underline,
// ),
// )
// : Container(),
// item.stockAvailability == 'Out of stock'
// ? Icon(
// FontAwesomeIcons.bell,
// color: Colors.blue,
// size: 15.0,
// )
// : Container(),
//
// Container(
// margin: languageID=='ar' ? EdgeInsets.only(right: 25) : EdgeInsets.only(left: 25),
// width: 40,
// height: 40,
// decoration: BoxDecoration(
// color: Colors.grey,
// borderRadius: BorderRadius.circular(30),
// ),
// child: !isInWishlit ?IconButton(
// icon: Icon(Icons.favorite_border),
// color: Colors.white,
// onPressed: () {
// addToWishlistFunction(item.id);
//// MyStatelessWidget();
//
// },
// ):IconButton(
// icon: Icon(Icons.favorite),
// color: Colors.red,
// onPressed: () {
// deleteFromWishlistFunction(item.id);
//// MyStatelessWidget();
//
// },
// )
// ),
//
// ],
// ),
// ),
// Padding(
// padding: const EdgeInsets.all(8.0),
// child: Container(
// margin: EdgeInsets.only(left: 5),
// child: Align(
// alignment:
// languageID == 'ar' ? Alignment.topRight : Alignment.topLeft,
// child: Text(
// languageID == 'ar' ? item.fullDescriptionn : item.fullDescription,
// style: TextStyle(fontWeight: FontWeight.bold, fontSize: 15),
// ),
// ),
// ),
// ),
// Row(
// children: [
// Expanded(
// flex: 2,
// child: Container(
// margin: EdgeInsets.only(right: 150),
// child: Align(
// alignment: Alignment.bottomLeft,
// child: RatingBar.readOnly(
// initialRating: 3,
// size: 15.0,
// filledColor: Colors.yellow[700],
// emptyColor: Colors.grey[500],
// isHalfAllowed: true,
// halfFilledIcon: Icons.star_half,
// filledIcon: Icons.star,
// emptyIcon: Icons.star,
// ),
// ),
// ),
// ),
// Expanded(
// flex: 1,
// child: Container(
// child: item.rxMessage != null
// ? Text(
// languageID == 'ar'
// ? item.rxMessagen.toString()
// : item.rxMessage.toString(),
// style: TextStyle(color: Colors.red, fontSize: 10),
// )
// : Container()),
// ),
// item.rxMessage != null
// ? Icon(
// FontAwesomeIcons.questionCircle,
// color: Colors.red,
// size: 15.0,
// )
// : Container(),
// ],
// ),
// ],
// );
//}
slideDetail() { slideDetail() {
return Row( return Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
@ -1823,22 +2033,21 @@ addToWishlistFunction(itemID) async {
deleteFromWishlistFunction(itemID) async { deleteFromWishlistFunction(itemID) async {
ProductDetailViewModel x = new ProductDetailViewModel(); ProductDetailViewModel x = new ProductDetailViewModel();
isInWishlit = false; isInWishlit = false;
await x.addToWishlistData(itemID); await x.deletWishlistData(itemID);
} }
checkWishlist() async { checkWishlist() async {
ProductDetailViewModel x = new ProductDetailViewModel(); ProductDetailViewModel x = new ProductDetailViewModel();
await x.checkWishlistData(); await x.checkWishlistData();
// isInWishlit = x.wishListItems.map((e) => e.id.toString()).toList().contains(itemID);
for (int i = 0; i < x.wishListItems.length; i++) { for (int i = 0; i < x.wishListItems.length; i++) {
// print(itemID);
// print(x.wishListItems[i].product.id);
if (itemID == x.wishListItems[i].product.id) { if (itemID == x.wishListItems[i].product.id) {
isInWishlit = true; isInWishlit = true;
// print('in wishlist');
break; break;
} else { } else {
isInWishlit = false; isInWishlit = false;
// print('not in wishlist');
} }
} }
} }
@ -1858,8 +2067,8 @@ settingModalBottomSheet(context) {
child: new Wrap( child: new Wrap(
children: <Widget>[ children: <Widget>[
new ListTile( new ListTile(
leading: new Icon(Icons.shopping_cart), leading: Icon(Icons.shopping_cart),
title: new Text('Add to cart'), title: Text('Add to cart'),
onTap: () => { onTap: () => {
if (price > 0) if (price > 0)
{addToCartFunction(price, itemID)} {addToCartFunction(price, itemID)}
@ -1869,14 +2078,14 @@ settingModalBottomSheet(context) {
message: "you should add quantity") message: "you should add quantity")
} }
}), }),
new ListTile( ListTile(
leading: new Icon(Icons.favorite_border), leading: Icon(Icons.favorite_border),
title: new Text('Add to wishlist'), title: Text('Add to wishlist'),
onTap: () => {addToWishlistFunction(itemID)}, onTap: () => {addToWishlistFunction(itemID)},
), ),
new ListTile( ListTile(
leading: new Icon(Icons.compare), leading: Icon(Icons.compare),
title: new Text('Compare'), title: Text('Compare'),
onTap: () => { onTap: () => {
Provider.of<CompareList>(context, listen: false) Provider.of<CompareList>(context, listen: false)
.addItem(specificationData), .addItem(specificationData),
@ -1887,15 +2096,3 @@ settingModalBottomSheet(context) {
); );
}); });
} }
Future userInfo(id, product) async {
customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID);
if (customerId != null) {
itemID = id;
product = product;
checkWishlist();
}
print("customerId:$customerId");
return customerId;
// getSpecificationData(itemID);
}

@ -1,31 +1,73 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/config/size_config.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/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/landing/home_page.dart'; import 'package:diplomaticquarterapp/pages/landing/home_page.dart';
import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_home_page.dart'; import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_home_page.dart';
import 'package:diplomaticquarterapp/pages/offers_categorise_page.dart'; import 'package:diplomaticquarterapp/pages/offers_categorise_page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/product-brands.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/product-brands.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/product_detail.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/lacum-activitaion-vida-page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/lakum-main-page.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/lakum-main-page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/recommended-product-page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/widgets/BannerPager.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/widgets/BannerPager.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/widgets/ProductTileItem.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/widgets/ProductTileItem.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/widgets/manufacturerItem.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/widgets/manufacturerItem.dart';
import 'package:diplomaticquarterapp/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart'; import 'package:diplomaticquarterapp/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/borderedButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/borderedButton.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/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:rating_bar/rating_bar.dart'; import 'package:rating_bar/rating_bar.dart';
import '../../final_products_page.dart'; import '../../final_products_page.dart';
import 'lacum-activitaion-vida-page.dart'; import 'lacum-activitaion-vida-page.dart';
class PharmacyPage extends StatelessWidget { bool isInWishlist = false;
int price = 0;
var itemID;
var product;
var customerId;
var item;
dynamic languageID;
List wishlistData;
class PharmacyPage extends StatefulWidget {
// final PharmacyProduct product;
// PharmacyPage(this.product);
@override
_PharmacyPageState createState() => _PharmacyPageState();
}
class _PharmacyPageState extends State<PharmacyPage> {
// dynamic wishlistVar;
getLanguageID() async {
languageID = await sharedPref.getString(APP_LANGUAGE);
}
List<RecommendedProductModel> recommendedProductList = [];
List<ProductDetailViewModel> wishList = [];
var model;
// String ProductId="4561";
//String id ="3608";
String productId = "";
String id = "";
@override @override
void initState() { void initState() {
// print("model prescription " + model.prescriptionsList.length); checkWishlist();
// cancelOrderDetail(order) // userInfo(widget.product.id, widget.product);
userInfo(id, product);
print("-------------this--------------");
print(itemID);
} }
@override @override
@ -46,7 +88,7 @@ class PharmacyPage extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
BannerPager(model), BannerPager(model),
GridViewButtons(model), // GridViewButtons(model),
Container( Container(
margin: EdgeInsets.fromLTRB(10, 10, 10, 10), margin: EdgeInsets.fromLTRB(10, 10, 10, 10),
child: Row( child: Row(
@ -72,9 +114,12 @@ class PharmacyPage extends StatelessWidget {
), ),
), ),
Container( Container(
height: model.prescriptionsList.length > 0
? MediaQuery.of(context).size.height * 0.28
: 0,
padding: padding:
EdgeInsets.symmetric(horizontal: 16.0, vertical: 24.0), EdgeInsets.symmetric(horizontal: 18.0, vertical: 14.0),
height: MediaQuery.of(context).size.height * 0.30, // height: MediaQuery.of(context).size.height * 0.28,
// width: 200.0, // width: 200.0,
// height: MediaQuery.of(context).size.height / 4 + 20, // height: MediaQuery.of(context).size.height / 4 + 20,
margin: EdgeInsets.only(left: 10), margin: EdgeInsets.only(left: 10),
@ -88,15 +133,14 @@ class PharmacyPage extends StatelessWidget {
shrinkWrap: true, shrinkWrap: true,
physics: ScrollPhysics(), physics: ScrollPhysics(),
// physics: NeverScrollableScrollPhysics(), // physics: NeverScrollableScrollPhysics(),
// itemCount: 4,
itemCount: model.prescriptionsList.length, itemCount: model.prescriptionsList.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
return Container( return Container(
// width: 160.0, // width: 160.0,
height: height:
MediaQuery.of(context).size.height * 0.6, MediaQuery.of(context).size.height * 0.6,
padding: padding: EdgeInsets.only(
EdgeInsets.only(bottom: 5.0, left: 5.0), bottom: 5.0, left: 5.0, right: 8.0),
margin: EdgeInsets.only(right: 10.0), margin: EdgeInsets.only(right: 10.0),
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border.all( border: Border.all(
@ -117,17 +161,41 @@ class PharmacyPage extends StatelessWidget {
padding: EdgeInsets.only( padding: EdgeInsets.only(
top: 10.0, top: 10.0,
left: 10.0, left: 10.0,
right: 3.0, right: 10.0,
bottom: 15.0, bottom: 15.0,
), ),
child: Image.network( child: CircleAvatar(
model.prescriptionsList[index] radius: 30,
.doctorImageURL, backgroundColor:
width: 60, Colors.transparent,
height: 60, child: Image.network(
model.prescriptionsList[index]
.doctorImageURL,
width: 60,
height: 60,
),
), ),
), ),
]), ]),
// Column(
// // crossAxisAlignment: CrossAxisAlignment.center,
// children: [
// Container(
// margin: EdgeInsets.only(left: 1),
// padding: EdgeInsets.only(
// top: 10.0,
// left: 10.0,
// right: 3.0,
// bottom: 15.0,
// ),
// child: Image.network(
// model.prescriptionsList[index]
// .doctorImageURL,
// width: 60,
// height: 60,
// ),
// ),
// ]),
Column( Column(
// crossAxisAlignment: CrossAxisAlignment.center, // crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
@ -148,11 +216,17 @@ class PharmacyPage extends StatelessWidget {
BorderRadius.circular( BorderRadius.circular(
30.0)), 30.0)),
child: Text( child: Text(
model languageID == "ar"
.prescriptionsList[ ? model
index] .prescriptionsList[
.isInOutPatientDescription index]
.toString(), .isInOutPatientDescriptionN
.toString()
: model
.prescriptionsList[
index]
.isInOutPatientDescription
.toString(),
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.white,
fontSize: 15.0, fontSize: 15.0,
@ -166,9 +240,14 @@ class PharmacyPage extends StatelessWidget {
height: 30, height: 30,
), ),
Text( Text(
model.prescriptionsList[index] DateUtil.convertStringToDate(
.appointmentDate model
.toString(), .prescriptionsList[
index]
.appointmentDate
.toString())
.toString()
.substring(0, 10),
style: TextStyle( style: TextStyle(
color: Colors.black, color: Colors.black,
fontSize: 15.0, fontSize: 15.0,
@ -239,6 +318,10 @@ class PharmacyPage extends StatelessWidget {
child: Align( child: Align(
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
child: RatingBar.readOnly( child: RatingBar.readOnly(
initialRating: model
.prescriptionsList[index]
.actualDoctorRate
.toDouble(),
// initialRating: productRate, // initialRating: productRate,
size: 15.0, size: 15.0,
filledColor: filledColor:
@ -259,36 +342,238 @@ class PharmacyPage extends StatelessWidget {
: Container(), : Container(),
), ),
), ),
Container( // Container(
margin: EdgeInsets.fromLTRB(10, 10, 10, 10), // margin: EdgeInsets.fromLTRB(10, 10, 10, 10),
child: Row( // child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, // mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ // children: [
Texts( // Texts(
TranslationBase.of(context).recommended, // TranslationBase.of(context).recommended,
bold: true, // bold: true,
), // ),
BorderedButton( // BorderedButton(
TranslationBase.of(context).viewAll, // TranslationBase.of(context).viewAll,
hasBorder: true, // hasBorder: true,
borderColor: Colors.green, // borderColor: Colors.green,
textColor: Colors.green, // textColor: Colors.green,
vPadding: 6, // vPadding: 6,
hPadding: 4, // hPadding: 4,
handler: () {}, // handler: () {
), // Navigator.push(
], // context,
), // MaterialPageRoute(
), // builder: (context) =>
Container( // RecommendedProductPage(productId : "2316")));
height: MediaQuery.of(context).size.height / 4 + 20, // },
child: ListView.builder( // ),
itemBuilder: (ctx, i) => // ],
ProductTileItem(model.bestSellerProduct[i]), // ),
scrollDirection: Axis.horizontal, // ),
itemCount: model.bestSellerProduct.length, // Container(
), // height: model.recommendedProductList.length > 0
), // ? MediaQuery.of(context).size.height * 0.32
// : 0,
// margin: EdgeInsets.symmetric(horizontal: 6, vertical: 4),
//// padding: EdgeInsets.symmetric(horizontal: 5.0, vertical: 22.0),
//// margin: EdgeInsets.only(left: 10),
// child: BaseView<PharmacyModuleViewModel>(
// onModelReady: (model) =>
// model.getRecommendedProducts(productId),
// builder: (_, model, wi) => model
// .recommendedProductList.length !=
// null
// ? ListView.builder(
// scrollDirection: Axis.horizontal,
// shrinkWrap: true,
// physics: ScrollPhysics(),
// // physics: NeverScrollableScrollPhysics(),
// itemCount: model.recommendedProductList.length,
// itemBuilder: (context, index) {
// return Card(
// elevation: 2,
// shape: RoundedRectangleBorder(
// side: BorderSide(
// color: Colors.grey[300], width: 2),
// borderRadius: BorderRadius.circular(10)),
// margin: EdgeInsets.symmetric(
// horizontal: 8,
// vertical: 0,
// ),
// child: Container(
// decoration: BoxDecoration(
// borderRadius: 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),
// child: (model.recommendedProductList[index].images != null &&
// model.recommendedProductList[index].images.length > 0)
// ? Image.network(
// model.recommendedProductList[index].images[0].src.toString(),
//// item.images[0].src,
// fit: BoxFit.cover,
// height: 60,
// )
// : Image.asset(
// "assets/images/no_image.png",
// fit: BoxFit.cover,
// height: 60,
// ),
// ),
// Container(
// width: model
// .recommendedProductList[
// index]
// .rxMessage !=
// null
// ? MediaQuery.of(context)
// .size
// .width /
// 5
// : 0,
// padding: EdgeInsets.all(4),
// decoration: BoxDecoration(
// color: Color(0xffb23838),
// borderRadius: BorderRadius.only(
// topLeft: Radius.circular(6)),
// ),
// child: Texts(
// model.recommendedProductList[index]
// .rxMessage !=
// null
// ? model
// .recommendedProductList[
// index]
// .rxMessage
// : "",
// color: Colors.white,
// regular: true,
// fontSize: 10,
// fontWeight: FontWeight.w400,
// ),
// ),
// ]),
// Container(
// margin: EdgeInsets.symmetric(
// horizontal: 6,
// vertical: 0,
// ),
// child: Column(
// crossAxisAlignment:
// CrossAxisAlignment.start,
// children: [
// Text(
// languageID == "ar"
// ? model.recommendedProductList[index].namen
// : model.recommendedProductList[index].name,
// style: TextStyle(
// color: Colors.black,
// fontSize: 13.0,
//// fontWeight: FontWeight.bold,
// ),
// ),
// Padding(
//// padding: const EdgeInsets.only(top: 15, bottom: 10),
// padding: const EdgeInsets.only(
// top: 10, bottom: 5),
// child: Texts(
// "SAR ${model.recommendedProductList[index].price}",
// bold: true,
// fontSize: 14,
// ),
// ),
// ],
// ),
// ),
// Row(
// crossAxisAlignment:
// CrossAxisAlignment.start,
// children: <Widget>[
// Container(
// padding:
// EdgeInsets.only(right: 10),
//// margin: EdgeInsets.only(left: 5),
// child: Align(
// alignment: Alignment.topLeft,
// child: RatingBar.readOnly(
// initialRating: model
// .recommendedProductList[
// index]
// .approvedRatingSum
// .toDouble(),
//// initialRating: productRate,
// size: 13.0,
// filledColor:
// Colors.yellow[700],
// emptyColor: Colors.grey[500],
// isHalfAllowed: true,
// halfFilledIcon:
// Icons.star_half,
// filledIcon: Icons.star,
// emptyIcon: Icons.star,
// ),
// ),
// ),
// Texts(
// "(${model.recommendedProductList[index].approvedTotalReviews.toString()})",
//// bold: true,
// fontSize: 12,
// ),
// ]),
// ],
// ),
// ),
// );
// })
// : Container(
//// child: Text("NO DATA"),
// ),
// ),
// ),
Container( Container(
margin: EdgeInsets.fromLTRB(10, 10, 10, 0), margin: EdgeInsets.fromLTRB(10, 10, 10, 0),
child: Row( child: Row(
@ -411,6 +696,49 @@ class PharmacyPage extends StatelessWidget {
), ),
); );
} }
addToWishlistFunction(itemID) async {
ProductDetailViewModel x = new ProductDetailViewModel();
isInWishlist = true;
await x.addToWishlistData(itemID);
}
deleteFromWishlistFunction(itemID) async {
ProductDetailViewModel x = new ProductDetailViewModel();
isInWishlist = false;
await x.addToWishlistData(itemID);
}
checkWishlist() async {
ProductDetailViewModel x = new ProductDetailViewModel();
await x.checkWishlistData();
for (int i = 0; i < x.wishListItems.length; i++) {
// itemID = x.wishListItems[i].id;
print("-------------wishlist---------------");
print(itemID);
// print(product.id);
print(x.wishListItems[i].productId);
if (itemID == x.wishListItems[i].productId) {
isInWishlist = true;
// print('in wishlist');
break;
} else {
isInWishlist = false;
// print('not in wishlist');
}
}
}
Future userInfo(id, product) async {
customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID);
if (customerId != null) {
itemID = id;
product = product;
checkWishlist();
}
print("customerId:$customerId");
return customerId;
}
} }
class GridViewButtons extends StatelessWidget { class GridViewButtons extends StatelessWidget {
@ -544,4 +872,41 @@ class GridViewCard extends StatelessWidget {
), ),
); );
} }
String getDate(String date) {
DateTime dateObj = DateUtil.convertStringToDate(date);
return DateUtil.getWeekDay(dateObj.weekday) +
", " +
dateObj.day.toString() +
" " +
DateUtil.getMonth(dateObj.month) +
" " +
dateObj.year.toString();
}
} }
class test extends StatefulWidget {
@override
_testState createState() => _testState();
}
class _testState extends State<test> {
@override
Widget build(BuildContext context) {
return Container();
}
}
//addWishlistData() async {
// ProductDetailViewModel x = new ProductDetailViewModel();
// await wishlistData.add(x.checkWishlistData());
// print("-------------testWishlist---------------");
//
//}
// checkWishlist() async {
// ProductDetailViewModel x = new ProductDetailViewModel();
// wishlistVar = await x.checkWishlistData();
// print("wishlistVar>>>>>>>>>>>>>>>");
// print(wishlistVar);
//
// }

@ -0,0 +1,997 @@
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/product_detail_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:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:rating_bar/rating_bar.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
dynamic languageID;
bool isInWishlist = false;
int price = 0;
var itemID;
var product;
var customerId;
class RecommendedProductPage extends StatefulWidget {
String productId ;
RecommendedProductPage({this.productId});
@override
_RecommendedProductPageState createState() => _RecommendedProductPageState(productId: productId);
}
class _RecommendedProductPageState extends State<RecommendedProductPage>
with SingleTickerProviderStateMixin {
List<RecommendedProductModel> recommendedProductList = [];
String productId;
_RecommendedProductPageState({this.productId});
String id = "";
bool styleOne = true;
bool styleTwo = false;
Icon styleIcon = Icon(
Icons.widgets_sharp,
color: Colors.blue,
size: 29.0,
);
getLanguageID() async {
languageID = await sharedPref.getString(APP_LANGUAGE);
}
// String productId = "4561";
// String productId = "";
@override
void initState() {
checkWishlist();
userInfo(id, product);
print("-------------this--------------");
print(itemID);
}
@override
Widget build(BuildContext context) {
var size = MediaQuery.of(context).size;
final double itemHeight = ((size.height - kToolbarHeight - 24) * 0.80) / 2;
final double itemWidth = size.width / 2;
return BaseView<PharmacyModuleViewModel>(
onModelReady: (model) => model.getRecommendedProducts(productId),
builder: (_, model, wi) => AppScaffold(
appBarTitle: TranslationBase.of(context).recommended,
baseViewModel: model,
isShowAppBar: true,
isPharmacy: true,
backgroundColor: Colors.white,
body: SingleChildScrollView(
child: Column(children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Container(
padding: EdgeInsets.only(
top: 8,
bottom: 10,
left: 10,
),
child: Text(
model.recommendedProductList.length.toString(),
style: TextStyle(
color: Colors.black,
fontSize: 14.0,
),
),
),
Container(
padding: EdgeInsets.only(top: 8, bottom: 10, left: 8),
child: Text(
TranslationBase.of(context).result,
style: TextStyle(
color: Colors.black,
fontSize: 14.0,
),
),
),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Padding(
padding: const EdgeInsets.symmetric(vertical: 8),
child: SizedBox(
child: Container(
width: 1,
color: Colors.grey,
),
),
),
Container(
child: Image.asset(
'assets/images/pharmacy/sort.png',
width: 20,
height: 20,
// color: Colors.red,
),
),
Container(
child: Text(
TranslationBase.of(context).sort,
style: TextStyle(
color: Colors.black,
fontSize: 14.0,
),
),
),
Padding(
padding: const EdgeInsets.symmetric(vertical: 8),
child: SizedBox(
child: Container(
width: 1,
color: Colors.grey,
),
),
),
Divider(
thickness: 1.0,
color: Colors.black12,
),
Padding(
padding: EdgeInsets.all(8.0),
child: InkWell(
child: styleIcon,
onTap: () {
setState(() {
if (styleOne == true) {
styleOne = false;
styleTwo = true;
styleIcon = Icon(
Icons.auto_awesome_mosaic,
color: Colors.blue,
size: 29.0,
);
} else {
styleOne = true;
styleTwo = false;
styleIcon = Icon(
Icons.widgets_sharp,
color: Colors.blue,
size: 29.0,
);
}
});
},
),
),
],
),
]),
SizedBox(
height: 2,
),
Divider(
color: Colors.grey[350],
height: 10,
thickness: 6,
indent: 0,
endIndent: 0,
),
styleOne == true
? Container(
margin: EdgeInsets.all(5.0),
child: model.recommendedProductList.length != null
? CustomScrollView(
primary: false,
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
slivers: <Widget>[
SliverPadding(
padding: const EdgeInsets.fromLTRB(0, 0, 0, 0),
sliver: SliverGrid.count(
crossAxisCount: 2,
childAspectRatio: (itemWidth / itemHeight),
children: model.recommendedProductList
.map((e) => Card(
elevation: 2,
shape: RoundedRectangleBorder(
side: BorderSide(
color: Colors.grey[300],
width: 2),
borderRadius:
BorderRadius.circular(
10)),
margin: EdgeInsets.symmetric(
horizontal: 8,
vertical: 11,
),
child: Container(
decoration: BoxDecoration(
borderRadius:
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:
itemID.contains(e.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),
child: (e.images !=
null &&
e.images.length >
0)
? Image.network(
e.images[0]
.src
.toString(),
// item.images[0].src,
fit: BoxFit
.cover,
height: 60,
)
: Image.asset(
"assets/images/no_image.png",
fit: BoxFit
.cover,
height: 60,
),
),
Container(
width: e.rxMessage !=
null
? MediaQuery.of(
context)
.size
.width /
5
: 0,
padding:
EdgeInsets.all(4),
decoration:
BoxDecoration(
color: Color(
0xffb23838),
borderRadius:
BorderRadius.only(
topLeft: Radius
.circular(
6)),
),
child: Texts(
e.rxMessage != null
? e.rxMessage
: "",
color: Colors.white,
regular: true,
fontSize: 10,
fontWeight:
FontWeight.w400,
),
),
]),
Container(
margin: EdgeInsets
.symmetric(
horizontal: 6,
vertical: 0,
),
child: Column(
crossAxisAlignment:
CrossAxisAlignment
.start,
children: [
Text(
languageID == "ar"
? e.namen
: e.name,
style: TextStyle(
color: Colors
.black,
fontSize: 13.0,
// fontWeight: FontWeight.bold,
),
),
Padding(
// padding: const EdgeInsets.only(top: 15, bottom: 10),
padding:
const EdgeInsets
.only(
top: 10,
bottom:
5),
child: Texts(
"SAR ${e.price}",
bold: true,
fontSize: 14,
),
),
],
),
),
Row(
crossAxisAlignment:
CrossAxisAlignment
.start,
children: <Widget>[
Container(
padding: EdgeInsets
.only(
right:
10),
// margin: EdgeInsets.only(left: 5),
child: Align(
alignment:
Alignment
.topLeft,
child: RatingBar
.readOnly(
initialRating: e
.approvedRatingSum
.toDouble(),
// initialRating: productRate,
size: 13.0,
filledColor:
Colors.yellow[
700],
emptyColor:
Colors.grey[
500],
isHalfAllowed:
true,
halfFilledIcon:
Icons
.star_half,
filledIcon:
Icons
.star,
emptyIcon:
Icons
.star,
),
),
),
Texts(
"(${e.approvedTotalReviews.toString()})",
// bold: true,
fontSize: 12,
),
]),
],
),
),
)
// Column(
// crossAxisAlignment:
// CrossAxisAlignment.start,
// children: [
// Container(
// child: Align(
// alignment: Alignment.topRight,
// child: !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(
// padding: EdgeInsets.only(
// left: 25, bottom: 20),
//// margin: EdgeInsets.fromLTRB(0, 16, 0, 0),
//// alignment: Alignment.centerLeft,
// child: (e.images != null &&
// e.images.length > 0)
// ? Image.network(
// e.images[0].src
// .toString(),
//// item.images[0].src,
// fit: BoxFit.cover,
// height: 80,
// )
// : Image.asset(
// "assets/images/no_image.png",
// fit: BoxFit.cover,
// height: 80,
// ),
// ),
// Text(
// e.name,
//// model.recommendedProduct[0].products[index].shortDescription
//// .toString(),
// style: TextStyle(
// color: Colors.black,
// fontSize: 15.0,
//// fontWeight: FontWeight.bold,
// ),
// ),
// Padding(
// padding: const EdgeInsets.only(
// top: 15, bottom: 10),
// child: Texts(
// "SAR ${e.price}",
// bold: true,
// fontSize: 14,
// ),
// ),
// Row(
// crossAxisAlignment:
// CrossAxisAlignment.start,
// children: <Widget>[
// Container(
// padding: EdgeInsets.only(
// right: 10),
//// margin: EdgeInsets.only(left: 5),
// child: Align(
// alignment:
// Alignment.topLeft,
// child: RatingBar.readOnly(
// initialRating: e
// .approvedRatingSum
// .toDouble(),
//// initialRating: productRate,
// size: 15.0,
// filledColor:
// Colors.yellow[700],
// emptyColor:
// Colors.grey[500],
// isHalfAllowed: true,
// halfFilledIcon:
// Icons.star_half,
// filledIcon: Icons.star,
// emptyIcon: Icons.star,
// ),
// ),
// ),
// Texts(
// "(${e.approvedTotalReviews.toString()})",
//// bold: true,
// fontSize: 12,
// ),
// ]),
// ],
// ),
)
.toList(),
// children:[
// ListView.builder(
// scrollDirection: Axis.vertical,
// shrinkWrap: true,
// physics: ScrollPhysics(),
// itemCount: model.recommendedProductList.length,
// itemBuilder: (context, index) {
// return Container(
// height: 30,
// padding: EdgeInsets.only( left: 15.0, top: 10, right: 10),
// margin: EdgeInsets.only(right: 10.0),
// decoration: BoxDecoration(
// border: Border.all(
// color: Colors.grey,
// style: BorderStyle.solid,
// width: 1.0,
// ),
// color: Colors.white,
// borderRadius: BorderRadius.circular(10.0)),
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Container(
// child: Align(
// alignment: Alignment.topRight,
// child:!isInWishlist
// ? InkWell(
// onTap: () {
// },
// child: SvgPicture.asset(
// 'assets/images/pharmacy/heart-empty.svg',
// width: 20,
// height: 20,
// color: Colors.grey,
// ),
// )
// : InkWell(
// onTap: () {
// },
// child: SvgPicture.asset(
// 'assets/images/pharmacy/Redheart.svg',
// width: 20,
// height: 20,
//// color: Colors.red,
// ),
// )
// ),
// ),
// Container(
// padding: EdgeInsets.only(left: 25, bottom: 20),
//// margin: EdgeInsets.fromLTRB(0, 16, 0, 0),
//// alignment: Alignment.centerLeft,
// child: (model.recommendedProductList[index].images != null &&
// model.recommendedProductList[index].images.length > 0)
// ? Image.network(
// model.recommendedProductList[index].images[0].src.toString(),
//// item.images[0].src,
// fit: BoxFit.cover,
// height: 80,
// )
// : Image.asset(
// "assets/images/no_image.png",
// fit: BoxFit.cover,
// height: 80,
// ),
// ),
// Text(
// model.recommendedProductList[index].name,
//// model.recommendedProduct[0].products[index].shortDescription
//// .toString(),
// style: TextStyle(
// color: Colors.black,
// fontSize: 15.0,
//// fontWeight: FontWeight.bold,
// ),
// ),
// Padding(
// padding: const EdgeInsets.only(top: 15, bottom: 10),
// child: Texts(
// "SAR ${model.recommendedProductList[index].price}",
// bold: true,
// fontSize: 14,
// ),
// ),
// Row(
// crossAxisAlignment:
// CrossAxisAlignment.start,
// children: <Widget>[
// Container(
// padding: EdgeInsets.only(right: 10),
//// margin: EdgeInsets.only(left: 5),
// child: Align(
// alignment: Alignment.topLeft,
// child: RatingBar.readOnly(
// initialRating:
// model.recommendedProductList[index].approvedRatingSum.toDouble(),
//// initialRating: productRate,
// size: 15.0,
// filledColor: Colors.yellow[700],
// emptyColor: Colors.grey[500],
// isHalfAllowed: true,
// halfFilledIcon: Icons.star_half,
// filledIcon: Icons.star,
// emptyIcon: Icons.star,
// ),
// ),
// ),
// Texts(
// "(${model.recommendedProductList[index].approvedTotalReviews.toString()})",
//// bold: true,
// fontSize: 12,
// ),
// ]),
// ],
// ),
// );
// }
// ),
// ]
),
),
])
: Container(),
)
: Container(
height: model.recommendedProductList.length > 0
? MediaQuery.of(context).size.height * 0.60
: 0,
child: ListView.builder(
physics: ScrollPhysics(),
// physics: NeverScrollableScrollPhysics(),
itemCount: model.recommendedProductList.length,
itemBuilder: (context, index) {
return Card(
elevation: 2,
shape: RoundedRectangleBorder(
side:
BorderSide(color: Colors.grey[300], width: 2),
borderRadius: BorderRadius.circular(10)),
//
margin: EdgeInsets.symmetric(
horizontal: 8,
vertical: 4,
),
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(15),
),
),
padding: EdgeInsets.symmetric(horizontal: 5),
width: MediaQuery.of(context).size.width / 3,
//
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Stack(children: [
Container(
child: Align(
alignment: Alignment.topRight,
child: //true
//wishlistVar[index].id.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),
child: (model.recommendedProductList[index]
.images !=
null &&
model.recommendedProductList[index]
.images.length >
0)
? Image.network(
model.recommendedProductList[index]
.images[0].src
.toString(),
// item.images[0].src,
fit: BoxFit.cover,
height: 60,
)
: Image.asset(
"assets/images/no_image.png",
fit: BoxFit.cover,
height: 60,
),
),
Container(
width: model.recommendedProductList[index]
.rxMessage !=
null
? MediaQuery.of(context).size.width / 5
: 0,
padding: EdgeInsets.all(4),
decoration: BoxDecoration(
color: Color(0xffb23838),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(6)),
),
child: Texts(
model.recommendedProductList[index]
.rxMessage !=
null
? model.recommendedProductList[index]
.rxMessage
: "",
color: Colors.white,
regular: true,
fontSize: 10,
fontWeight: FontWeight.w400,
),
),
]),
Container(
margin: EdgeInsets.symmetric(
horizontal: 6,
vertical: 2,
),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
model
.recommendedProductList[index].name,
style: TextStyle(
color: Colors.black,
fontSize: 13.0,
// fontWeight: FontWeight.bold,
),
),
Padding(
// padding: const EdgeInsets.only(top: 15, bottom: 10),
padding: const EdgeInsets.only(
top: 10, bottom: 5),
child: Texts(
"SAR ${model.recommendedProductList[index].price}",
bold: true,
fontSize: 14,
),
),
],
),
),
Row(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
Container(
padding: EdgeInsets.only(
right: 10, bottom: 10),
// margin: EdgeInsets.only(left: 5),
child: Align(
alignment: Alignment.topLeft,
child: RatingBar.readOnly(
initialRating: model
.recommendedProductList[index]
.approvedRatingSum
.toDouble(),
// initialRating: productRate,
size: 13.0,
filledColor: Colors.yellow[700],
emptyColor: Colors.grey[500],
isHalfAllowed: true,
halfFilledIcon: Icons.star_half,
filledIcon: Icons.star,
emptyIcon: Icons.star,
),
),
),
Texts(
"(${model.recommendedProductList[index].approvedTotalReviews.toString()})",
// bold: true,
fontSize: 12,
),
]),
],
),
),
);
// Container(
// height: 30,
// padding: EdgeInsets.only( left: 10.0, top: 10, right: 10),
//// margin: EdgeInsets.only(right: 10.0),
// decoration: BoxDecoration(
// border: Border.all(
// color: Colors.grey,
// style: BorderStyle.solid,
// width: 1.0,
// ),
// color: Colors.white,
// borderRadius: BorderRadius.circular(10.0)),
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Container(
// child: Align(
// alignment: Alignment.topRight,
// child:!isInWishlist
// ? InkWell(
// onTap: () {
// },
// child: SvgPicture.asset(
// 'assets/images/pharmacy/heart-empty.svg',
// width: 20,
// height: 20,
// color: Colors.grey,
// ),
// )
// : InkWell(
// onTap: () {
// },
// child: SvgPicture.asset(
// 'assets/images/pharmacy/Redheart.svg',
// width: 20,
// height: 20,
//// color: Colors.red,
// ),
// )
// ),
// ),
// Container(
// padding: EdgeInsets.only(left: 25, bottom: 20),
//// margin: EdgeInsets.fromLTRB(0, 16, 0, 0),
//// alignment: Alignment.centerLeft,
// child: (model.recommendedProductList[index].images != null &&
// model.recommendedProductList[index].images.length > 0)
// ? Image.network(
// model.recommendedProductList[index].images[0].src.toString(),
//// item.images[0].src,
// fit: BoxFit.cover,
// height: 80,
// )
// : Image.asset(
// "assets/images/no_image.png",
// fit: BoxFit.cover,
// height: 80,
// ),
// ),
// Text(
// model.recommendedProductList[index].name,
//// model.recommendedProduct[0].products[index].shortDescription
//// .toString(),
// style: TextStyle(
// color: Colors.black,
// fontSize: 15.0,
//// fontWeight: FontWeight.bold,
// ),
// ),
// Padding(
// padding: const EdgeInsets.only(top: 15, bottom: 10),
// child: Texts(
// "SAR ${model.recommendedProductList[index].price}",
// bold: true,
// fontSize: 14,
// ),
// ),
// Row(
// crossAxisAlignment:
// CrossAxisAlignment.start,
// children: <Widget>[
// Container(
// padding: EdgeInsets.only(right: 10),
//// margin: EdgeInsets.only(left: 5),
// child: Align(
// alignment: Alignment.topLeft,
// child: RatingBar.readOnly(
// initialRating:
// model.recommendedProductList[index].approvedRatingSum.toDouble(),
//// initialRating: productRate,
// size: 15.0,
// filledColor: Colors.yellow[700],
// emptyColor: Colors.grey[500],
// isHalfAllowed: true,
// halfFilledIcon: Icons.star_half,
// filledIcon: Icons.star,
// emptyIcon: Icons.star,
// ),
// ),
// ),
// Texts(
// "(${model.recommendedProductList[index].approvedTotalReviews.toString()})",
//// bold: true,
// fontSize: 12,
// ),
// ]),
// ],
// ),
// );
}),
),
]),
),
),
);
}
checkWishlist() async {
ProductDetailViewModel x = new ProductDetailViewModel();
await x.checkWishlistData();
for (int i = 0; i < x.wishListItems.length; i++) {
// itemID = x.wishListItems[i].id;
print("-------------wishlist---------------");
print(itemID);
// print(product.id);
print(x.wishListItems[i].productId);
if (itemID == x.wishListItems[i].productId) {
isInWishlist = true;
// print('in wishlist');
break;
} else {
isInWishlist = false;
// print('not in wishlist');
}
}
}
Future userInfo(id, product) async {
customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID);
if (customerId != null) {
itemID = id;
product = product;
checkWishlist();
}
print("customerId:$customerId");
return customerId;
}
addToWishlistFunction(itemID) async {
ProductDetailViewModel x = new ProductDetailViewModel();
isInWishlist = true;
await x.addToWishlistData(itemID);
}
deleteFromWishlistFunction(itemID) async {
ProductDetailViewModel x = new ProductDetailViewModel();
isInWishlist = false;
await x.addToWishlistData(itemID);
}
}

@ -5,6 +5,8 @@ import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
class WishlistPage extends StatefulWidget { class WishlistPage extends StatefulWidget {
bool showBar;
WishlistPage(this.showBar);
@override @override
_WishlistPageState createState() => _WishlistPageState(); _WishlistPageState createState() => _WishlistPageState();
} }
@ -17,9 +19,9 @@ class _WishlistPageState extends State<WishlistPage> {
onModelReady: (model) => model.getWishlistData(), onModelReady: (model) => model.getWishlistData(),
builder: (_, model, wi) => AppScaffold( builder: (_, model, wi) => AppScaffold(
appBarTitle: 'Wishlist page', appBarTitle: 'Wishlist page',
isShowAppBar: false, isShowAppBar: widget.showBar,
isShowDecPage: false, isShowDecPage: false,
isPharmacy: false, isPharmacy: true,
baseViewModel: model, baseViewModel: model,
body: model.wishListList.length == 0 body: model.wishListList.length == 0
? Container( ? Container(

@ -69,6 +69,7 @@ class _OrderPageState extends State<OrderPage>
children: [ children: [
TabBar( TabBar(
labelPadding: EdgeInsets.only(left: 3.0, right: 3.0), labelPadding: EdgeInsets.only(left: 3.0, right: 3.0),
labelColor: Colors.black,
tabs: [ tabs: [
Tab(text: TranslationBase.of(context).delivered), Tab(text: TranslationBase.of(context).delivered),
Tab(text: TranslationBase.of(context).processing), Tab(text: TranslationBase.of(context).processing),

@ -47,7 +47,7 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
var model; var model;
var isCancel = false; var isCancel = false;
var isRefund = false; var isRefund = false;
var isActiveDelivery = true; var isActiveDelivery = false;
var dataIsCancel; var dataIsCancel;
var dataIsRefund; var dataIsRefund;
BuildContext context; BuildContext context;
@ -69,7 +69,14 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
this.context = context; this.context = context;
return BaseView<OrderModelViewModel>( return BaseView<OrderModelViewModel>(
onModelReady: (model) => model.getOrderDetails(widget.orderModel.id), onModelReady: (model) {
model.getOrderDetails(widget.orderModel.id).then((value) {
setState(() {
isActiveDelivery = (value.orderStatusId == 995 &&
(value.driverID != null && value.driverID.isNotEmpty));
});
});
},
builder: (_, model, wi) => AppScaffold( builder: (_, model, wi) => AppScaffold(
appBarTitle: TranslationBase.of(context).orderDetail, appBarTitle: TranslationBase.of(context).orderDetail,
isShowAppBar: true, isShowAppBar: true,
@ -150,7 +157,7 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
Text( Text(
model.orderListModel[0].shippingAddress.address1 model.orderListModel[0].shippingAddress.address1
.toString() .toString()
.substring(9), ,
style: TextStyle( style: TextStyle(
fontSize: 10.0, fontSize: 10.0,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
@ -167,7 +174,7 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
Text( Text(
model.orderListModel[0].shippingAddress.address2 model.orderListModel[0].shippingAddress.address2
.toString() .toString()
.substring(9) + +
' ' + ' ' +
model.orderListModel[0].shippingAddress model.orderListModel[0].shippingAddress
.country .country
@ -332,43 +339,18 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
itemBuilder: (context, index) { itemBuilder: (context, index) {
return Container( return Container(
child: productTile( child: productTile(
productName: model.orderListModel[0] productName: model.orderListModel[0].orderItems[index].product.name.toString(),
.orderItems[index].product.name productPrice: model.orderListModel[0].orderItems[index].product.price.toString(),
.toString(), productRate: model.orderListModel[0].orderItems[index].product.approvedRatingSum.toDouble(),
productPrice: model.orderListModel[0] productReviews: model.orderListModel[0].orderItems[index].product.approvedTotalReviews,
.orderItems[index].product.price totalPrice: "${(model.orderListModel[0].orderItems[index].product.price * model.orderListModel[0].orderItems[index].quantity).toStringAsFixed(2)}",
.toString(), qyt: model.orderListModel[0].orderItems[index].quantity.toString(),
productRate: model.orderListModel[0]
.orderItems[index].product.approvedRatingSum
.toDouble(),
productReviews: model
.orderListModel[0]
.orderItems[index]
.product
.approvedTotalReviews,
totalPrice:
"${(model.orderListModel[0].orderItems[index].product.price * model.orderListModel[0].orderItems[index].quantity).toStringAsFixed(2)}",
qyt: model.orderListModel[0].orderItems[index]
.quantity
.toString(),
isOrderDetails: true, isOrderDetails: true,
imgs: model.orderListModel[0].orderItems[index] imgs: model.orderListModel[0].orderItems[index].product.images != null &&
.product.images != model.orderListModel[0].orderItems[index].product.images.length != 0
null && ? model.orderListModel[0].orderItems[index].product.images[0].src.toString() : null,
model
.orderListModel[0]
.orderItems[index]
.product
.images
.length !=
0
? model.orderListModel[0].orderItems[index]
.product.images[0].src
.toString()
: null,
status: model.orderListModel[0].orderStatusId, status: model.orderListModel[0].orderStatusId,
product: model.orderListModel[0] product: model.orderListModel[0].orderItems[index].product,
.orderItems[index].product,
), ),
); );
}), }),
@ -770,6 +752,10 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
message: "شكراً\nPayment status for your order is Paid"); message: "شكراً\nPayment status for your order is Paid");
Navigator.pop(context); Navigator.pop(context);
Navigator.pop(context); Navigator.pop(context);
} else {
AppToast.showErrorToast(
message:
"Transaction Failed!\Your transaction is field to some reason please try again or contact to the administration");
} }
} }
} }

@ -115,22 +115,39 @@ class _ProfilePageState extends State<PharmacyProfilePage> {
bottom: 10.0, bottom: 10.0,
), ),
child: LargeAvatar( child: LargeAvatar(
name: "profile", name: user.firstName.toString(),
url: '', url: '',
), ),
), ),
Text( Column(children: <Widget>[
languageID == "ar" Row(children: <Widget>[
? user.firstNameN.toString() + Text(
" " + TranslationBase.of(context)
user.lastNameN.toString() .welcome,
: user.firstName.toString() + style: TextStyle(
" " + fontSize: 14.0,
user.lastName.toString(), fontWeight: FontWeight.bold,
style: TextStyle( color: Colors.grey),
fontSize: 14.0, ),
fontWeight: FontWeight.bold), ]),
), SizedBox(
height: 10,
),
Row(children: <Widget>[
Text(
languageID == "ar"
? user.firstNameN.toString() +
" " +
user.lastNameN.toString()
: user.firstName.toString() +
" " +
user.lastName.toString(),
style: TextStyle(
fontSize: 14.0,
fontWeight: FontWeight.bold),
),
]),
]),
], ],
), ),
) )
@ -215,8 +232,11 @@ class _ProfilePageState extends State<PharmacyProfilePage> {
Expanded( Expanded(
child: InkWell( child: InkWell(
onTap: () { onTap: () {
Navigator.push(context, Navigator.push(
FadePage(page: WishlistPage())); context,
MaterialPageRoute(
builder: (context) =>
WishlistPage(true)));
}, },
child: Column( child: Column(
children: <Widget>[ children: <Widget>[

@ -88,7 +88,7 @@ class ProductDetailService extends BaseService {
"language_id": 1 "language_id": 1
} }
}; };
await baseAppClient.post(GET_SHOPPING_CART, await baseAppClient.pharmacyPost(GET_SHOPPING_CART,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
_addToCartModel.clear(); _addToCartModel.clear();
response['shopping_carts'].forEach((item) { response['shopping_carts'].forEach((item) {
@ -121,7 +121,7 @@ class ProductDetailService extends BaseService {
request = { request = {
"shopping_cart_item": {"quantity": 1, "shopping_cart_type": "Wishlist", "product_id": itemID, "customer_id": customerId, "language_id": 1} "shopping_cart_item": {"quantity": 1, "shopping_cart_type": "Wishlist", "product_id": itemID, "customer_id": customerId, "language_id": 1}
}; };
await baseAppClient.post(GET_SHOPPING_CART, await baseAppClient.pharmacyPost(GET_SHOPPING_CART,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
_wishListProducts.clear(); _wishListProducts.clear();
response['shopping_carts'].forEach((item) { response['shopping_carts'].forEach((item) {
@ -172,6 +172,7 @@ class ProductDetailService extends BaseService {
_productSpecification.clear(); _productSpecification.clear();
response['specification'].forEach((item) { response['specification'].forEach((item) {
_productSpecification.add(SpecificationModel.fromJson(item)); _productSpecification.add(SpecificationModel.fromJson(item));
print(_productSpecification);
}); });
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;

@ -0,0 +1,40 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/recommendedProduct_model.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
class RecommendedProductService extends BaseService{
AppSharedPreferences sharedPref = AppSharedPreferences();
AppGlobal appGlobal = new AppGlobal();
AuthenticatedUser authUser = new AuthenticatedUser();
AuthProvider authProvider = new AuthProvider();
List<Products> _recommendedProductList = List();
List<Products> get recommendedList => _recommendedProductList;
String url ="";
Future getRecommendedProducts(productId) async {
hasError = false;
url =GET_RECOMMENDED_PRODUCT+productId;
await baseAppClient.getPharmacy(url,
onSuccess: (dynamic response, int statusCode) {
_recommendedProductList.clear();
response['products'].forEach((item) {
_recommendedProductList.add(Products.fromJson(item));
print("----------------------------------");
print("Test data");
print(_recommendedProductList[0]);
print(item['name']);
print(response);
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
});
}}

@ -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:

@ -1393,13 +1393,10 @@ class TranslationBase {
localizedValues["convertBloodSugarStatement"][locale.languageCode]; localizedValues["convertBloodSugarStatement"][locale.languageCode];
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 bloodSugarConversion => String get sort => localizedValues["sort"][locale.languageCode];
localizedValues["bloodSugarConversion"][locale.languageCode]; String get bloodSugarConversion => localizedValues["bloodSugarConversion"][locale.languageCode];
String get convertCholesterolStatement => String get convertCholesterolStatement => localizedValues["convertCholesterolStatement"][locale.languageCode];
localizedValues["convertCholesterolStatement"][locale.languageCode]; String get triglyceridesConvertStatement => localizedValues["triglyceridesConvertStatement"][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 =>
@ -1573,6 +1570,8 @@ 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 anicllaryOrders =>
localizedValues["ancillary-orders"][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(),

@ -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()]);
} }
} }

@ -7,6 +7,7 @@ import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart'; import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart';
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-order-page.dart';
import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart'; import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
@ -172,7 +173,10 @@ class AppBarWidget extends StatelessWidget with PreferredSizeWidget {
icon: Icon(Icons.shopping_cart), icon: Icon(Icons.shopping_cart),
color: Theme.of(context).textTheme.headline1.color, color: Theme.of(context).textTheme.headline1.color,
onPressed: () { onPressed: () {
Navigator.of(context).popUntil(ModalRoute.withName('/')); Navigator.push(
context,
MaterialPageRoute(builder: (context) => CartOrderPage()),
);
}) })
: Container(), : Container(),
IconButton( IconButton(

@ -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,
), ),
], ],

@ -66,8 +66,8 @@ class productTile extends StatelessWidget {
) )
: Container( : Container(
margin: EdgeInsets.only(left: 10), margin: EdgeInsets.only(left: 10),
child: Image.asset( child: Image.network(
"assets/images/no_image.png", productImage,
width: 80, width: 80,
height: 80, height: 80,
) )

@ -28,7 +28,7 @@ dependencies:
#Dependency Injection #Dependency Injection
get_it: ^4.0.2 get_it: ^4.0.2
#chart #chart
fl_chart: ^0.12.1 fl_chart: ^0.12.1
@ -166,10 +166,11 @@ dependencies:
after_layout: ^1.0.7 after_layout: ^1.0.7
twilio_programmable_video: ^0.5.0+3 twilio_programmable_video: ^0.5.0+3
cached_network_image: ^2.4.1 cached_network_image: ^2.4.1
flutter_tts: flutter_tts:
path: flutter_tts-voice_enhancement path: flutter_tts-voice_enhancement
# flutter_tts: ^1.2.6 # flutter_tts: ^1.2.6
sms_otp_auto_verify: ^1.2.2 sms_otp_auto_verify: ^1.2.2
wifi: ^0.1.5 wifi: ^0.1.5
vibration: ^1.7.3 vibration: ^1.7.3

Loading…
Cancel
Save