Merge branch 'development' into development_new_design_2.0

# Conflicts:
#	lib/core/service/parmacyModule/prescription_service.dart
#	lib/pages/BookAppointment/DentalComplaints.dart
#	lib/pages/login/login.dart
merge-requests/390/head
Sikander Saleem 4 years ago
commit bdb7f29d4c

@ -338,6 +338,9 @@ const GET_PATIENT_HEALTH_STATS =
const SEND_CHECK_IN_NFC_REQUEST = const SEND_CHECK_IN_NFC_REQUEST =
'Services/Patients.svc/REST/Patient_CheckAppointmentValidation_ForNFC'; 'Services/Patients.svc/REST/Patient_CheckAppointmentValidation_ForNFC';
const HAS_DENTAL_PLAN =
'Services/Doctors.svc/REST/Dental_IsPatientHasOnGoingEstimation';
//URL to get medicine and pharmacies list //URL to get medicine and pharmacies list
const CHANNEL = 3; const CHANNEL = 3;
const GENERAL_ID = 'Cs2020@2016\$2958'; const GENERAL_ID = 'Cs2020@2016\$2958';
@ -505,7 +508,8 @@ const GET_DOCTOR_LIST_BY_TIME = "Services/Doctors.svc/REST/SearchDoctorsByTime";
const PHARMACY_AUTORZIE_CUSTOMER = "AutorizeCustomer"; const PHARMACY_AUTORZIE_CUSTOMER = "AutorizeCustomer";
const PHARMACY_VERIFY_CUSTOMER = "VerifyCustomer"; const PHARMACY_VERIFY_CUSTOMER = "VerifyCustomer";
const PHARMACY_GET_COUNTRY = "countries"; const PHARMACY_GET_COUNTRY = "countries";
const PHARMACY_CREATE_CUSTOMER = "epharmacy/api/CreateCustomer"; // const PHARMACY_CREATE_CUSTOMER = "epharmacy/api/CreateCustomer";
const PHARMACY_CREATE_CUSTOMER = "epharmacy/api/getorcreateCustomer";
const GET_PHARMACY_BANNER = "promotionbanners"; const GET_PHARMACY_BANNER = "promotionbanners";
const GET_PHARMACY_TOP_MANUFACTURER = "topmanufacturer"; const GET_PHARMACY_TOP_MANUFACTURER = "topmanufacturer";
const GET_PHARMACY_BEST_SELLER_PRODUCT = "bestsellerproducts"; const GET_PHARMACY_BEST_SELLER_PRODUCT = "bestsellerproducts";

@ -237,7 +237,7 @@ const Map localizedValues = {
"companyName": {"en": "Company Name ", "ar": "اسم الشركة: "}, "companyName": {"en": "Company Name ", "ar": "اسم الشركة: "},
"receiptOn": {"en": "Receipt on: ", "ar": "تاريخ الفاتورة: "}, "receiptOn": {"en": "Receipt on: ", "ar": "تاريخ الفاتورة: "},
"expiryDate": {"en": "Expiry Date: ", "ar": "تاريخ الانتهاء: "}, "expiryDate": {"en": "Expiry Date: ", "ar": "تاريخ الانتهاء: "},
"procedureName": {"en": "Procedure Name", "ar": "اسم الاجراء"}, "procedureName": {"en": "Procedure Name:", "ar": "اسم الاجراء:"},
"procedureStatus": {"en": "Procedure Status: ", "ar": "حالة الاجراء"}, "procedureStatus": {"en": "Procedure Status: ", "ar": "حالة الاجراء"},
"usageStatus": {"en": "Usage Status", "ar": "جالة الاستخدام"}, "usageStatus": {"en": "Usage Status", "ar": "جالة الاستخدام"},
"unusedCount": {"en": "Unused Count: ", "ar": "غير مستخدم: "}, "unusedCount": {"en": "Unused Count: ", "ar": "غير مستخدم: "},
@ -440,10 +440,7 @@ const Map localizedValues = {
"en": "Please select treatment start day and time to be notified when it\'s time to take the medicine", "en": "Please select treatment start day and time to be notified when it\'s time to take the medicine",
"ar": " يرجى تحديد يوم بدء العلاج والوقت ليتم ارسال تنبيه عندما يحين الوقت لتناول الدواء" "ar": " يرجى تحديد يوم بدء العلاج والوقت ليتم ارسال تنبيه عندما يحين الوقت لتناول الدواء"
}, },
"pleaseSelectAllQuestionToContinue": { "pleaseSelectAllQuestionToContinue": {"en": "Please answer all questions to continue...", "ar": "يرجى الإجابة على جميع الأسئلة للمتابعة..."},
"en": "Please answer all questions to continue...",
"ar": "يرجى الإجابة على جميع الأسئلة للمتابعة..."
},
"StartDay": {"en": "Start Day", "ar": "يوم البداية"}, "StartDay": {"en": "Start Day", "ar": "يوم البداية"},
"EndDay": {"en": "End Day", "ar": "يوم الانتهاء"}, "EndDay": {"en": "End Day", "ar": "يوم الانتهاء"},
"Days": {"en": "Days ", "ar": "أيام"}, "Days": {"en": "Days ", "ar": "أيام"},
@ -1396,4 +1393,8 @@ const Map localizedValues = {
"passport-number": {"en": "Passport Number", "ar": "رقم جواز السفر"}, "passport-number": {"en": "Passport Number", "ar": "رقم جواز السفر"},
"enter-passport-number": {"en": "Please confirm or update your passport number:", "ar": "الرجاء تأكيد أو تحديث رقم جواز السفر الخاص بك:"}, "enter-passport-number": {"en": "Please confirm or update your passport number:", "ar": "الرجاء تأكيد أو تحديث رقم جواز السفر الخاص بك:"},
"valid-passport-number": {"en": "Please enter valid passport number", "ar": "الرجاء إدخال رقم جواز سفر صالح"}, "valid-passport-number": {"en": "Please enter valid passport number", "ar": "الرجاء إدخال رقم جواز سفر صالح"},
"continue-plan": {"en": "Continue with the treatment plan?", "ar": "إكمال الخطة العلاجية؟"},
"dental-procedure-list": {"en": "Dental Procedures for this Appointment: ", "ar": "إجراءات الأسنان لهذا الموعد:"},
"time-needed": {"en": "Time Needed:", "ar": "الوقت اللازم:"},
"total-time-needed": {"en": "Total Appointment Time:", "ar": "وقت المواعيد الكلي:"},
}; };

