homepage and product details design

merge-requests/277/head
Fatimah Alshammari 5 years ago
parent 7a516cae51
commit ce64da11e4

@ -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 {
google()
jcenter()
// maven {
// url "https://dl.bintray.com/kotlin/kotlin-eap/"
// }
}
dependencies {

@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
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

@ -360,6 +360,7 @@ const TRANSFER_YAHALA_LOYALITY_POINTS =
const LAKUM_GET_USER_TERMS_AND_CONDITIONS =
"Services/ERP.svc/REST/GetUserTermsAndConditionsForEPharmcy";
const PRESCRIPTION = 'Services/Patients.svc/REST/GetPrescriptionApptList';
const GET_RECOMMENDED_PRODUCT = 'alsoProduct/';
// Home Health Care
const HHC_GET_ALL_SERVICES = "Services/Patients.svc/REST/PatientER_HHC_GetAllServices";

@ -0,0 +1,881 @@
class RecommendedProductModel {
String messageStatus;
List<Products> products;
RecommendedProductModel({this.messageStatus, this.products});
RecommendedProductModel.fromJson(Map<String, dynamic> json) {
messageStatus = json['MessageStatus'];
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>();
data['MessageStatus'] = this.messageStatus;
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;
List<LocalizedNames> localizedNames;
String shortDescription;
String shortDescriptionn;
String fullDescription;
String fullDescriptionn;
bool markasNew;
bool showOnHomePage;
Null metaKeywords;
Null metaDescription;
Null metaTitle;
bool allowCustomerReviews;
int approvedRatingSum;
int notApprovedRatingSum;
int approvedTotalReviews;
int notApprovedTotalReviews;
String sku;
bool isRx;
bool prescriptionRequired;
Null rxMessage;
Null rxMessagen;
Null manufacturerPartNumber;
Null gtin;
bool isGiftCard;
bool requireOtherProducts;
bool automaticallyAddRequiredProducts;
bool isDownload;
bool unlimitedDownloads;
int maxNumberOfDownloads;
Null downloadExpirationDays;
bool hasSampleDownload;
bool hasUserAgreement;
bool isRecurring;
int recurringCycleLength;
int recurringTotalCycles;
bool isRental;
int rentalPriceLength;
bool isShipEnabled;
bool isFreeShipping;
bool shipSeparately;
int additionalShippingCharge;
bool isTaxExempt;
bool isTelecommunicationsOrBroadcastingOrElectronicServices;
bool useMultipleWarehouses;
int manageInventoryMethodId;
int stockQuantity;
String stockAvailability;
String stockAvailabilityn;
bool displayStockAvailability;
bool displayStockQuantity;
int minStockQuantity;
int notifyAdminForQuantityBelow;
bool allowBackInStockSubscriptions;
int orderMinimumQuantity;
int orderMaximumQuantity;
Null allowedQuantities;
bool allowAddingOnlyExistingAttributeCombinations;
bool disableBuyButton;
bool disableWishlistButton;
bool availableForPreOrder;
Null preOrderAvailabilityStartDateTimeUtc;
bool callForPrice;
double price;
int oldPrice;
double productCost;
Null specialPrice;
Null specialPriceStartDateTimeUtc;
Null specialPriceEndDateTimeUtc;
bool customerEntersPrice;
int minimumCustomerEnteredPrice;
int maximumCustomerEnteredPrice;
bool basepriceEnabled;
int basepriceAmount;
int basepriceBaseAmount;
bool hasTierPrices;
bool hasDiscountsApplied;
Null discountName;
Null discountNamen;
Null discountDescription;
Null discountDescriptionn;
Null discountPercentage;
String currency;
String currencyn;
double weight;
int length;
int width;
int height;
Null availableStartDateTimeUtc;
Null availableEndDateTimeUtc;
int displayOrder;
bool published;
bool deleted;
String createdOnUtc;
String updatedOnUtc;
String productType;
int parentGroupedProductId;
List<Null> roleIds;
List<Null> discountIds;
List<Null> storeIds;
List<int> manufacturerIds;
List<Reviews> reviews;
List<Images> images;
List<Null> attributes;
List<Specifications> specifications;
List<Null> associatedProductIds;
List<Null> tags;
int vendorId;
String seName;
Products(
{this.id,
this.visibleIndividually,
this.name,
this.namen,
this.localizedNames,
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.roleIds,
this.discountIds,
this.storeIds,
this.manufacturerIds,
this.reviews,
this.images,
this.attributes,
this.specifications,
this.associatedProductIds,
this.tags,
this.vendorId,
this.seName});
Products.fromJson(Map<String, dynamic> json) {
id = json['id'];
visibleIndividually = json['visible_individually'];
name = json['name'];
namen = json['namen'];
if (json['localized_names'] != null) {
localizedNames = new List<LocalizedNames>();
json['localized_names'].forEach((v) {
localizedNames.add(new LocalizedNames.fromJson(v));
});
}
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'];
if (json['role_ids'] != null) {
roleIds = new List<Null>();
json['role_ids'].forEach((v) {
roleIds.add(null);
});
}
if (json['discount_ids'] != null) {
discountIds = new List<Null>();
json['discount_ids'].forEach((v) {
discountIds.add(null);
});
}
if (json['store_ids'] != null) {
storeIds = new List<Null>();
json['store_ids'].forEach((v) {
storeIds.add(null);
});
}
manufacturerIds = json['manufacturer_ids'].cast<int>();
if (json['reviews'] != null) {
reviews = new List<Reviews>();
json['reviews'].forEach((v) {
reviews.add(new Reviews.fromJson(v));
});
}
if (json['images'] != null) {
images = new List<Images>();
json['images'].forEach((v) {
images.add(new Images.fromJson(v));
});
}
if (json['attributes'] != null) {
attributes = new List<Null>();
json['attributes'].forEach((v) {
attributes.add(v);
});
}
if (json['specifications'] != null) {
specifications = new List<Specifications>();
json['specifications'].forEach((v) {
specifications.add(new Specifications.fromJson(v));
});
}
if (json['associated_product_ids'] != null) {
associatedProductIds = new List<Null>();
json['associated_product_ids'].forEach((v) {
associatedProductIds.add(v);
});
}
if (json['tags'] != null) {
tags = new List<Null>();
json['tags'].forEach((v) {
tags.add(v);
});
}
vendorId = json['vendor_id'];
seName = json['se_name'];
}
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;
if (this.localizedNames != null) {
data['localized_names'] =
this.localizedNames.map((v) => v.toJson()).toList();
}
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;
if (this.roleIds != null) {
data['role_ids'] = this.roleIds.map((v) => v);
}
if (this.discountIds != null) {
data['discount_ids'] = this.discountIds.map((v) => v);
}
if (this.storeIds != null) {
data['store_ids'] = this.storeIds.map((v) => v);
}
data['manufacturer_ids'] = this.manufacturerIds;
if (this.reviews != null) {
data['reviews'] = this.reviews.map((v) => v.toJson()).toList();
}
if (this.images != null) {
data['images'] = this.images.map((v) => v.toJson()).toList();
}
if (this.attributes != null) {
data['attributes'] = this.attributes.map((v) => v);
}
if (this.specifications != null) {
data['specifications'] =
this.specifications.map((v) => v.toJson()).toList();
}
if (this.associatedProductIds != null) {
data['associated_product_ids'] =
this.associatedProductIds.map((v) => v);
}
if (this.tags != null) {
data['tags'] = this.tags.map((v) => v);
}
data['vendor_id'] = this.vendorId;
data['se_name'] = this.seName;
return data;
}
}
class LocalizedNames {
int languageId;
String localizedName;
LocalizedNames({this.languageId, this.localizedName});
LocalizedNames.fromJson(Map<String, dynamic> json) {
languageId = json['language_id'];
localizedName = json['localized_name'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['language_id'] = this.languageId;
data['localized_name'] = this.localizedName;
return data;
}
}
class Reviews {
int id;
int position;
int reviewId;
int customerId;
int productId;
int storeId;
bool isApproved;
String title;
String reviewText;
Null replyText;
int rating;
int helpfulYesTotal;
int helpfulNoTotal;
String createdOnUtc;
Customer customer;
Null product;
Reviews(
{this.id,
this.position,
this.reviewId,
this.customerId,
this.productId,
this.storeId,
this.isApproved,
this.title,
this.reviewText,
this.replyText,
this.rating,
this.helpfulYesTotal,
this.helpfulNoTotal,
this.createdOnUtc,
this.customer,
this.product});
Reviews.fromJson(Map<String, dynamic> json) {
id = json['id'];
position = json['position'];
reviewId = json['review_id'];
customerId = json['customer_id'];
productId = json['product_id'];
storeId = json['store_id'];
isApproved = json['is_approved'];
title = json['title'];
reviewText = json['review_text'];
replyText = json['reply_text'];
rating = json['rating'];
helpfulYesTotal = json['helpful_yes_total'];
helpfulNoTotal = json['helpful_no_total'];
createdOnUtc = json['created_on_utc'];
customer = json['customer'] != null
? new Customer.fromJson(json['customer'])
: null;
product = json['product'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['position'] = this.position;
data['review_id'] = this.reviewId;
data['customer_id'] = this.customerId;
data['product_id'] = this.productId;
data['store_id'] = this.storeId;
data['is_approved'] = this.isApproved;
data['title'] = this.title;
data['review_text'] = this.reviewText;
data['reply_text'] = this.replyText;
data['rating'] = this.rating;
data['helpful_yes_total'] = this.helpfulYesTotal;
data['helpful_no_total'] = this.helpfulNoTotal;
data['created_on_utc'] = this.createdOnUtc;
if (this.customer != null) {
data['customer'] = this.customer.toJson();
}
data['product'] = this.product;
return data;
}
}
class Customer {
Null fileNumber;
Null iqamaNumber;
int isOutSa;
int patientType;
Null gender;
String birthDate;
Null phone;
Null countryCode;
Null yahalaAccountno;
Null billingAddress;
Null shippingAddress;
List<Null> addresses;
String id;
String username;
String email;
Null firstName;
Null lastName;
Null languageId;
Null adminComment;
Null isTaxExempt;
Null hasShoppingCartItems;
Null active;
Null deleted;
Null isSystemAccount;
Null systemName;
Null lastIpAddress;
Null createdOnUtc;
Null lastLoginDateUtc;
Null lastActivityDateUtc;
Null registeredInStoreId;
List<Null> roleIds;
Customer(
{this.fileNumber,
this.iqamaNumber,
this.isOutSa,
this.patientType,
this.gender,
this.birthDate,
this.phone,
this.countryCode,
this.yahalaAccountno,
this.billingAddress,
this.shippingAddress,
this.addresses,
this.id,
this.username,
this.email,
this.firstName,
this.lastName,
this.languageId,
this.adminComment,
this.isTaxExempt,
this.hasShoppingCartItems,
this.active,
this.deleted,
this.isSystemAccount,
this.systemName,
this.lastIpAddress,
this.createdOnUtc,
this.lastLoginDateUtc,
this.lastActivityDateUtc,
this.registeredInStoreId,
this.roleIds});
Customer.fromJson(Map<String, dynamic> json) {
fileNumber = json['file_number'];
iqamaNumber = json['iqama_number'];
isOutSa = json['is_out_sa'];
patientType = json['patient_type'];
gender = json['gender'];
birthDate = json['birth_date'];
phone = json['phone'];
countryCode = json['country_code'];
yahalaAccountno = json['yahala_accountno'];
billingAddress = json['billing_address'];
shippingAddress = json['shipping_address'];
if (json['addresses'] != null) {
addresses = new List<Null>();
json['addresses'].forEach((v) {
addresses.add(v);
});
}
id = json['id'];
username = json['username'];
email = json['email'];
firstName = json['first_name'];
lastName = json['last_name'];
languageId = json['language_id'];
adminComment = json['admin_comment'];
isTaxExempt = json['is_tax_exempt'];
hasShoppingCartItems = json['has_shopping_cart_items'];
active = json['active'];
deleted = json['deleted'];
isSystemAccount = json['is_system_account'];
systemName = json['system_name'];
lastIpAddress = json['last_ip_address'];
createdOnUtc = json['created_on_utc'];
lastLoginDateUtc = json['last_login_date_utc'];
lastActivityDateUtc = json['last_activity_date_utc'];
registeredInStoreId = json['registered_in_store_id'];
if (json['role_ids'] != null) {
roleIds = new List<Null>();
json['role_ids'].forEach((v) {
roleIds.add(null);
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['file_number'] = this.fileNumber;
data['iqama_number'] = this.iqamaNumber;
data['is_out_sa'] = this.isOutSa;
data['patient_type'] = this.patientType;
data['gender'] = this.gender;
data['birth_date'] = this.birthDate;
data['phone'] = this.phone;
data['country_code'] = this.countryCode;
data['yahala_accountno'] = this.yahalaAccountno;
data['billing_address'] = this.billingAddress;
data['shipping_address'] = this.shippingAddress;
if (this.addresses != null) {
data['addresses'] = this.addresses.map((v) => v);
}
data['id'] = this.id;
data['username'] = this.username;
data['email'] = this.email;
data['first_name'] = this.firstName;
data['last_name'] = this.lastName;
data['language_id'] = this.languageId;
data['admin_comment'] = this.adminComment;
data['is_tax_exempt'] = this.isTaxExempt;
data['has_shopping_cart_items'] = this.hasShoppingCartItems;
data['active'] = this.active;
data['deleted'] = this.deleted;
data['is_system_account'] = this.isSystemAccount;
data['system_name'] = this.systemName;
data['last_ip_address'] = this.lastIpAddress;
data['created_on_utc'] = this.createdOnUtc;
data['last_login_date_utc'] = this.lastLoginDateUtc;
data['last_activity_date_utc'] = this.lastActivityDateUtc;
data['registered_in_store_id'] = this.registeredInStoreId;
if (this.roleIds != null) {
data['role_ids'] = this.roleIds.map((v) => v);
}
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;
}
}
class Specifications {
int id;
int displayOrder;
String defaultValue;
String defaultValuen;
String name;
String nameN;
Specifications(
{this.id,
this.displayOrder,
this.defaultValue,
this.defaultValuen,
this.name,
this.nameN});
Specifications.fromJson(Map<String, dynamic> json) {
id = json['id'];
displayOrder = json['display_order'];
defaultValue = json['default_value'];
defaultValuen = json['default_valuen'];
name = json['name'];
nameN = json['nameN'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['display_order'] = this.displayOrder;
data['default_value'] = this.defaultValue;
data['default_valuen'] = this.defaultValuen;
data['name'] = this.name;
data['nameN'] = this.nameN;
return data;
}
}

@ -21,6 +21,8 @@ class PharmacyModuleService extends BaseService {
Future makeVerifyCustomer(dynamic data) async {
Map<String, String> queryParams = {'FileNumber': data['PatientID'].toString()};
hasError = false;

@ -17,37 +17,41 @@ class PrescriptionService extends BaseService {
List<Prescriptions> get prescriptionsList => _prescriptionsList;
// Future getPrescription() async {
// hasError = false;
// url = PRESCRIPTION;
// print("Print PRESCRIPTION url" + url);
// await baseAppClient.get(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 {
url = PRESCRIPTION;
print("Print PRESCRIPTION url" + url);
hasError = false;
url = PRESCRIPTION;
print("Print PRESCRIPTION url" + url);
await baseAppClient.get(url,
Map<String, dynamic> body = Map();
body['isDentalAllowedBackend'] = false;
await baseAppClient.post(PRESCRIPTION,
onSuccess: (dynamic response, int statusCode) {
_prescriptionsList.clear();
response['PatientPrescriptionList'].forEach((item) {
_prescriptionsList.add(Prescriptions.fromJson(item));
response['PatientPrescriptionList'].forEach((prescriptions) {
_prescriptionsList.add(Prescriptions.fromJson(prescriptions));
});
print(_prescriptionsList.length);
print(response);
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
});
}, body: body);
}
// Future getPrescription() async {
// hasError = false;
// Map<String, dynamic> body = Map();
// body['isDentalAllowedBackend'] = false;
// await baseAppClient.post(PRESCRIPTION,
// onSuccess: (dynamic response, int statusCode) {
// prescriptionsList.clear();
// response['PatientPrescriptionList'].forEach((prescriptions) {
// prescriptionsList.add(Prescriptions.fromJson(prescriptions));
// });
// }, onFailure: (String error, int statusCode) {
// hasError = true;
// super.error = error;
// }, body: body);
// }
}

@ -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/PharmacyProduct.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/service/medical/prescriptions_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/viewModels/base_view_model.dart';
import 'package:diplomaticquarterapp/services/pharmacy_services/recommendedProduct_service.dart';
import '../../../locator.dart';
@ -17,6 +20,9 @@ class PharmacyModuleViewModel extends BaseViewModel {
PrescriptionService _prescriptionService = locator<PrescriptionService>();
RecommendedProductService _recommendedProductService = locator<RecommendedProductService>();
List<PharmacyImageObject> get bannerList => _pharmacyService.bannerItems;
List<Manufacturer> get manufacturerList => _pharmacyService.manufacturerList;
@ -27,9 +33,14 @@ class PharmacyModuleViewModel extends BaseViewModel {
List<PharmacyProduct> get lastVisitedProducts =>
_pharmacyService.lastVisitedProducts;
List<RecommendedProductModel> get recommendedProduct =>
_recommendedProductService.recommendedProductList;
List<Prescriptions> get prescriptionsList =>
_prescriptionService.prescriptionsList;
// List<PharmacyProduct> get pharmacyPrescriptionsList => PharmacyProduct.pharmacyPrescriptionsList ;
Future getPharmacyHomeData() async {
@ -104,15 +115,17 @@ class PharmacyModuleViewModel extends BaseViewModel {
}
/////////////RecommendedProducts
// _getRecommendedProducts() async {
// await _pharmacyService.getRecommendedProducts();
// if (_pharmacyService.hasError) {
// error = _pharmacyService.error;
// setState(ViewState.Error);
// } else {
// setState(ViewState.Idle);
// }
// }
getRecommendedProducts(ProductId) async {
print("_____________________________________");
print(ProductId);
await _recommendedProductService.getRecommendedProducts(ProductId.toString());
if (_recommendedProductService.hasError) {
error = _recommendedProductService.error;
setState(ViewState.Error);
} else {
setState(ViewState.Idle);
}
}
Future<bool> checkUserIsActivated() async {
if (authenticatedUserObject.isLogin) {
@ -140,4 +153,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);
// }
// }
}

@ -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/AlHabibMedicalService/home_health_care_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart';
import 'package:diplomaticquarterapp/services/pharmacy_services/recommendedProduct_service.dart';
import 'package:diplomaticquarterapp/services/pharmacy_services/review_service.dart';
import 'package:diplomaticquarterapp/services/pharmacy_services/wishList_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/PharmacyAddressesViewModel.dart';
@ -204,6 +205,8 @@ void setupLocator() {
locator.registerLazySingleton(() => TermsConditionService());
locator.registerLazySingleton(() => CancelOrderService());
locator.registerLazySingleton(() => PrescriptionService());
locator.registerLazySingleton(() => RecommendedProductService());
locator.registerLazySingleton(() => PrivilegeService());
locator.registerLazySingleton(() => WeatherService());

@ -277,30 +277,11 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
),
),
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),
),
height: 6,
),
Divider(
height: 1,
color: Colors.grey),
SizedBox(
height: 10,
),
@ -314,6 +295,37 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
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'),
// ),
// ),
],
),
)
@ -765,6 +777,43 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
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(
height: 10,
),

@ -1,34 +1,43 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/recommendedProduct_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/landing/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/pharmacies/screens/cart-order-page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/product-brands.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/recommended-product-page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/widgets/BannerPager.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/widgets/ProductTileItem.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/widgets/manufacturerItem.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/widgets/buttons/borderedButton.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:rating_bar/rating_bar.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/product-brands.dart';
import 'lacum-activitaion-vida-page.dart';
import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart';
dynamic languageID;
class PharmacyPage extends StatelessWidget {
// Products productModel ;
getLanguageID() async {
languageID = await sharedPref.getString(APP_LANGUAGE);
}
List<RecommendedProductModel> recommendedProductList = [];
var model;
@override
void initState() {
// print("model prescription " + model.prescriptionsList.length);
// cancelOrderDetail(order)
print("model recommended is " + model.recommendedProduct.length);
}
@override
@ -77,10 +86,12 @@ class PharmacyPage extends StatelessWidget {
],
),
),
Container(
padding: EdgeInsets.symmetric(horizontal: 16.0, vertical: 24.0),
height: MediaQuery.of(context).size.height * 0.30,
height: model.prescriptionsList.length > 0
? MediaQuery.of(context).size.height * 0.28
: 0,
padding: EdgeInsets.symmetric(horizontal: 18.0, vertical: 18.0),
// height: MediaQuery.of(context).size.height * 0.28,
// width: 200.0,
// height: MediaQuery.of(context).size.height / 4 + 20,
margin: EdgeInsets.only(left: 10),
@ -93,13 +104,12 @@ class PharmacyPage extends StatelessWidget {
shrinkWrap: true,
physics: ScrollPhysics(),
// physics: NeverScrollableScrollPhysics(),
// itemCount: 4,
itemCount: model.prescriptionsList.length,
itemBuilder: (context, index) {
return Container(
// width: 160.0,
height: MediaQuery.of(context).size.height * 0.6,
padding: EdgeInsets.only(bottom: 5.0, left: 5.0),
padding: EdgeInsets.only(bottom: 5.0, left: 5.0, right: 8.0),
margin: EdgeInsets.only(right: 10.0),
decoration: BoxDecoration(
border: Border.all(
@ -119,14 +129,18 @@ class PharmacyPage extends StatelessWidget {
padding: EdgeInsets.only(
top: 10.0,
left: 10.0,
right: 3.0,
right: 10.0,
bottom: 15.0,
),
child: Image.network(
model.prescriptionsList[index]
.doctorImageURL,
width: 60,
height: 60,
child: CircleAvatar(
radius: 30,
backgroundColor: Colors.transparent,
child: Image.network(
model.prescriptionsList[index]
.doctorImageURL,
width: 60,
height: 60,
),
),
),
]),
@ -148,10 +162,14 @@ class PharmacyPage extends StatelessWidget {
BorderRadius.circular(
30.0)),
child: Text(
model.prescriptionsList[index]
languageID == "ar"
? model.prescriptionsList[index]
.isInOutPatientDescription
.toString(),
style: TextStyle(
.toString()
: model.prescriptionsList[index]
.isInOutPatientDescription
.toString(),
style: TextStyle(
color: Colors.white,
fontSize: 15.0,
// fontWeight: FontWeight.bold,
@ -164,9 +182,10 @@ class PharmacyPage extends StatelessWidget {
height: 30,
),
Text(
model.prescriptionsList[index]
.appointmentDate
.toString(),
// DateUtil.getWeekDayMonthDayYearDateFormatted(
DateUtil.convertStringToDate(model.prescriptionsList[index]
.appointmentDate.toString()).toString().substring(0,10),
// ),
style: TextStyle(
color: Colors.black,
fontSize: 15.0,
@ -235,6 +254,8 @@ class PharmacyPage extends StatelessWidget {
child: Align(
alignment: Alignment.topLeft,
child: RatingBar.readOnly(
initialRating:
model.prescriptionsList[index].actualDoctorRate.toDouble(),
// initialRating: productRate,
size: 15.0,
filledColor: Colors.yellow[700],
@ -250,7 +271,8 @@ class PharmacyPage extends StatelessWidget {
]),
);
})
: Container(),
: Container(
),
),
),
Container(
@ -269,20 +291,118 @@ class PharmacyPage extends StatelessWidget {
textColor: Colors.green,
vPadding: 6,
hPadding: 4,
handler: () {},
handler: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
RecommendedProductPage()));
},
),
],
),
),
Container(
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,
),
height: model.recommendedProduct.length > 0
? MediaQuery.of(context).size.height * 0.28
: 0,
padding: EdgeInsets.symmetric(horizontal: 16.0, vertical: 22.0),
margin: EdgeInsets.only(left: 10),
child:BaseView<PharmacyModuleViewModel>(
onModelReady: (model) => model.getRecommendedProducts(4561 ),
builder: (_, model, wi) => model.recommendedProduct[0].products.length > 0
? ListView.builder(
// itemBuilder: (ctx, i) =>
// ProductTileItem(model.recommendedProduct[i]),
// scrollDirection: Axis.horizontal,
// itemCount: model.recommendedProduct.length,
scrollDirection: Axis.horizontal,
shrinkWrap: true,
physics: ScrollPhysics(),
// physics: NeverScrollableScrollPhysics(),
itemCount: model.recommendedProduct[0].products.length,
itemBuilder: (context, index) {
return Container(
height: MediaQuery.of(context).size.height * 0.6,
padding: EdgeInsets.only(bottom: 5.0, left: 5.0, right: 8.0),
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(
margin: EdgeInsets.fromLTRB(0, 16, 0, 0),
alignment: Alignment.center,
child: (model.recommendedProduct[0].products[index].images != null &&
model.recommendedProduct[0].products[index].images.length > 0)
? Image.network(
model.recommendedProduct[0].products[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.recommendedProduct[0].products[index].shortDescription
.toString(),
style: TextStyle(
color: Colors.green,
fontSize: 15.0,
// fontWeight: FontWeight.bold,
),
),
Padding(
padding: const EdgeInsets.only(top: 4, bottom: 4),
child: Texts(
"SAR ${model.recommendedProduct[0].products[index].price}",
bold: true,
fontSize: 14,
),
),
Row(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
// Container(
// margin: EdgeInsets.only(left: 5),
// child: Align(
// alignment: Alignment.topLeft,
// child: RatingBar.readOnly(
// initialRating:
// model.recommendedProduct[0].products[index].reviews.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,
// ),
// ),
// ),
]),
],
),
);
}
): Container(
// child: Text("NO DATA"),
),
),
),
Container(
margin: EdgeInsets.fromLTRB(10, 0, 10, 0),
@ -522,4 +642,15 @@ 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();
}
}

@ -0,0 +1,165 @@
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_module_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:rating_bar/rating_bar.dart';
class RecommendedProductPage extends StatefulWidget {
@override
_RecommendedProductPageState createState() => _RecommendedProductPageState();
}
class _RecommendedProductPageState extends State<RecommendedProductPage>
with SingleTickerProviderStateMixin{
@override
void initState() {
super.initState();
}
@override
Widget build(BuildContext context) {
return BaseView<PharmacyModuleViewModel>(
onModelReady: (model) => model.getRecommendedProducts(4561),
builder: (_,model, wi )=> AppScaffold(
appBarTitle:TranslationBase.of(context).recommended,
baseViewModel: model,
isShowAppBar: true,
isPharmacy:true ,
body: Column(
children: <Widget>[
// Text(
// "4455" + "Result",
// style: TextStyle(
// color: Colors.black,
// fontSize: 13.0,
// ),
// ),
// SizedBox(
// height: 10,
// ),
// Divider(
// color: Colors.grey[350],
// height: 10,
// thickness: 6,
// indent: 0,
// endIndent: 0,
// ),
GridView.count(
crossAxisCount: 2 ,
children: List.generate(30,(index){
return Container(
child: Card(
color: Colors.blue,
child: Container(
height: model.recommendedProduct.length > 0
? MediaQuery.of(context).size.height * 0.28
: 0,
padding: EdgeInsets.symmetric(horizontal: 16.0, vertical: 18.0),
// margin: EdgeInsets.only(left: 10),
child:BaseView<PharmacyModuleViewModel>(
onModelReady: (model) => model.getRecommendedProducts(4561 ),
builder: (_, model, wi) => model.recommendedProduct[0].products.length > 0
? ListView.builder(
// itemBuilder: (ctx, i) =>
// ProductTileItem(model.recommendedProduct[i]),
// scrollDirection: Axis.horizontal,
// itemCount: model.recommendedProduct.length,
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: ScrollPhysics(),
// physics: NeverScrollableScrollPhysics(),
itemCount: model.recommendedProduct[0].products.length,
itemBuilder: (context, index) {
return Container(
height: MediaQuery.of(context).size.height * 0.6,
padding: EdgeInsets.only(bottom: 5.0, left: 5.0, right: 8.0),
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(
margin: EdgeInsets.fromLTRB(0, 16, 0, 0),
alignment: Alignment.center,
child: (model.recommendedProduct[0].products[index].images != null &&
model.recommendedProduct[0].products[index].images.length > 0)
? Image.network(
model.recommendedProduct[0].products[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.recommendedProduct[0].products[index].shortDescription
.toString(),
style: TextStyle(
color: Colors.green,
fontSize: 15.0,
// fontWeight: FontWeight.bold,
),
),
Padding(
padding: const EdgeInsets.only(top: 4, bottom: 4),
child: Texts(
"SAR ${model.recommendedProduct[0].products[index].price}",
bold: true,
fontSize: 14,
),
),
Row(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
// Container(
// margin: EdgeInsets.only(left: 5),
// child: Align(
// alignment: Alignment.topLeft,
// child: RatingBar.readOnly(
// initialRating:
// model.recommendedProduct[0].products[index].reviews.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,
// ),
// ),
// ),
]),
],
),
);
}
): Container(
// child: Text("NO DATA"),
),
),
),
),
);
}),
),
] ),
),
);
}}

@ -119,22 +119,42 @@ class _ProfilePageState extends State<PharmacyProfilePage> {
bottom: 10.0,
),
child: LargeAvatar(
name: "profile",
name: user.firstName.toString(),
url: '',
),
),
Text(
languageID == "ar"
? user.firstNameN.toString() +
" " +
user.lastNameN.toString()
: user.firstName.toString() +
" " +
user.lastName.toString(),
style: TextStyle(
fontSize: 14.0,
fontWeight: FontWeight.bold),
),
Column(
children: <Widget>[
Row(
children: <Widget>[
Text(
TranslationBase.of(context).welcome,
style: TextStyle(
fontSize: 14.0,
fontWeight: FontWeight.bold,
color: Colors.grey),
),
] ),
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),
),
] ),
] ),
],
),
)

@ -0,0 +1,39 @@
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';
import 'package:flutter/material.dart';
class RecommendedProductService extends BaseService{
AppSharedPreferences sharedPref = AppSharedPreferences();
AppGlobal appGlobal = new AppGlobal();
AuthenticatedUser authUser = new AuthenticatedUser();
AuthProvider authProvider = new AuthProvider();
List<RecommendedProductModel> _recommendedProductList = List();
List<RecommendedProductModel> get recommendedProductList => _recommendedProductList;
String url ="";
Future getRecommendedProducts(ProductId) async {
hasError = false;
url =GET_RECOMMENDED_PRODUCT+ProductId;
print("Recommended Product is"+url);
await baseAppClient.getPharmacy(url,
onSuccess: (dynamic response, int statusCode) {
_recommendedProductList.clear();
response['products'].forEach((item) {
});
print("print recommended items" + _recommendedProductList.length.toString());
print(response);
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
});
}}

@ -157,7 +157,7 @@ dependencies:
# recase: ^3.0.0
wakelock: ^0.1.4
after_layout: ^1.0.7
twilio_programmable_video: ^0.5.0+3
twilio_programmable_video: ^0.6.3+1
flutter_tts: ^1.2.6
wifi: ^0.1.5

Loading…
Cancel
Save