@ -1,247 +1,251 @@
class RecommendedProductModel { class RecommendedProductModel {
List<Products> products; dynamic id;
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; bool visibleIndividually;
String name; dynamic name;
String namen; dynamic namen;
String shortDescription; List<LocalizedNames> localizedNames;
String shortDescriptionn; dynamic shortDescription;
String fullDescription; dynamic shortDescriptionn;
String fullDescriptionn; dynamic fullDescription;
dynamic fullDescriptionn;
bool markasNew; bool markasNew;
bool showOnHomePage; bool showOnHomePage;
dynamic metaKeywords; // dynamic metaKeywords;
dynamic metaDescription; // dynamic metaDescription;
dynamic metaTitle; // dynamic metaTitle;
bool allowCustomerReviews; bool allowCustomerReviews;
dynamic approvedRatingSum; int approvedRatingSum;
dynamic notApprovedRatingSum; int notApprovedRatingSum;
dynamic approvedTotalReviews; int approvedTotalReviews;
dynamic notApprovedTotalReviews; int notApprovedTotalReviews;
String sku; String sku;
bool isRx; bool isRx;
bool prescriptionRequired; bool prescriptionRequired;
dynamic rxMessage; // dynamic rxMessage;
dynamic rxMessagen; // dynamic rxMessagen;
dynamic manufacturerPartNumber; // dynamic manufacturerPartNumber;
dynamic gtin; // dynamic gtin;
bool isGiftCard; bool isGiftCard;
bool requireOtherProducts; bool requireOtherProducts;
bool automaticallyAddRequiredProducts; bool automaticallyAddRequiredProducts;
bool isDownload; bool isDownload;
bool unlimitedDownloads; bool unlimitedDownloads;
dynamic maxNumberOfDownloads; int maxNumberOfDownloads;
dynamic downloadExpirationDays; // dynamic downloadExpirationDays;
bool hasSampleDownload; bool hasSampleDownload;
bool hasUserAgreement; bool hasUserAgreement;
bool isRecurring; bool isRecurring;
dynamic recurringCycleLength; int recurringCycleLength;
dynamic recurringTotalCycles; int recurringTotalCycles;
bool isRental; bool isRental;
dynamic rentalPriceLength; int rentalPriceLength;
bool isShipEnabled; bool isShipEnabled;
bool isFreeShipping; bool isFreeShipping;
bool shipSeparately; bool shipSeparately;
dynamic additionalShippingCharge; int additionalShippingCharge;
bool isTaxExempt; bool isTaxExempt;
bool isTelecommunicationsOrBroadcastingOrElectronicServices; bool isTelecommunicationsOrBroadcastingOrElectronicServices;
bool useMultipleWarehouses; bool useMultipleWarehouses;
dynamic manageInventoryMethodId; int manageInventoryMethodId;
dynamic stockQuantity; int stockQuantity;
String stockAvailability; dynamic stockAvailability;
String stockAvailabilityn; dynamic stockAvailabilityn;
bool displayStockAvailability; bool displayStockAvailability;
bool displayStockQuantity; bool displayStockQuantity;
dynamic minStockQuantity; int minStockQuantity;
dynamic notifyAdminForQuantityBelow; int notifyAdminForQuantityBelow;
bool allowBackInStockSubscriptions; bool allowBackInStockSubscriptions;
dynamic orderMinimumQuantity; int orderMinimumQuantity;
dynamic orderMaximumQuantity; int orderMaximumQuantity;
dynamic allowedQuantities; // Null allowedQuantities;
bool allowAddingOnlyExistingAttributeCombinations; bool allowAddingOnlyExistingAttributeCombinations;
bool disableBuyButton; bool disableBuyButton;
bool disableWishlistButton; bool disableWishlistButton;
bool availableForPreOrder; bool availableForPreOrder;
dynamic preOrderAvailabilityStartDateTimeUtc; // dynamic preOrderAvailabilityStartDateTimeUtc;
bool callForPrice; bool callForPrice;
dynamic price; double price;
dynamic oldPrice; int oldPrice;
dynamic productCost; double productCost;
dynamic specialPrice; // dynamic specialPrice;
dynamic specialPriceStartDateTimeUtc; // dynamic specialPriceStartDateTimeUtc;
dynamic specialPriceEndDateTimeUtc; // dynamic specialPriceEndDateTimeUtc;
bool customerEntersPrice; bool customerEntersPrice;
dynamic minimumCustomerEnteredPrice; int minimumCustomerEnteredPrice;
dynamic maximumCustomerEnteredPrice; int maximumCustomerEnteredPrice;
bool basepriceEnabled; bool basepriceEnabled;
dynamic basepriceAmount; int basepriceAmount;
dynamic basepriceBaseAmount; int basepriceBaseAmount;
bool hasTierPrices; bool hasTierPrices;
bool hasDiscountsApplied; bool hasDiscountsApplied;
dynamic discountName; // dynamic discountName;
dynamic discountNamen; // dynamic discountNamen;
dynamic discountDescription; // dynamic discountDescription;
dynamic discountDescriptionn; // dynamic discountDescriptionn;
dynamic discountPercentage; // dynamic discountPercentage;
String currency; dynamic currency;
String currencyn; dynamic currencyn;
double weight; double weight;
dynamic length; int length;
dynamic width; int width;
dynamic height; int height;
dynamic availableStartDateTimeUtc; // dynamic availableStartDateTimeUtc;
dynamic availableEndDateTimeUtc; // dynamic availableEndDateTimeUtc;
dynamic displayOrder; int displayOrder;
bool published; bool published;
bool deleted; bool deleted;
String createdOnUtc; dynamic createdOnUtc;
String updatedOnUtc; dynamic updatedOnUtc;
String productType; dynamic productType;
dynamic parentGroupedProductId; int parentGroupedProductId;
dynamic vendorId; // List<dynamic> roleIds;
String seName; // List<dynamic> discountIds;
// List<dynamic> storeIds;
List<int> manufacturerIds;
// List<dynamic> reviews;
List<Images> images; List<Images> images;
// List<dynamic> attributes;
List<Specifications> specifications;
// List<dynamic> associatedProductIds;
// List<dynamic> tags;
int vendorId;
dynamic seName;
bool isinwishlist;
Products({ RecommendedProductModel(
this.id, {this.id,
this.visibleIndividually, this.visibleIndividually,
this.name, this.name,
this.namen, this.namen,
this.shortDescription, this.localizedNames,
this.shortDescriptionn, this.shortDescription,
this.fullDescription, this.shortDescriptionn,
this.fullDescriptionn, this.fullDescription,
this.markasNew, this.fullDescriptionn,
this.showOnHomePage, this.markasNew,
this.metaKeywords, this.showOnHomePage,
this.metaDescription, // this.metaKeywords,
this.metaTitle, // this.metaDescription,
this.allowCustomerReviews, // this.metaTitle,
this.approvedRatingSum, this.allowCustomerReviews,
this.notApprovedRatingSum, this.approvedRatingSum,
this.approvedTotalReviews, this.notApprovedRatingSum,
this.notApprovedTotalReviews, this.approvedTotalReviews,
this.sku, this.notApprovedTotalReviews,
this.isRx, this.sku,
this.prescriptionRequired, this.isRx,
this.rxMessage, this.prescriptionRequired,
this.rxMessagen, // this.rxMessage,
this.manufacturerPartNumber, // this.rxMessagen,
this.gtin, // this.manufacturerPartNumber,
this.isGiftCard, // this.gtin,
this.requireOtherProducts, this.isGiftCard,
this.automaticallyAddRequiredProducts, this.requireOtherProducts,
this.isDownload, this.automaticallyAddRequiredProducts,
this.unlimitedDownloads, this.isDownload,
this.maxNumberOfDownloads, this.unlimitedDownloads,
this.downloadExpirationDays, this.maxNumberOfDownloads,
this.hasSampleDownload, // this.downloadExpirationDays,
this.hasUserAgreement, this.hasSampleDownload,
this.isRecurring, this.hasUserAgreement,
this.recurringCycleLength, this.isRecurring,
this.recurringTotalCycles, this.recurringCycleLength,
this.isRental, this.recurringTotalCycles,
this.rentalPriceLength, this.isRental,
this.isShipEnabled, this.rentalPriceLength,
this.isFreeShipping, this.isShipEnabled,
this.shipSeparately, this.isFreeShipping,
this.additionalShippingCharge, this.shipSeparately,
this.isTaxExempt, this.additionalShippingCharge,
this.isTelecommunicationsOrBroadcastingOrElectronicServices, this.isTaxExempt,
this.useMultipleWarehouses, this.isTelecommunicationsOrBroadcastingOrElectronicServices,
this.manageInventoryMethodId, this.useMultipleWarehouses,
this.stockQuantity, this.manageInventoryMethodId,
this.stockAvailability, this.stockQuantity,
this.stockAvailabilityn, this.stockAvailability,
this.displayStockAvailability, this.stockAvailabilityn,
this.displayStockQuantity, this.displayStockAvailability,
this.minStockQuantity, this.displayStockQuantity,
this.notifyAdminForQuantityBelow, this.minStockQuantity,
this.allowBackInStockSubscriptions, this.notifyAdminForQuantityBelow,
this.orderMinimumQuantity, this.allowBackInStockSubscriptions,
this.orderMaximumQuantity, this.orderMinimumQuantity,
this.allowedQuantities, this.orderMaximumQuantity,
this.allowAddingOnlyExistingAttributeCombinations, // this.allowedQuantities,
this.disableBuyButton, this.allowAddingOnlyExistingAttributeCombinations,
this.disableWishlistButton, this.disableBuyButton,
this.availableForPreOrder, this.disableWishlistButton,
this.preOrderAvailabilityStartDateTimeUtc, this.availableForPreOrder,
this.callForPrice, // this.preOrderAvailabilityStartDateTimeUtc,
this.price, this.callForPrice,
this.oldPrice, this.price,
this.productCost, this.oldPrice,
this.specialPrice, this.productCost,
this.specialPriceStartDateTimeUtc, // this.specialPrice,
this.specialPriceEndDateTimeUtc, // this.specialPriceStartDateTimeUtc,
this.customerEntersPrice, // this.specialPriceEndDateTimeUtc,
this.minimumCustomerEnteredPrice, this.customerEntersPrice,
this.maximumCustomerEnteredPrice, this.minimumCustomerEnteredPrice,
this.basepriceEnabled, this.maximumCustomerEnteredPrice,
this.basepriceAmount, this.basepriceEnabled,
this.basepriceBaseAmount, this.basepriceAmount,
this.hasTierPrices, this.basepriceBaseAmount,
this.hasDiscountsApplied, this.hasTierPrices,
this.discountName, this.hasDiscountsApplied,
this.discountNamen, // this.discountName,
this.discountDescription, // this.discountNamen,
this.discountDescriptionn, // this.discountDescription,
this.discountPercentage, // this.discountDescriptionn,
this.currency, // this.discountPercentage,
this.currencyn, this.currency,
this.weight, this.currencyn,
this.length, this.weight,
this.width, this.length,
this.height, this.width,
this.availableStartDateTimeUtc, this.height,
this.availableEndDateTimeUtc, // this.availableStartDateTimeUtc,
this.displayOrder, // this.availableEndDateTimeUtc,
this.published, this.displayOrder,
this.deleted, this.published,
this.createdOnUtc, this.deleted,
this.updatedOnUtc, this.createdOnUtc,
this.productType, this.updatedOnUtc,
this.parentGroupedProductId, this.productType,
this.vendorId, this.parentGroupedProductId,
this.seName, // this.roleIds,
this.images, // this.discountIds,
}); // this.storeIds,
this.manufacturerIds,
// this.reviews,
this.images,
// this.attributes,
this.specifications,
// this.associatedProductIds,
// this.tags,
this.vendorId,
this.seName,
this.isinwishlist});
Products.fromJson(Map<String, dynamic> json) { RecommendedProductModel.fromJson(Map<String, dynamic> json) {
id = json['id']; id = json['id'];
visibleIndividually = json['visible_individually']; visibleIndividually = json['visible_individually'];
name = json['name']; name = json['name'];
namen = json['namen']; 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']; shortDescription = json['short_description'];
shortDescriptionn = json['short_descriptionn']; shortDescriptionn = json['short_descriptionn'];
fullDescription = json['full_description']; fullDescription = json['full_description'];
fullDescriptionn = json['full_descriptionn']; fullDescriptionn = json['full_descriptionn'];
markasNew = json['markas_new']; markasNew = json['markas_new'];
showOnHomePage = json['show_on_home_page']; showOnHomePage = json['show_on_home_page'];
metaKeywords = json['meta_keywords']; // metaKeywords = json['meta_keywords'];
metaDescription = json['meta_description']; // metaDescription = json['meta_description'];
metaTitle = json['meta_title']; // metaTitle = json['meta_title'];
allowCustomerReviews = json['allow_customer_reviews']; allowCustomerReviews = json['allow_customer_reviews'];
approvedRatingSum = json['approved_rating_sum']; approvedRatingSum = json['approved_rating_sum'];
notApprovedRatingSum = json['not_approved_rating_sum']; notApprovedRatingSum = json['not_approved_rating_sum'];
@ -250,18 +254,18 @@ class Products {
sku = json['sku']; sku = json['sku'];
isRx = json['is_rx']; isRx = json['is_rx'];
prescriptionRequired = json['prescription_required']; prescriptionRequired = json['prescription_required'];
rxMessage = json['rx_message']; // rxMessage = json['rx_message'];
rxMessagen = json['rx_messagen']; // rxMessagen = json['rx_messagen'];
manufacturerPartNumber = json['manufacturer_part_number']; // manufacturerPartNumber = json['manufacturer_part_number'];
gtin = json['gtin']; // gtin = json['gtin'];
isGiftCard = json['is_gift_card']; isGiftCard = json['is_gift_card'];
requireOtherProducts = json['require_other_products']; requireOtherProducts = json['require_other_products'];
automaticallyAddRequiredProducts = automaticallyAddRequiredProducts =
json['automatically_add_required_products']; json['automatically_add_required_products'];
isDownload = json['is_download']; isDownload = json['is_download'];
unlimitedDownloads = json['unlimited_downloads']; unlimitedDownloads = json['unlimited_downloads'];
maxNumberOfDownloads = json['max_number_of_downloads']; maxNumberOfDownloads = json['max_number_of_downloads'];
downloadExpirationDays = json['download_expiration_days']; // downloadExpirationDays = json['download_expiration_days'];
hasSampleDownload = json['has_sample_download']; hasSampleDownload = json['has_sample_download'];
hasUserAgreement = json['has_user_agreement']; hasUserAgreement = json['has_user_agreement'];
isRecurring = json['is_recurring']; isRecurring = json['is_recurring'];
@ -275,7 +279,7 @@ class Products {
additionalShippingCharge = json['additional_shipping_charge']; additionalShippingCharge = json['additional_shipping_charge'];
isTaxExempt = json['is_tax_exempt']; isTaxExempt = json['is_tax_exempt'];
isTelecommunicationsOrBroadcastingOrElectronicServices = isTelecommunicationsOrBroadcastingOrElectronicServices =
json['is_telecommunications_or_broadcasting_or_electronic_services']; json['is_telecommunications_or_broadcasting_or_electronic_services'];
useMultipleWarehouses = json['use_multiple_warehouses']; useMultipleWarehouses = json['use_multiple_warehouses'];
manageInventoryMethodId = json['manage_inventory_method_id']; manageInventoryMethodId = json['manage_inventory_method_id'];
stockQuantity = json['stock_quantity']; stockQuantity = json['stock_quantity'];
@ -288,21 +292,21 @@ class Products {
allowBackInStockSubscriptions = json['allow_back_in_stock_subscriptions']; allowBackInStockSubscriptions = json['allow_back_in_stock_subscriptions'];
orderMinimumQuantity = json['order_minimum_quantity']; orderMinimumQuantity = json['order_minimum_quantity'];
orderMaximumQuantity = json['order_maximum_quantity']; orderMaximumQuantity = json['order_maximum_quantity'];
allowedQuantities = json['allowed_quantities']; // allowedQuantities = json['allowed_quantities'];
allowAddingOnlyExistingAttributeCombinations = allowAddingOnlyExistingAttributeCombinations =
json['allow_adding_only_existing_attribute_combinations']; json['allow_adding_only_existing_attribute_combinations'];
disableBuyButton = json['disable_buy_button']; disableBuyButton = json['disable_buy_button'];
disableWishlistButton = json['disable_wishlist_button']; disableWishlistButton = json['disable_wishlist_button'];
availableForPreOrder = json['available_for_pre_order']; availableForPreOrder = json['available_for_pre_order'];
preOrderAvailabilityStartDateTimeUtc = // preOrderAvailabilityStartDateTimeUtc =
json['pre_order_availability_start_date_time_utc']; // json['pre_order_availability_start_date_time_utc'];
callForPrice = json['call_for_price']; callForPrice = json['call_for_price'];
price = json['price']; price = json['price'];
oldPrice = json['old_price']; oldPrice = json['old_price'];
productCost = json['product_cost']; productCost = json['product_cost'];
specialPrice = json['special_price']; // specialPrice = json['special_price'];
specialPriceStartDateTimeUtc = json['special_price_start_date_time_utc']; // specialPriceStartDateTimeUtc = json['special_price_start_date_time_utc'];
specialPriceEndDateTimeUtc = json['special_price_end_date_time_utc']; // specialPriceEndDateTimeUtc = json['special_price_end_date_time_utc'];
customerEntersPrice = json['customer_enters_price']; customerEntersPrice = json['customer_enters_price'];
minimumCustomerEnteredPrice = json['minimum_customer_entered_price']; minimumCustomerEnteredPrice = json['minimum_customer_entered_price'];
maximumCustomerEnteredPrice = json['maximum_customer_entered_price']; maximumCustomerEnteredPrice = json['maximum_customer_entered_price'];
@ -311,19 +315,19 @@ class Products {
basepriceBaseAmount = json['baseprice_base_amount']; basepriceBaseAmount = json['baseprice_base_amount'];
hasTierPrices = json['has_tier_prices']; hasTierPrices = json['has_tier_prices'];
hasDiscountsApplied = json['has_discounts_applied']; hasDiscountsApplied = json['has_discounts_applied'];
discountName = json['discount_name']; // discountName = json['discount_name'];
discountNamen = json['discount_namen']; // discountNamen = json['discount_namen'];
discountDescription = json['discount_description']; // discountDescription = json['discount_description'];
discountDescriptionn = json['discount_Descriptionn']; // discountDescriptionn = json['discount_Descriptionn'];
discountPercentage = json['discount_percentage']; // discountPercentage = json['discount_percentage'];
currency = json['currency']; currency = json['currency'];
currencyn = json['currencyn']; currencyn = json['currencyn'];
weight = json['weight']; weight = json['weight'];
length = json['length']; length = json['length'];
width = json['width']; width = json['width'];
height = json['height']; height = json['height'];
availableStartDateTimeUtc = json['available_start_date_time_utc']; // availableStartDateTimeUtc = json['available_start_date_time_utc'];
availableEndDateTimeUtc = json['available_end_date_time_utc']; // availableEndDateTimeUtc = json['available_end_date_time_utc'];
displayOrder = json['display_order']; displayOrder = json['display_order'];
published = json['published']; published = json['published'];
deleted = json['deleted']; deleted = json['deleted'];
@ -331,14 +335,64 @@ class Products {
updatedOnUtc = json['updated_on_utc']; updatedOnUtc = json['updated_on_utc'];
productType = json['product_type']; productType = json['product_type'];
parentGroupedProductId = json['parent_grouped_product_id']; parentGroupedProductId = json['parent_grouped_product_id'];
vendorId = json['vendor_id']; // if (json['role_ids'] != null) {
seName = json['se_name']; // roleIds = new List<Null>();
// json['role_ids'].forEach((v) {
// roleIds.add(new Null.fromJson(v));
// });
// }
// if (json['discount_ids'] != null) {
// discountIds = new List<Null>();
// json['discount_ids'].forEach((v) {
// discountIds.add(new Null.fromJson(v));
// });
// }
// if (json['store_ids'] != null) {
// storeIds = new List<Null>();
// json['store_ids'].forEach((v) {
// storeIds.add(new Null.fromJson(v));
// });
// }
manufacturerIds = json['manufacturer_ids'].cast<int>();
// if (json['reviews'] != null) {
// reviews = new List<Null>();
// json['reviews'].forEach((v) {
// reviews.add(new Null.fromJson(v));
// });
// }
if (json['images'] != null) { if (json['images'] != null) {
images = new List<Images>(); images = new List<Images>();
json['images'].forEach((v) { json['images'].forEach((v) {
images.add(new Images.fromJson(v)); images.add(new Images.fromJson(v));
}); });
} }
// if (json['attributes'] != null) {
// attributes = new List<Null>();
// json['attributes'].forEach((v) {
// attributes.add(new Null.fromJson(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(new Null.fromJson(v));
// });
// }
// if (json['tags'] != null) {
// tags = new List<Null>();
// json['tags'].forEach((v) {
// tags.add(new Null.fromJson(v));
// });
// }
vendorId = json['vendor_id'];
seName = json['se_name'];
isinwishlist = json['isinwishlist'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -347,15 +401,19 @@ class Products {
data['visible_individually'] = this.visibleIndividually; data['visible_individually'] = this.visibleIndividually;
data['name'] = this.name; data['name'] = this.name;
data['namen'] = this.namen; 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_description'] = this.shortDescription;
data['short_descriptionn'] = this.shortDescriptionn; data['short_descriptionn'] = this.shortDescriptionn;
data['full_description'] = this.fullDescription; data['full_description'] = this.fullDescription;
data['full_descriptionn'] = this.fullDescriptionn; data['full_descriptionn'] = this.fullDescriptionn;
data['markas_new'] = this.markasNew; data['markas_new'] = this.markasNew;
data['show_on_home_page'] = this.showOnHomePage; data['show_on_home_page'] = this.showOnHomePage;
data['meta_keywords'] = this.metaKeywords; // data['meta_keywords'] = this.metaKeywords;
data['meta_description'] = this.metaDescription; // data['meta_description'] = this.metaDescription;
data['meta_title'] = this.metaTitle; // data['meta_title'] = this.metaTitle;
data['allow_customer_reviews'] = this.allowCustomerReviews; data['allow_customer_reviews'] = this.allowCustomerReviews;
data['approved_rating_sum'] = this.approvedRatingSum; data['approved_rating_sum'] = this.approvedRatingSum;
data['not_approved_rating_sum'] = this.notApprovedRatingSum; data['not_approved_rating_sum'] = this.notApprovedRatingSum;
@ -364,10 +422,10 @@ class Products {
data['sku'] = this.sku; data['sku'] = this.sku;
data['is_rx'] = this.isRx; data['is_rx'] = this.isRx;
data['prescription_required'] = this.prescriptionRequired; data['prescription_required'] = this.prescriptionRequired;
data['rx_message'] = this.rxMessage; // data['rx_message'] = this.rxMessage;
data['rx_messagen'] = this.rxMessagen; // data['rx_messagen'] = this.rxMessagen;
data['manufacturer_part_number'] = this.manufacturerPartNumber; // data['manufacturer_part_number'] = this.manufacturerPartNumber;
data['gtin'] = this.gtin; // data['gtin'] = this.gtin;
data['is_gift_card'] = this.isGiftCard; data['is_gift_card'] = this.isGiftCard;
data['require_other_products'] = this.requireOtherProducts; data['require_other_products'] = this.requireOtherProducts;
data['automatically_add_required_products'] = data['automatically_add_required_products'] =
@ -375,7 +433,7 @@ class Products {
data['is_download'] = this.isDownload; data['is_download'] = this.isDownload;
data['unlimited_downloads'] = this.unlimitedDownloads; data['unlimited_downloads'] = this.unlimitedDownloads;
data['max_number_of_downloads'] = this.maxNumberOfDownloads; data['max_number_of_downloads'] = this.maxNumberOfDownloads;
data['download_expiration_days'] = this.downloadExpirationDays; // data['download_expiration_days'] = this.downloadExpirationDays;
data['has_sample_download'] = this.hasSampleDownload; data['has_sample_download'] = this.hasSampleDownload;
data['has_user_agreement'] = this.hasUserAgreement; data['has_user_agreement'] = this.hasUserAgreement;
data['is_recurring'] = this.isRecurring; data['is_recurring'] = this.isRecurring;
@ -403,22 +461,22 @@ class Products {
this.allowBackInStockSubscriptions; this.allowBackInStockSubscriptions;
data['order_minimum_quantity'] = this.orderMinimumQuantity; data['order_minimum_quantity'] = this.orderMinimumQuantity;
data['order_maximum_quantity'] = this.orderMaximumQuantity; data['order_maximum_quantity'] = this.orderMaximumQuantity;
data['allowed_quantities'] = this.allowedQuantities; // data['allowed_quantities'] = this.allowedQuantities;
data['allow_adding_only_existing_attribute_combinations'] = data['allow_adding_only_existing_attribute_combinations'] =
this.allowAddingOnlyExistingAttributeCombinations; this.allowAddingOnlyExistingAttributeCombinations;
data['disable_buy_button'] = this.disableBuyButton; data['disable_buy_button'] = this.disableBuyButton;
data['disable_wishlist_button'] = this.disableWishlistButton; data['disable_wishlist_button'] = this.disableWishlistButton;
data['available_for_pre_order'] = this.availableForPreOrder; data['available_for_pre_order'] = this.availableForPreOrder;
data['pre_order_availability_start_date_time_utc'] = // data['pre_order_availability_start_date_time_utc'] =
this.preOrderAvailabilityStartDateTimeUtc; // this.preOrderAvailabilityStartDateTimeUtc;
data['call_for_price'] = this.callForPrice; data['call_for_price'] = this.callForPrice;
data['price'] = this.price; data['price'] = this.price;
data['old_price'] = this.oldPrice; data['old_price'] = this.oldPrice;
data['product_cost'] = this.productCost; data['product_cost'] = this.productCost;
data['special_price'] = this.specialPrice; // data['special_price'] = this.specialPrice;
data['special_price_start_date_time_utc'] = // data['special_price_start_date_time_utc'] =
this.specialPriceStartDateTimeUtc; // this.specialPriceStartDateTimeUtc;
data['special_price_end_date_time_utc'] = this.specialPriceEndDateTimeUtc; // data['special_price_end_date_time_utc'] = this.specialPriceEndDateTimeUtc;
data['customer_enters_price'] = this.customerEntersPrice; data['customer_enters_price'] = this.customerEntersPrice;
data['minimum_customer_entered_price'] = this.minimumCustomerEnteredPrice; data['minimum_customer_entered_price'] = this.minimumCustomerEnteredPrice;
data['maximum_customer_entered_price'] = this.maximumCustomerEnteredPrice; data['maximum_customer_entered_price'] = this.maximumCustomerEnteredPrice;
@ -427,19 +485,19 @@ class Products {
data['baseprice_base_amount'] = this.basepriceBaseAmount; data['baseprice_base_amount'] = this.basepriceBaseAmount;
data['has_tier_prices'] = this.hasTierPrices; data['has_tier_prices'] = this.hasTierPrices;
data['has_discounts_applied'] = this.hasDiscountsApplied; data['has_discounts_applied'] = this.hasDiscountsApplied;
data['discount_name'] = this.discountName; // data['discount_name'] = this.discountName;
data['discount_namen'] = this.discountNamen; // data['discount_namen'] = this.discountNamen;
data['discount_description'] = this.discountDescription; // data['discount_description'] = this.discountDescription;
data['discount_Descriptionn'] = this.discountDescriptionn; // data['discount_Descriptionn'] = this.discountDescriptionn;
data['discount_percentage'] = this.discountPercentage; // data['discount_percentage'] = this.discountPercentage;
data['currency'] = this.currency; data['currency'] = this.currency;
data['currencyn'] = this.currencyn; data['currencyn'] = this.currencyn;
data['weight'] = this.weight; data['weight'] = this.weight;
data['length'] = this.length; data['length'] = this.length;
data['width'] = this.width; data['width'] = this.width;
data['height'] = this.height; data['height'] = this.height;
data['available_start_date_time_utc'] = this.availableStartDateTimeUtc; // data['available_start_date_time_utc'] = this.availableStartDateTimeUtc;
data['available_end_date_time_utc'] = this.availableEndDateTimeUtc; // data['available_end_date_time_utc'] = this.availableEndDateTimeUtc;
data['display_order'] = this.displayOrder; data['display_order'] = this.displayOrder;
data['published'] = this.published; data['published'] = this.published;
data['deleted'] = this.deleted; data['deleted'] = this.deleted;
@ -447,12 +505,58 @@ class Products {
data['updated_on_utc'] = this.updatedOnUtc; data['updated_on_utc'] = this.updatedOnUtc;
data['product_type'] = this.productType; data['product_type'] = this.productType;
data['parent_grouped_product_id'] = this.parentGroupedProductId; data['parent_grouped_product_id'] = this.parentGroupedProductId;
data['vendor_id'] = this.vendorId; // if (this.roleIds != null) {
data['se_name'] = this.seName; // data['role_ids'] = this.roleIds.map((v) => v.toJson()).toList();
// }
// if (this.discountIds != null) {
// data['discount_ids'] = this.discountIds.map((v) => v.toJson()).toList();
// }
// if (this.storeIds != null) {
// data['store_ids'] = this.storeIds.map((v) => v.toJson()).toList();
// }
data['manufacturer_ids'] = this.manufacturerIds;
// if (this.reviews != null) {
// data['reviews'] = this.reviews.map((v) => v.toJson()).toList();
// }
if (this.images != null) { if (this.images != null) {
data['images'] = this.images.map((v) => v.toJson()).toList(); data['images'] = this.images.map((v) => v.toJson()).toList();
} }
// if (this.attributes != null) {
// data['attributes'] = this.attributes.map((v) => v.toJson()).toList();
// }
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.toJson()).toList();
// }
// if (this.tags != null) {
// data['tags'] = this.tags.map((v) => v.toJson()).toList();
// }
data['vendor_id'] = this.vendorId;
data['se_name'] = this.seName;
data['isinwishlist'] = this.isinwishlist;
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; return data;
} }
} }
@ -484,3 +588,40 @@ class Images {
return data; 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;
}
}

@ -10,7 +10,6 @@ import 'package:diplomaticquarterapp/uitl/utils.dart';
class PharmacyModuleService extends BaseService { class PharmacyModuleService extends BaseService {
final AppSharedPreferences sharedPref = AppSharedPreferences(); final AppSharedPreferences sharedPref = AppSharedPreferences();
bool isFinished = true; bool isFinished = true;
bool hasError = false;
String errorMsg = ''; String errorMsg = '';
String url = ""; String url = "";
@ -114,6 +113,7 @@ class PharmacyModuleService extends BaseService {
} }
Future getTopManufacturerList() async { Future getTopManufacturerList() async {
hasError = false;
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, await baseAppClient.getPharmacy(GET_PHARMACY_TOP_MANUFACTURER,

@ -34,7 +34,7 @@ class PharmacyModuleViewModel extends BaseViewModel {
_pharmacyService.lastVisitedProducts; _pharmacyService.lastVisitedProducts;
List<PharmacyProduct> get recommendedProductList => List<Map<String, dynamic>> get recommendedProductList =>
_recommendedProductService.recommendedList; _recommendedProductService.recommendedList;
List<Prescriptions> get prescriptionsList => List<Prescriptions> get prescriptionsList =>
@ -74,6 +74,7 @@ class PharmacyModuleViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
} }
Future generatePharmacyToken() async { Future generatePharmacyToken() async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _pharmacyService.generatePharmacyToken(); await _pharmacyService.generatePharmacyToken();
@ -137,7 +138,7 @@ class PharmacyModuleViewModel extends BaseViewModel {
} }
} }
/////////////RecommendedProducts //////////////////////////////////////////RecommendedProducts
getRecommendedProducts(productId) async { getRecommendedProducts(productId) async {
hasError = false; hasError = false;
setState(ViewState.Busy); setState(ViewState.Busy);

@ -0,0 +1,76 @@
class DentalProceduresModel {
List<ListIsPatientHasOnGoingEstimation> listIsPatientHasOnGoingEstimation;
DentalProceduresModel({this.listIsPatientHasOnGoingEstimation});
DentalProceduresModel.fromJson(Map<String, dynamic> json) {
if (json['List_IsPatientHasOnGoingEstimation'] != null) {
listIsPatientHasOnGoingEstimation =
new List<ListIsPatientHasOnGoingEstimation>();
json['List_IsPatientHasOnGoingEstimation'].forEach((v) {
listIsPatientHasOnGoingEstimation
.add(new ListIsPatientHasOnGoingEstimation.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.listIsPatientHasOnGoingEstimation != null) {
data['List_IsPatientHasOnGoingEstimation'] = this
.listIsPatientHasOnGoingEstimation
.map((v) => v.toJson())
.toList();
}
return data;
}
}
class ListIsPatientHasOnGoingEstimation {
dynamic setupID;
dynamic estimationNo;
int projectID;
String procedureId;
int patientID;
int sequenceNo;
int neededTime;
String procedureName;
dynamic procedureNameN;
ListIsPatientHasOnGoingEstimation(
{this.setupID,
this.estimationNo,
this.projectID,
this.procedureId,
this.patientID,
this.sequenceNo,
this.neededTime,
this.procedureName,
this.procedureNameN});
ListIsPatientHasOnGoingEstimation.fromJson(Map<String, dynamic> json) {
setupID = json['SetupID'];
estimationNo = json['EstimationNo'];
projectID = json['ProjectID'];
procedureId = json['ProcedureId'];
patientID = json['PatientID'];
sequenceNo = json['sequenceNo'];
neededTime = json['NeededTime'];
procedureName = json['ProcedureName'];
procedureNameN = json['ProcedureNameN'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['SetupID'] = this.setupID;
data['EstimationNo'] = this.estimationNo;
data['ProjectID'] = this.projectID;
data['ProcedureId'] = this.procedureId;
data['PatientID'] = this.patientID;
data['sequenceNo'] = this.sequenceNo;
data['NeededTime'] = this.neededTime;
data['ProcedureName'] = this.procedureName;
data['ProcedureNameN'] = this.procedureNameN;
return data;
}
}

@ -61,15 +61,15 @@ class Wishlist {
productAttributes: List<dynamic>.from(json["product_attributes"].map((x) => x)), productAttributes: List<dynamic>.from(json["product_attributes"].map((x) => x)),
customerEnteredPrice: json["customer_entered_price"], customerEnteredPrice: json["customer_entered_price"],
quantity: json["quantity"], quantity: json["quantity"],
discountAmountInclTax: json["discount_amount_incl_tax"], discountAmountInclTax: json["discount_amount_incl_tax"] != null ? json["discount_amount_incl_tax"] :0.0,
subtotal: json["subtotal"], subtotal: json["subtotal"],
subtotalWithVat: json["subtotal_with_vat"], subtotalWithVat: json["subtotal_with_vat"],
subtotalVatAmount: json["subtotal_vat_amount"], subtotalVatAmount: json["subtotal_vat_amount"],
subtotalVatRate: json["subtotal_vat_rate"], subtotalVatRate: json["subtotal_vat_rate"],
currency: json["currency"], currency: json["currency"],
currencyn: json["currencyn"], currencyn: json["currencyn"],
rentalStartDateUtc: json["rental_start_date_utc"], rentalStartDateUtc: json["rental_start_date_utc"] != null ? DateTime.parse(json["rental_start_date_utc"]) : DateTime.now(),
rentalEndDateUtc: json["rental_end_date_utc"], rentalEndDateUtc: json["rental_end_date_utc"] != null ? DateTime.parse(json["rental_end_date_utc"]) : DateTime.now(),
createdOnUtc: DateTime.parse(json["created_on_utc"]), createdOnUtc: DateTime.parse(json["created_on_utc"]),
updatedOnUtc: DateTime.parse(json["updated_on_utc"]), updatedOnUtc: DateTime.parse(json["updated_on_utc"]),
shoppingCartType: json["shopping_cart_type"], shoppingCartType: json["shopping_cart_type"],
@ -172,7 +172,7 @@ class Customer {
systemName: json["system_name"], systemName: json["system_name"],
lastIpAddress: json["last_ip_address"], lastIpAddress: json["last_ip_address"],
createdOnUtc: DateTime.parse(json["created_on_utc"]), createdOnUtc: DateTime.parse(json["created_on_utc"]),
lastLoginDateUtc: DateTime.parse(json["last_login_date_utc"]), lastLoginDateUtc: json["last_login_date_utc"] != null ? DateTime.parse(json["last_login_date_utc"]) : DateTime.now(),
lastActivityDateUtc: DateTime.parse(json["last_activity_date_utc"]), lastActivityDateUtc: DateTime.parse(json["last_activity_date_utc"]),
registeredInStoreId: json["registered_in_store_id"], registeredInStoreId: json["registered_in_store_id"],
roleIds: List<dynamic>.from(json["role_ids"].map((x) => x)), roleIds: List<dynamic>.from(json["role_ids"].map((x) => x)),
@ -335,9 +335,9 @@ class Product {
this.fullDescriptionn, this.fullDescriptionn,
this.markasNew, this.markasNew,
this.showOnHomePage, this.showOnHomePage,
this.metaKeywords, // this.metaKeywords,
this.metaDescription, // this.metaDescription,
this.metaTitle, // this.metaTitle,
this.allowCustomerReviews, this.allowCustomerReviews,
this.approvedRatingSum, this.approvedRatingSum,
this.notApprovedRatingSum, this.notApprovedRatingSum,
@ -348,15 +348,15 @@ class Product {
this.prescriptionRequired, this.prescriptionRequired,
this.rxMessage, this.rxMessage,
this.rxMessagen, this.rxMessagen,
this.manufacturerPartNumber, // this.manufacturerPartNumber,
this.gtin, // this.gtin,
this.isGiftCard, this.isGiftCard,
this.requireOtherProducts, this.requireOtherProducts,
this.automaticallyAddRequiredProducts, this.automaticallyAddRequiredProducts,
this.isDownload, this.isDownload,
this.unlimitedDownloads, this.unlimitedDownloads,
this.maxNumberOfDownloads, this.maxNumberOfDownloads,
this.downloadExpirationDays, // this.downloadExpirationDays,
this.hasSampleDownload, this.hasSampleDownload,
this.hasUserAgreement, this.hasUserAgreement,
this.isRecurring, this.isRecurring,
@ -382,7 +382,7 @@ class Product {
this.allowBackInStockSubscriptions, this.allowBackInStockSubscriptions,
this.orderMinimumQuantity, this.orderMinimumQuantity,
this.orderMaximumQuantity, this.orderMaximumQuantity,
this.allowedQuantities, // this.allowedQuantities,
this.allowAddingOnlyExistingAttributeCombinations, this.allowAddingOnlyExistingAttributeCombinations,
this.disableBuyButton, this.disableBuyButton,
this.disableWishlistButton, this.disableWishlistButton,
@ -448,9 +448,9 @@ class Product {
String fullDescriptionn; String fullDescriptionn;
bool markasNew; bool markasNew;
bool showOnHomePage; bool showOnHomePage;
dynamic metaKeywords; // dynamic metaKeywords;
dynamic metaDescription; // dynamic metaDescription;
dynamic metaTitle; // dynamic metaTitle;
bool allowCustomerReviews; bool allowCustomerReviews;
dynamic approvedRatingSum; dynamic approvedRatingSum;
dynamic notApprovedRatingSum; dynamic notApprovedRatingSum;
@ -461,15 +461,15 @@ class Product {
bool prescriptionRequired; bool prescriptionRequired;
dynamic rxMessage; dynamic rxMessage;
dynamic rxMessagen; dynamic rxMessagen;
dynamic manufacturerPartNumber; // dynamic manufacturerPartNumber;
dynamic gtin; // dynamic gtin;
bool isGiftCard; bool isGiftCard;
bool requireOtherProducts; bool requireOtherProducts;
bool automaticallyAddRequiredProducts; bool automaticallyAddRequiredProducts;
bool isDownload; bool isDownload;
bool unlimitedDownloads; bool unlimitedDownloads;
dynamic maxNumberOfDownloads; dynamic maxNumberOfDownloads;
dynamic downloadExpirationDays; // dynamic downloadExpirationDays;
bool hasSampleDownload; bool hasSampleDownload;
bool hasUserAgreement; bool hasUserAgreement;
bool isRecurring; bool isRecurring;
@ -495,7 +495,7 @@ class Product {
bool allowBackInStockSubscriptions; bool allowBackInStockSubscriptions;
dynamic orderMinimumQuantity; dynamic orderMinimumQuantity;
dynamic orderMaximumQuantity; dynamic orderMaximumQuantity;
dynamic allowedQuantities; // dynamic allowedQuantities;
bool allowAddingOnlyExistingAttributeCombinations; bool allowAddingOnlyExistingAttributeCombinations;
bool disableBuyButton; bool disableBuyButton;
bool disableWishlistButton; bool disableWishlistButton;
@ -561,9 +561,9 @@ class Product {
fullDescriptionn: json["full_descriptionn"], fullDescriptionn: json["full_descriptionn"],
markasNew: json["markas_new"], markasNew: json["markas_new"],
showOnHomePage: json["show_on_home_page"], showOnHomePage: json["show_on_home_page"],
metaKeywords: json["meta_keywords"], // metaKeywords: json["meta_keywords"],
metaDescription: json["meta_description"], // metaDescription: json["meta_description"],
metaTitle: json["meta_title"], // metaTitle: json["meta_title"],
allowCustomerReviews: json["allow_customer_reviews"], allowCustomerReviews: json["allow_customer_reviews"],
approvedRatingSum: json["approved_rating_sum"], approvedRatingSum: json["approved_rating_sum"],
notApprovedRatingSum: json["not_approved_rating_sum"], notApprovedRatingSum: json["not_approved_rating_sum"],
@ -572,17 +572,17 @@ class Product {
sku: json["sku"], sku: json["sku"],
isRx: json["is_rx"], isRx: json["is_rx"],
prescriptionRequired: json["prescription_required"], prescriptionRequired: json["prescription_required"],
rxMessage: json["rx_message"], rxMessage: json["rx_message"] != null ? json["rx_message"] : "" ,
rxMessagen: json["rx_messagen"], rxMessagen: json["rx_messagen"] != null ? json["rx_messagen"] : "",
manufacturerPartNumber: json["manufacturer_part_number"], // manufacturerPartNumber: json["manufacturer_part_number"],
gtin: json["gtin"], // gtin: json["gtin"],
isGiftCard: json["is_gift_card"], isGiftCard: json["is_gift_card"],
requireOtherProducts: json["require_other_products"], requireOtherProducts: json["require_other_products"],
automaticallyAddRequiredProducts: json["automatically_add_required_products"], automaticallyAddRequiredProducts: json["automatically_add_required_products"],
isDownload: json["is_download"], isDownload: json["is_download"],
unlimitedDownloads: json["unlimited_downloads"], unlimitedDownloads: json["unlimited_downloads"],
maxNumberOfDownloads: json["max_number_of_downloads"], maxNumberOfDownloads: json["max_number_of_downloads"],
downloadExpirationDays: json["download_expiration_days"], // downloadExpirationDays: json["download_expiration_days"],
hasSampleDownload: json["has_sample_download"], hasSampleDownload: json["has_sample_download"],
hasUserAgreement: json["has_user_agreement"], hasUserAgreement: json["has_user_agreement"],
isRecurring: json["is_recurring"], isRecurring: json["is_recurring"],
@ -608,19 +608,19 @@ class Product {
allowBackInStockSubscriptions: json["allow_back_in_stock_subscriptions"], allowBackInStockSubscriptions: json["allow_back_in_stock_subscriptions"],
orderMinimumQuantity: json["order_minimum_quantity"], orderMinimumQuantity: json["order_minimum_quantity"],
orderMaximumQuantity: json["order_maximum_quantity"], orderMaximumQuantity: json["order_maximum_quantity"],
allowedQuantities: json["allowed_quantities"], // allowedQuantities: json["allowed_quantities"],
allowAddingOnlyExistingAttributeCombinations: json["allow_adding_only_existing_attribute_combinations"], allowAddingOnlyExistingAttributeCombinations: json["allow_adding_only_existing_attribute_combinations"],
disableBuyButton: json["disable_buy_button"], disableBuyButton: json["disable_buy_button"],
disableWishlistButton: json["disable_wishlist_button"], disableWishlistButton: json["disable_wishlist_button"],
availableForPreOrder: json["available_for_pre_order"], availableForPreOrder: json["available_for_pre_order"],
preOrderAvailabilityStartDateTimeUtc: json["pre_order_availability_start_date_time_utc"], preOrderAvailabilityStartDateTimeUtc: json["pre_order_availability_start_date_time_utc"] != null ? DateTime.parse(json["pre_order_availability_start_date_time_utc"]) : DateTime.now(),
callForPrice: json["call_for_price"], callForPrice: json["call_for_price"],
price: json["price"].toDouble(), price: json["price"].toDouble(),
oldPrice: json["old_price"], oldPrice: json["old_price"],
productCost: json["product_cost"].toDouble(), productCost: json["product_cost"].toDouble(),
specialPrice: json["special_price"], specialPrice: json["special_price"] != null ? json["special_price"] : 0.0 ,
specialPriceStartDateTimeUtc: json["special_price_start_date_time_utc"], specialPriceStartDateTimeUtc: json["special_price_start_date_time_utc"] != null ? DateTime.parse(json["special_price_start_date_time_utc"]) : DateTime.now(),
specialPriceEndDateTimeUtc: json["special_price_end_date_time_utc"], specialPriceEndDateTimeUtc: json["special_price_end_date_time_utc"] != null ? DateTime.parse(json["special_price_end_date_time_utc"]) : DateTime.now(),
customerEntersPrice: json["customer_enters_price"], customerEntersPrice: json["customer_enters_price"],
minimumCustomerEnteredPrice: json["minimum_customer_entered_price"], minimumCustomerEnteredPrice: json["minimum_customer_entered_price"],
maximumCustomerEnteredPrice: json["maximum_customer_entered_price"], maximumCustomerEnteredPrice: json["maximum_customer_entered_price"],
@ -675,9 +675,9 @@ class Product {
"full_descriptionn": fullDescriptionn, "full_descriptionn": fullDescriptionn,
"markas_new": markasNew, "markas_new": markasNew,
"show_on_home_page": showOnHomePage, "show_on_home_page": showOnHomePage,
"meta_keywords": metaKeywords, // "meta_keywords": metaKeywords,
"meta_description": metaDescription, // "meta_description": metaDescription,
"meta_title": metaTitle, // "meta_title": metaTitle,
"allow_customer_reviews": allowCustomerReviews, "allow_customer_reviews": allowCustomerReviews,
"approved_rating_sum": approvedRatingSum, "approved_rating_sum": approvedRatingSum,
"not_approved_rating_sum": notApprovedRatingSum, "not_approved_rating_sum": notApprovedRatingSum,
@ -688,15 +688,15 @@ class Product {
"prescription_required": prescriptionRequired, "prescription_required": prescriptionRequired,
"rx_message": rxMessage, "rx_message": rxMessage,
"rx_messagen": rxMessagen, "rx_messagen": rxMessagen,
"manufacturer_part_number": manufacturerPartNumber, // "manufacturer_part_number": manufacturerPartNumber,
"gtin": gtin, // "gtin": gtin,
"is_gift_card": isGiftCard, "is_gift_card": isGiftCard,
"require_other_products": requireOtherProducts, "require_other_products": requireOtherProducts,
"automatically_add_required_products": automaticallyAddRequiredProducts, "automatically_add_required_products": automaticallyAddRequiredProducts,
"is_download": isDownload, "is_download": isDownload,
"unlimited_downloads": unlimitedDownloads, "unlimited_downloads": unlimitedDownloads,
"max_number_of_downloads": maxNumberOfDownloads, "max_number_of_downloads": maxNumberOfDownloads,
"download_expiration_days": downloadExpirationDays, // "download_expiration_days": downloadExpirationDays,
"has_sample_download": hasSampleDownload, "has_sample_download": hasSampleDownload,
"has_user_agreement": hasUserAgreement, "has_user_agreement": hasUserAgreement,
"is_recurring": isRecurring, "is_recurring": isRecurring,
@ -722,7 +722,7 @@ class Product {
"allow_back_in_stock_subscriptions": allowBackInStockSubscriptions, "allow_back_in_stock_subscriptions": allowBackInStockSubscriptions,
"order_minimum_quantity": orderMinimumQuantity, "order_minimum_quantity": orderMinimumQuantity,
"order_maximum_quantity": orderMaximumQuantity, "order_maximum_quantity": orderMaximumQuantity,
"allowed_quantities": allowedQuantities, // "allowed_quantities": allowedQuantities,
"allow_adding_only_existing_attribute_combinations": allowAddingOnlyExistingAttributeCombinations, "allow_adding_only_existing_attribute_combinations": allowAddingOnlyExistingAttributeCombinations,
"disable_buy_button": disableBuyButton, "disable_buy_button": disableBuyButton,
"disable_wishlist_button": disableWishlistButton, "disable_wishlist_button": disableWishlistButton,

@ -33,11 +33,15 @@ class CMCLocationPage extends StatefulWidget {
class _CMCLocationPageState extends State<CMCLocationPage> { class _CMCLocationPageState extends State<CMCLocationPage> {
double latitude = 0; double latitude = 0;
double longitude = 0; double longitude = 0;
bool showCurrentLocation = false;
@override @override
void initState() { void initState() {
latitude = widget.latitude; latitude = widget.latitude;
longitude = widget.longitude; longitude = widget.longitude;
if(latitude == 0.0 && longitude == 0.0) {
showCurrentLocation = true;
}
super.initState(); super.initState();
} }
@ -149,7 +153,7 @@ class _CMCLocationPageState extends State<CMCLocationPage> {
); );
}, },
initialPosition: LatLng(latitude, longitude), initialPosition: LatLng(latitude, longitude),
useCurrentLocation: false, useCurrentLocation: showCurrentLocation,
), ),
)); ));
} }

@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/Comprehens
import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/customer_addresses_service.dart'; import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/customer_addresses_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/cmc_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/cmc_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/uitl/location_util.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/select_location_dialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/select_location_dialog.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/location_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/location_page.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
@ -44,6 +45,7 @@ class _NewCMCStepTowPageState extends State<NewCMCStepTowPage> {
double latitude = 0; double latitude = 0;
double longitude = 0; double longitude = 0;
AddressInfo _selectedAddress; AddressInfo _selectedAddress;
bool showCurrentLocation = false;
@override @override
void initState() { void initState() {
@ -56,14 +58,26 @@ class _NewCMCStepTowPageState extends State<NewCMCStepTowPage> {
super.initState(); super.initState();
} }
setLatitudeAndLongitude({bool isSetState = false, String latLong}) { setLatitudeAndLongitude({bool isSetState = false, String latLong}) async {
if (latLong == null) if (latLong == null){
latLong = widget if(widget.model.addressesList.isEmpty) {
.model.addressesList[widget.model.addressesList.length - 1].latLong;
List latLongArr = latLong.split(',');
latitude = double.parse(latLongArr[0]); setState(() {
longitude = double.parse(latLongArr[1]); showCurrentLocation = true;
});
} else {
latLong = widget
.model.addressesList[widget.model.addressesList.length - 1].latLong;
}
}
if(!showCurrentLocation) {
List latLongArr = latLong.split(',');
latitude = double.parse(latLongArr[0]);
longitude = double.parse(latLongArr[1]);
}
} }
@override @override
@ -144,9 +158,11 @@ class _NewCMCStepTowPageState extends State<NewCMCStepTowPage> {
); );
}, },
initialPosition: LatLng(latitude, longitude), initialPosition: LatLng(latitude, longitude),
useCurrentLocation: false, useCurrentLocation: showCurrentLocation,
), ),
Container( if(widget.model.addressesList.isNotEmpty)
Container(
child: InkWell( child: InkWell(
onTap: () => onTap: () =>
confirmSelectLocationDialog(widget.model.addressesList), confirmSelectLocationDialog(widget.model.addressesList),

@ -33,12 +33,16 @@ class _LocationPageState
extends State<LocationPage> { extends State<LocationPage> {
double latitude = 0; double latitude = 0;
double longitude = 0; double longitude = 0;
bool showCurrentLocation = false;
@override @override
void initState() { void initState() {
latitude = widget.latitude; latitude = widget.latitude;
longitude = widget.longitude; longitude = widget.longitude;
if(latitude == 0.0 && longitude == 0.0) {
showCurrentLocation = true;
}
super.initState(); super.initState();
} }
@ -141,7 +145,7 @@ class _LocationPageState
); );
}, },
initialPosition: LatLng(latitude, longitude), initialPosition: LatLng(latitude, longitude),
useCurrentLocation: false, useCurrentLocation: showCurrentLocation,
), ),
)); ));
} }

@ -46,6 +46,8 @@ class _NewHomeHealthCareStepTowPageState
double latitude = 0; double latitude = 0;
double longitude = 0; double longitude = 0;
AddressInfo _selectedAddress; AddressInfo _selectedAddress;
bool showCurrentLocation = false;
@override @override
void initState() { void initState() {
@ -60,13 +62,25 @@ class _NewHomeHealthCareStepTowPageState
} }
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 if(widget.model.addressesList.isEmpty) {
.length - 1].latLong; setState(() {
List latLongArr = latLong.split(','); showCurrentLocation = true;
});
} else {
latLong = widget.model.addressesList[widget.model.addressesList
.length - 1].latLong;
}
}
if(!showCurrentLocation) {
List latLongArr = latLong.split(',');
latitude = double.parse(latLongArr[0]);
longitude = double.parse(latLongArr[1]);
}
latitude = double.parse(latLongArr[0]);
longitude = double.parse(latLongArr[1]);
} }
@override @override
@ -147,8 +161,9 @@ class _NewHomeHealthCareStepTowPageState
); );
}, },
initialPosition: LatLng(latitude, longitude), initialPosition: LatLng(latitude, longitude),
useCurrentLocation: false, useCurrentLocation: showCurrentLocation,
), ),
if(widget.model.addressesList.isNotEmpty)
Container( Container(
child: InkWell( child: InkWell(
onTap: () => onTap: () =>

@ -1,15 +1,22 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/models/Appointments/DentalChiefComplaintsModel.dart'; import 'package:diplomaticquarterapp/models/Appointments/DentalChiefComplaintsModel.dart';
import 'package:diplomaticquarterapp/models/Appointments/DentalProceduresModel.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/models/Appointments/SearchInfoModel.dart'; import 'package:diplomaticquarterapp/models/Appointments/SearchInfoModel.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DentalComplaintCard.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DentalComplaintCard.dart';
import 'package:diplomaticquarterapp/pages/livecare/widgets/clinic_card.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DoctorView.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
class DentalComplaints extends StatefulWidget { class DentalComplaints extends StatefulWidget {
SearchInfo searchInfo; SearchInfo searchInfo;
@ -24,11 +31,18 @@ class _DentalComplaintsState extends State<DentalComplaints> {
List<ListDentalChiefComplain> complaintsList = []; List<ListDentalChiefComplain> complaintsList = [];
AppSharedPreferences sharedPref = AppSharedPreferences(); AppSharedPreferences sharedPref = AppSharedPreferences();
bool isDataLoaded = false; bool isDataLoaded = false;
bool hasDentalPlan = false;
var languageID; var languageID;
int totalAppointmentTime = 0;
List<DoctorList> doctorsList = [];
DentalProceduresModel dentalProceduresModel;
List<PatientDoctorAppointmentList> patientDoctorAppointmentListHospital = List();
@override @override
void initState() { void initState() {
WidgetsBinding.instance.addPostFrameCallback((_) => getChiefComplaintsList()); WidgetsBinding.instance.addPostFrameCallback((_) => checkIfHasDentalPlan());
super.initState(); super.initState();
} }
@ -41,7 +55,7 @@ class _DentalComplaintsState extends State<DentalComplaints> {
showNewAppBarTitle: true, showNewAppBarTitle: true,
backgroundColor: CustomColors.appBackgroudGreyColor, backgroundColor: CustomColors.appBackgroudGreyColor,
body: Container( body: Container(
child: ListView.separated( child: !hasDentalPlan ? ListView.separated(
itemCount: complaintsList.length, itemCount: complaintsList.length,
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
return Container( return Container(
@ -57,15 +71,121 @@ class _DentalComplaintsState extends State<DentalComplaints> {
child: mDivider(Colors.grey), child: mDivider(Colors.grey),
); );
}, },
) : Container(
child: SingleChildScrollView(
child: Column(
children: [
Container(
margin: EdgeInsets.only(top: 10.0),
child: Text(TranslationBase.of(context).dentalProcedureList, textAlign: TextAlign.center, style: TextStyle(fontSize: 18.0, fontWeight: FontWeight.bold, letterSpacing: 0.5)),
),
Container(
margin: EdgeInsets.only(top: 20.0),
child: Table(
children: getProceduresData(),
),
),
...List.generate(
patientDoctorAppointmentListHospital.length,
(index) => AppExpandableNotifier(
isExpand: true,
title: patientDoctorAppointmentListHospital[index].filterName + " - " + patientDoctorAppointmentListHospital[index].distanceInKMs + " " + TranslationBase.of(context).km,
bodyWidget: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList.map((doctor) {
return DoctorView(
doctor: doctor,
isLiveCareAppointment: false,
);
}).toList(),
)),
)
],
),
),
), ),
), ),
); );
return tableRow;
} }
getLanguageID() async { getLanguageID() async {
languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
} }
checkIfHasDentalPlan() {
DoctorsListService service = new DoctorsListService();
GifLoaderDialogUtils.showMyDialog(context);
service.checkIfHasDentalPlan(widget.searchInfo.ProjectID, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
if (res['List_IsPatientHasOnGoingEstimation'].length != 0) {
ConfirmDialog dialog = new ConfirmDialog(
context: context,
confirmMessage: TranslationBase.of(context).continuePlan,
okText: TranslationBase.of(context).yes,
cancelText: TranslationBase.of(context).no,
okFunction: () => {Navigator.of(context).pop(), continueDentalPlan()},
cancelFunction: () => {getChiefComplaintsList()});
dialog.showAlertDialog(context);
} else {
getChiefComplaintsList();
}
}
}).catchError((err) {
print(err);
});
}
continueDentalPlan() {
DoctorsListService service = new DoctorsListService();
GifLoaderDialogUtils.showMyDialog(context);
int appoTime = 0;
service.getDoctorsList(int.parse("17"), widget.searchInfo.ProjectID, false, context, isContinueDentalPlan: true).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
print(res['List_IsPatientHasOnGoingEstimation']);
dentalProceduresModel = DentalProceduresModel.fromJson(res);
dentalProceduresModel.listIsPatientHasOnGoingEstimation.forEach((procedure) {
appoTime += procedure.neededTime;
});
setState(() {
hasDentalPlan = true;
totalAppointmentTime = appoTime;
});
if (res['DoctorList'].length != 0) {
doctorsList.clear();
res['DoctorList'].forEach((v) {
doctorsList.add(new DoctorList.fromJson(v));
});
doctorsList.forEach((element) {
List<PatientDoctorAppointmentList> doctorByHospital = patientDoctorAppointmentListHospital
.where(
(elementClinic) => elementClinic.filterName == element.projectName,
)
.toList();
if (doctorByHospital.length != 0) {
patientDoctorAppointmentListHospital[patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList.add(element);
} else {
patientDoctorAppointmentListHospital
.add(PatientDoctorAppointmentList(filterName: element.projectName, distanceInKMs: element.projectDistanceInKiloMeters.toString(), patientDoctorAppointment: element));
}
});
} else {}
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
AppToast.showErrorToast(message: err);
});
}
getChiefComplaintsList() { getChiefComplaintsList() {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
getLanguageID(); getLanguageID();
@ -73,7 +193,6 @@ class _DentalComplaintsState extends State<DentalComplaints> {
service.getChiefComplaintsList(widget.searchInfo.ClinicID, widget.searchInfo.ProjectID, context).then((res) { service.getChiefComplaintsList(widget.searchInfo.ClinicID, widget.searchInfo.ProjectID, context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
print(res['List_DentalChiefComplain']);
setState(() { setState(() {
res['List_DentalChiefComplain'].forEach((v) { res['List_DentalChiefComplain'].forEach((v) {
complaintsList.add(new ListDentalChiefComplain.fromJson(v)); complaintsList.add(new ListDentalChiefComplain.fromJson(v));

@ -1,67 +1,10 @@
import 'package:diplomaticquarterapp/models/Appointments/DoctorProfile.dart';
import 'package:diplomaticquarterapp/models/Appointments/doctor_pre_post_image.dart'; import 'package:diplomaticquarterapp/models/Appointments/doctor_pre_post_image.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class DoctorPostPreImagesPage extends StatefulWidget{ class DoctorPostPreImagesContent extends StatefulWidget {
final DoctorPrePostImages doctorPrePostImages;
const DoctorPostPreImagesPage({this.doctorPrePostImages});
@override
State<StatefulWidget> createState() => DoctorPostPreImagesPageState();
}
class DoctorPostPreImagesPageState extends State<DoctorPostPreImagesPage>{
@override
Widget build(BuildContext context) {
var images = widget.doctorPrePostImages;
return AppScaffold(
appBarTitle: TranslationBase.of(context).beforeAfterImages,
isShowAppBar: true,
isShowDecPage: false,
body: Padding(
padding: const EdgeInsets.symmetric(vertical: 20, horizontal: 10),
child: Row(
children: [
Expanded(
child: Column(
children: [
Text("Before Image", style: TextStyle(color: Colors.black, fontSize: 17, fontWeight: FontWeight.bold, letterSpacing: 1),),
Image.memory(images.getPreBytes(), errorBuilder: (ctx,err, trace){
return Container(
color: Colors.grey.withOpacity(0.25),
);
},)
],
)
),
Divider(color: Colors.grey.withOpacity(0.5)),
Expanded(
child: Column(
children: [
Text("After Image", style: TextStyle(color: Colors.black, fontSize: 17, fontWeight: FontWeight.bold, letterSpacing: 1),),
Image.memory(images.getPostBytes(),errorBuilder: (ctx,err, trace){
return Container(
color: Colors.grey.withOpacity(0.25),
);
},)
],
)
)
],
),
)
);
}
}
class DoctorPostPreImagesContent extends StatefulWidget{
final DoctorPrePostImages doctorPrePostImages; final DoctorPrePostImages doctorPrePostImages;
const DoctorPostPreImagesContent({this.doctorPrePostImages}); const DoctorPostPreImagesContent({this.doctorPrePostImages});
@ -70,14 +13,13 @@ class DoctorPostPreImagesContent extends StatefulWidget{
DoctorPostPreImagesContentState createState() => DoctorPostPreImagesContentState(); DoctorPostPreImagesContentState createState() => DoctorPostPreImagesContentState();
} }
class DoctorPostPreImagesContentState extends State<DoctorPostPreImagesContent>{ class DoctorPostPreImagesContentState extends State<DoctorPostPreImagesContent> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
var images = widget.doctorPrePostImages; var images = widget.doctorPrePostImages;
return Material( return Center(
color: Colors.transparent, child: Material(
child: Center( color: Colors.transparent,
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
@ -85,31 +27,45 @@ class DoctorPostPreImagesContentState extends State<DoctorPostPreImagesContent>{
children: [ children: [
Expanded( Expanded(
child: Column( child: Column(
children: [ children: [
Text("Before", style: TextStyle(color: Colors.white, fontSize: 17, fontWeight: FontWeight.bold, letterSpacing: 1),), Text(
SizedBox(height: 10,), "Before",
Image.memory(images.getPreBytes(), errorBuilder: (ctx,err, trace){ style: TextStyle(color: Colors.white, fontSize: 17, fontWeight: FontWeight.bold, letterSpacing: 1),
return Container( ),
color: Colors.grey.withOpacity(0.25), SizedBox(
); height: 10,
},) ),
], Image.memory(
images.getPreBytes(),
errorBuilder: (ctx, err, trace) {
return Container(
color: Colors.grey.withOpacity(0.25),
);
},
) )
), ],
)),
Divider(color: Colors.grey.withOpacity(0.5)), Divider(color: Colors.grey.withOpacity(0.5)),
Expanded( Expanded(
child: Column( child: Column(
children: [ children: [
Text("After", style: TextStyle(color: Colors.white, fontSize: 17, fontWeight: FontWeight.bold, letterSpacing: 1),), Text(
SizedBox(height: 10,), "After",
Image.memory(images.getPostBytes(),errorBuilder: (ctx,err, trace){ style: TextStyle(color: Colors.white, fontSize: 17, fontWeight: FontWeight.bold, letterSpacing: 1),
return Container( ),
color: Colors.grey.withOpacity(0.25), SizedBox(
); height: 10,
},) ),
], Image.memory(
images.getPostBytes(),
errorBuilder: (ctx, err, trace) {
return Container(
color: Colors.grey.withOpacity(0.25),
);
},
) )
) ],
))
], ],
), ),
], ],
@ -117,5 +73,4 @@ class DoctorPostPreImagesContentState extends State<DoctorPostPreImagesContent>{
), ),
); );
} }
}
}

@ -66,9 +66,9 @@ class _Login extends State<Login> {
// getDeviceToken(); // getDeviceToken();
super.initState(); super.initState();
if (BASE_URL.contains("uat.")) { if(BASE_URL.contains("uat.")){
nationalIDorFile.text = "1231755"; nationalIDorFile.text = "2001273";
mobileNumberController.text = mobileNo = "537503378"; mobileNumberController.text = mobileNo = "0555416043";
} }
} }

@ -15,7 +15,7 @@ import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:rating_bar/rating_bar.dart'; import 'package:rating_bar/rating_bar.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/recommendedProduct_model.dart';
import 'screens/cart-order-page.dart'; import 'screens/cart-order-page.dart';
int price = 0; int price = 0;
@ -28,12 +28,15 @@ String itemID;
var customerId; var customerId;
CompareList compareItems = new CompareList(); CompareList compareItems = new CompareList();
PharmacyProduct specificationData; PharmacyProduct specificationData;
//Products recommendedData;
class ProductDetailPage extends StatefulWidget { class ProductDetailPage extends StatefulWidget {
final PharmacyProduct product; final PharmacyProduct product;
// final Products recommendedProducts;
ProductDetailPage(this.product, );
ProductDetailPage(this.product);
@override @override
__ProductDetailPageState createState() => __ProductDetailPageState(); __ProductDetailPageState createState() => __ProductDetailPageState();
@ -73,6 +76,7 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
price = 1; price = 1;
specificationData = widget.product; specificationData = widget.product;
userInfo(); userInfo();
// recommendedData= widget.recommendedProducts;
super.initState(); super.initState();
} }
@ -631,10 +635,11 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
), ),
SingleChildScrollView( SingleChildScrollView(
child: Container( child: Container(
width: 410,
color: Colors.white, color: Colors.white,
child: Column( child: Column(
// crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start, // mainAxisAlignment: MainAxisAlignment.start,
// mainAxisSize: MainAxisSize.min, // mainAxisSize: MainAxisSize.min,
children: [ children: [
Container( Container(
@ -645,7 +650,7 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
// margin: EdgeInsets.symmetric(horizontal: 6, vertical: 4), // margin: EdgeInsets.symmetric(horizontal: 6, vertical: 4),
child: BaseView<PharmacyModuleViewModel>( child: BaseView<PharmacyModuleViewModel>(
onModelReady: (model) => model.getRecommendedProducts(widget.product.id.toString()), onModelReady: (model) => model.getRecommendedProducts(widget.product.id),
builder: (_, model, wi) => Container( builder: (_, model, wi) => Container(
child: child:
// Text(model.recommendedProductList[0].id), // Text(model.recommendedProductList[0].id),
@ -664,7 +669,7 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
page: ProductDetailPage(model.recommendedProductList[index]), page: ProductDetailPage(widget.product.id),
)); ));
}, },
child: Card( child: Card(
@ -694,26 +699,40 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
child: Align( child: Align(
alignment: Alignment.topRight, alignment: Alignment.topRight,
child: IconButton( child: IconButton(
icon: Icon(!isInWishlit ? Icons.favorite_border : Icons.favorite), icon: Icon(model.recommendedProductList[index]['isinwishlist'] != true ? Icons.favorite_border : Icons.favorite),
color: !isInWishlit ? Colors.grey : Colors.red, color: model.recommendedProductList[index]['isinwishlist'] != true ? Colors.grey : Colors.red,
onPressed: () async { onPressed: () async {
if (customerId != null) { if (customerId != null ) {
if (!isInWishlit) { if (!isInWishlit && model.recommendedProductList[index]['isinwishlist'] != true) {
await addToWishlistFunction(model.recommendedProductList[index].id); GifLoaderDialogUtils.showMyDialog(context);
await addToWishlistFunction(model.recommendedProductList[index]['id']);
// checkWishlist();
GifLoaderDialogUtils.hideDialog(context);
setState((){
model.recommendedProductList[index]['isinwishlist'] = true;
});
} else { } else {
await deleteFromWishlistFunction(model.recommendedProductList[index].id); GifLoaderDialogUtils.showMyDialog(context);
await deleteFromWishlistFunction(model.recommendedProductList[index]['id']);
GifLoaderDialogUtils.hideDialog(context);
setState((){
model.recommendedProductList[index]['isinwishlist'] = false;
});
} }
} else { } else {
return; return ;
} }
setState(() {}); setState(() {
// checkWishlist();
});
}, },
)), )),
// child: Align( // child: Align(
// alignment: Alignment.topRight, // alignment: Alignment.topRight,
// child:itemID.contains(model.recommendedProductList[index].id) // child:itemID.contains(model.recommendedProductList[index]['id'])
// // !isInWishlist // // !isInWishlist
// ? IconButton( // ? IconButton(
// icon: Icon(Icons.favorite_border), // icon: Icon(Icons.favorite_border),
@ -751,10 +770,10 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
alignment: alignment:
Alignment.center, Alignment.center,
// padding: EdgeInsets.only(left: 25, bottom: 20), // padding: EdgeInsets.only(left: 25, bottom: 20),
child: (model.recommendedProductList[index].images != null && child: (model.recommendedProductList[index]['images'] != null &&
model.recommendedProductList[index].images.length > 0) model.recommendedProductList[index]['images'].length > 0)
? Image.network( ? Image.network(
model.recommendedProductList[index].images[0].src.toString(), model.recommendedProductList[index]['images'][0]['src'].toString(),
// item.images[0].src, // item.images[0].src,
fit: BoxFit.cover, fit: BoxFit.cover,
height: 60, height: 60,
@ -766,7 +785,7 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
), ),
), ),
Container( Container(
width: model.recommendedProductList[index].rxMessage != width: model.recommendedProductList[index]['rx_message'] !=
null null
? MediaQuery.of(context).size.width / ? MediaQuery.of(context).size.width /
5 5
@ -782,8 +801,8 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
), ),
child: child:
Texts( Texts(
model.recommendedProductList[index].rxMessage != null model.recommendedProductList[index]['rx_message'] != null
? model.recommendedProductList[index].rxMessage ? model.recommendedProductList[index]['rx_message']
: "", : "",
color: color:
Colors.white, Colors.white,
@ -811,8 +830,8 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
Text( Text(
languageID == languageID ==
"ar" "ar"
? model.recommendedProductList[index].namen ? model.recommendedProductList[index]['namen']
: model.recommendedProductList[index].name, : model.recommendedProductList[index]['name'],
style: style:
TextStyle( TextStyle(
color: color:
@ -831,7 +850,7 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
5), 5),
child: child:
Texts( Texts(
"SAR ${model.recommendedProductList[index].price}", "SAR ${model.recommendedProductList[index]['price']}",
bold: bold:
true, true,
fontSize: fontSize:
@ -858,7 +877,7 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
child: child:
RatingBar.readOnly( RatingBar.readOnly(
initialRating: initialRating:
model.recommendedProductList[index].approvedRatingSum.toDouble(), model.recommendedProductList[index]['approved_rating_sum'].toDouble(),
// initialRating: productRate, // initialRating: productRate,
size: size:
13.0, 13.0,
@ -878,7 +897,7 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
), ),
), ),
Texts( Texts(
"(${model.recommendedProductList[index].approvedTotalReviews.toString()})", "(${model.recommendedProductList[index]['approved_total_reviews'].toString()})",
// bold: true, // bold: true,
fontSize: fontSize:
12, 12,
@ -892,7 +911,7 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
}), }),
) )
: Container( : Container(
// child: Text("NO DATA"), child: Text("There is no product"),
), ),
)), )),
), ),
@ -2092,6 +2111,7 @@ addToWishlistFunction(itemID) async {
ProductDetailViewModel x = new ProductDetailViewModel(); ProductDetailViewModel x = new ProductDetailViewModel();
isInWishlit = true; isInWishlit = true;
await x.addToWishlistData(itemID); await x.addToWishlistData(itemID);
} }
deleteFromWishlistFunction(itemID) async { deleteFromWishlistFunction(itemID) async {

File diff suppressed because it is too large Load Diff

@ -30,7 +30,7 @@ class DoctorsListService extends BaseService {
Future<Map> getDoctorsList( Future<Map> getDoctorsList(
int clinicID, int projectID, bool isNearest, BuildContext context, int clinicID, int projectID, bool isNearest, BuildContext context,
{doctorId, doctorName}) async { {doctorId, doctorName, isContinueDentalPlan = false}) async {
Map<String, dynamic> request; Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) { if (await this.sharedPref.getObject(USER_PROFILE) != null) {
@ -61,20 +61,18 @@ class DoctorsListService extends BaseService {
"ClinicID": clinicID, "ClinicID": clinicID,
"ProjectID": projectID, "ProjectID": projectID,
"DoctorName": doctorName, //!= null ? doctorId : 0, "DoctorName": doctorName, //!= null ? doctorId : 0,
"ContinueDentalPlan": false, "ContinueDentalPlan": isContinueDentalPlan,
"IsSearchAppointmnetByClinicID": true, "IsSearchAppointmnetByClinicID": isContinueDentalPlan ? false : true,
"PatientID": authUser.patientID != null ? authUser.patientID : 0, "PatientID": authUser.patientID != null ? authUser.patientID : 0,
"gender": authUser.gender != null ? authUser.gender : 0, "gender": authUser.gender != null ? authUser.gender : 0,
"age": authUser.age != null ? authUser.age : 0, "age": authUser.age != null ? authUser.age : 0,
"IsGetNearAppointment": false, "IsGetNearAppointment": false,
// "Latitude": 0,
// "Longitude": 0,
// "License": true,
"SearchForVoiceCommand": "SearchForVoiceCommand":
doctorId != null && doctorId.length > 0 ? true : false, doctorId != null && doctorId.length > 0 ? true : false,
"DoctorIDsList": doctorId, "DoctorIDsList": doctorId,
"Latitude": lat != null ? lat.toString() : 0, "Latitude": lat != null ? lat.toString() : 0,
"Longitude": long != null ? long.toString() : 0, "Longitude": long != null ? long.toString() : 0,
"isDentalAllowedBackend": isContinueDentalPlan,
"IsGetNearAppointment": isNearest, "IsGetNearAppointment": isNearest,
if (isNearest) if (isNearest)
"SelectedDate": DateUtil.convertDateToString(DateTime.now()), "SelectedDate": DateUtil.convertDateToString(DateTime.now()),
@ -1485,7 +1483,6 @@ class DoctorsListService extends BaseService {
int projectId, BuildContext context) async { int projectId, BuildContext context) async {
Map<String, dynamic> request; Map<String, dynamic> request;
Request req = appGlobal.getPublicRequest();
request = { request = {
"AppointmentNo": appointmentNo, "AppointmentNo": appointmentNo,
"NFC_Code": nfcCode, "NFC_Code": nfcCode,
@ -1500,4 +1497,21 @@ class DoctorsListService extends BaseService {
}, body: request); }, body: request);
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> checkIfHasDentalPlan(int projectID, BuildContext context) async {
Map<String, dynamic> request;
request = {
"ProjectID": projectID,
};
dynamic localRes;
await baseAppClient.post(HAS_DENTAL_PLAN,
onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
return Future.value(localRes);
}
} }

@ -16,24 +16,25 @@ class RecommendedProductService extends BaseService{
AuthenticatedUser authUser = new AuthenticatedUser(); AuthenticatedUser authUser = new AuthenticatedUser();
AuthProvider authProvider = new AuthProvider(); AuthProvider authProvider = new AuthProvider();
List<PharmacyProduct> _recommendedProductList = List(); List<Map<String, dynamic>> _recommendedProductList = List();
List<PharmacyProduct> get recommendedList => _recommendedProductList; List<Map<String, Object>> get recommendedList => _recommendedProductList;
String url ="";
Future getRecommendedProducts(productId) async { Future getRecommendedProducts(productId) async {
var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID);
hasError = false; hasError = false;
url =GET_RECOMMENDED_PRODUCT+productId;
await baseAppClient.getPharmacy(url, await baseAppClient.getPharmacy(GET_RECOMMENDED_PRODUCT+"$productId/$customerId",
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
_recommendedProductList.clear(); _recommendedProductList.clear();
response['products'].forEach((item) { response['products'].forEach((item) {
_recommendedProductList.add(PharmacyProduct.fromJson(item)); _recommendedProductList.add(item);
print("----------------------------------");
print("Test data");
print(_recommendedProductList[0]);
print(item['name']);
print(response);
}); });
print("---------------------Recommended Product List------------------------");
print(_recommendedProductList.length);
//print(item['name']);
print(response);
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;

@ -2135,7 +2135,10 @@ class TranslationBase {
String get passportNumber => localizedValues["passport-number"][locale.languageCode]; String get passportNumber => localizedValues["passport-number"][locale.languageCode];
String get enterPassportNumber => localizedValues["enter-passport-number"][locale.languageCode]; String get enterPassportNumber => localizedValues["enter-passport-number"][locale.languageCode];
String get validPassportNumber => localizedValues["valid-passport-number"][locale.languageCode]; String get validPassportNumber => localizedValues["valid-passport-number"][locale.languageCode];
String get continuePlan => localizedValues["continue-plan"][locale.languageCode];
String get dentalProcedureList => localizedValues["dental-procedure-list"][locale.languageCode];
String get timeNeeded => localizedValues["time-needed"][locale.languageCode];
String get totalTimeNeeded => localizedValues["total-time-needed"][locale.languageCode];
} }
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> { class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

Loading…
Cancel
Save