diff --git a/assets/images/pharmacy/empty_box.svg b/assets/images/pharmacy/empty_box.svg
new file mode 100644
index 00000000..05816608
--- /dev/null
+++ b/assets/images/pharmacy/empty_box.svg
@@ -0,0 +1,18 @@
+
diff --git a/lib/config/config.dart b/lib/config/config.dart
index 9e64d9cb..e7341682 100644
--- a/lib/config/config.dart
+++ b/lib/config/config.dart
@@ -340,14 +340,6 @@ const GET_E_REFERRALS = "Services/Patients.svc/REST/GetEReferrals";
//Pharmacy wishlist
// const GET_WISHLIST = "http://swd-pharapp-01:7200/api/shopping_cart_items/";
-//Pharmacy address
-const GET_ADDRESS =
- "https://uat.hmgwebservices.com/epharmacy/api/Customers/272843?fields=addresses";
-//order + order details 'orders?customer=1,fields=id,order_total,order_status,order_statusn,order_status_id,created_on_utc&page=' + page_id + '&limit=200&customer_id='+ custmerId,
-const GET_ORDER =
- "https://uat.hmgwebservices.com/epharmacy/api/orders?customer=1,fields=id,order_total,order_status,order_statusn,order_status_id,created_on_utc&page=1&limit=200&customer_id=1367368";
-const GET_ORDER_DETAILS =
- "https://uat.hmgwebservices.com/epharmacy/api/orders/3584";
// pharmacy
const GET_PHARMACY_BANNER = "epharmacy/api/promotionbanners";
const GET_PHARMACY_TOP_MANUFACTURER = "epharmacy/api/topmanufacturer";
@@ -355,7 +347,9 @@ const GET_PHARMACY_BEST_SELLER_PRODUCT = "epharmacy/api/bestsellerproducts";
const GET_PHARMACY_PRODUCTs_BY_IDS = "epharmacy/api/productsbyids/";
const GET_CUSTOMERS_ADDRESSES = "epharmacy/api/Customers/";
const GET_WISHLIST = "epharmacy/api/shopping_cart_items/";
-
+const GET_ORDER = "orders?";
+const GET_ORDER_DETAILS ="epharmacy/api/orders/";
+const GET_ADDRESS ="epharmacy/api/Customers/272843?fields=addresses";
// Home Health Care
const HHC_GET_ALL_SERVICES =
"Services/Patients.svc/REST/PatientER_HHC_GetAllServices";
diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart
index 437bab38..c2a81962 100644
--- a/lib/config/localized_values.dart
+++ b/lib/config/localized_values.dart
@@ -677,6 +677,10 @@ const Map> localizedValues = {
"en": "Are you sure! want to cancel this order ",
"ar": "هل انت متأكد تريد حذف هذا المنتج "
},
+ "orderNumber": {"en": "Order#: ", "ar": "الطلب: "},
+ "orderDate": {"en": "Date", "ar": "التاريخ:"},
+ "itemsNo": {"en": "items(s)", "ar": "عناصر"},
+ "noOrder": {"en": "You Don't have any orders.", "ar": "ليس لديك طلبات"},
"TermsService": {"en": "Terms of Service", "ar": "شروط الخدمه"},
"Beforeusing": {
diff --git a/lib/core/model/pharmacies/PharmacyAddressesModel.dart b/lib/core/model/pharmacies/PharmacyAddressesModel.dart
new file mode 100644
index 00000000..db9c20ae
--- /dev/null
+++ b/lib/core/model/pharmacies/PharmacyAddressesModel.dart
@@ -0,0 +1,170 @@
+
+import 'dart:convert';
+
+PharmacyAddressesModel pharmacyAddressesModelFromJson(String str) => PharmacyAddressesModel.fromJson(json.decode(str));
+
+String pharmacyAddressesModelToJson(PharmacyAddressesModel data) => json.encode(data.toJson());
+
+class PharmacyAddressesModel {
+ PharmacyAddressesModel({
+ this.customers,
+ });
+
+ List customers;
+
+ factory PharmacyAddressesModel.fromJson(Map json) => PharmacyAddressesModel(
+ customers: List.from(json["customers"].map((x) => Customer.fromJson(x))),
+ );
+
+ Map toJson() => {
+ "customers": List.from(customers.map((x) => x.toJson())),
+ };
+}
+
+class Customer {
+ Customer({
+ this.addresses,
+ });
+
+ List addresses;
+
+ factory Customer.fromJson(Map json) => Customer(
+ addresses: List.from(json["addresses"].map((x) => Address.fromJson(x))),
+ );
+
+ Map toJson() => {
+ "addresses": List.from(addresses.map((x) => x.toJson())),
+ };
+}
+
+class Address {
+ Address({
+ this.id,
+ this.firstName,
+ this.lastName,
+ this.email,
+ this.company,
+ this.countryId,
+ this.country,
+ this.stateProvinceId,
+ this.city,
+ this.address1,
+ this.address2,
+ this.zipPostalCode,
+ this.phoneNumber,
+ this.faxNumber,
+ this.customerAttributes,
+ this.createdOnUtc,
+ this.province,
+ this.latLong,
+ });
+
+ String id;
+ FirstName firstName;
+ LastName lastName;
+ Email email;
+ dynamic company;
+ int countryId;
+ Country country;
+ dynamic stateProvinceId;
+ City city;
+ String address1;
+ String address2;
+ String zipPostalCode;
+ String phoneNumber;
+ dynamic faxNumber;
+ String customerAttributes;
+ DateTime createdOnUtc;
+ dynamic province;
+ String latLong;
+
+ factory Address.fromJson(Map json) => Address(
+ id: json["id"],
+ firstName: firstNameValues.map[json["first_name"]],
+ lastName: lastNameValues.map[json["last_name"]],
+ email: emailValues.map[json["email"]],
+ company: json["company"],
+ countryId: json["country_id"],
+ country: countryValues.map[json["country"]],
+ stateProvinceId: json["state_province_id"],
+ city: cityValues.map[json["city"]],
+ address1: json["address1"],
+ address2: json["address2"],
+ zipPostalCode: json["zip_postal_code"],
+ phoneNumber: json["phone_number"],
+ faxNumber: json["fax_number"],
+ customerAttributes: json["customer_attributes"],
+ createdOnUtc: DateTime.parse(json["created_on_utc"]),
+ province: json["province"],
+ latLong: json["lat_long"],
+ );
+
+ Map toJson() => {
+ "id": id,
+ "first_name": firstNameValues.reverse[firstName],
+ "last_name": lastNameValues.reverse[lastName],
+ "email": emailValues.reverse[email],
+ "company": company,
+ "country_id": countryId,
+ "country": countryValues.reverse[country],
+ "state_province_id": stateProvinceId,
+ "city": cityValues.reverse[city],
+ "address1": address1,
+ "address2": address2,
+ "zip_postal_code": zipPostalCode,
+ "phone_number": phoneNumber,
+ "fax_number": faxNumber,
+ "customer_attributes": customerAttributes,
+ "created_on_utc": createdOnUtc.toIso8601String(),
+ "province": province,
+ "lat_long": latLong,
+ };
+}
+
+enum City { RIYADH, AL_OYUN }
+
+final cityValues = EnumValues({
+ "Al Oyun": City.AL_OYUN,
+ "Riyadh": City.RIYADH
+});
+
+enum Country { SAUDI_ARABIA }
+
+final countryValues = EnumValues({
+ "Saudi Arabia": Country.SAUDI_ARABIA
+});
+
+enum Email { TAMER_FANASHEH_GMAIL_COM, TAMER_DASDASDAS_GMAIL_COM }
+
+final emailValues = EnumValues({
+ "Tamer.dasdasdas@gmail.com": Email.TAMER_DASDASDAS_GMAIL_COM,
+ "Tamer.fanasheh@gmail.com": Email.TAMER_FANASHEH_GMAIL_COM
+});
+
+enum FirstName { TAMER, TAMER_FANASHEH }
+
+final firstNameValues = EnumValues({
+ "TAMER": FirstName.TAMER,
+ "TAMER FANASHEH": FirstName.TAMER_FANASHEH
+});
+
+enum LastName { FANASHEH, MUSA }
+
+final lastNameValues = EnumValues({
+ "FANASHEH": LastName.FANASHEH,
+ "MUSA": LastName.MUSA
+});
+
+class EnumValues {
+ Map map;
+ Map reverseMap;
+
+ EnumValues(this.map);
+
+ Map get reverse {
+ if (reverseMap == null) {
+ reverseMap = map.map((k, v) => new MapEntry(v, k));
+ }
+ return reverseMap;
+ }
+}
diff --git a/lib/core/model/pharmacies/order_model.dart b/lib/core/model/pharmacies/order_model.dart
new file mode 100644
index 00000000..a82b8716
--- /dev/null
+++ b/lib/core/model/pharmacies/order_model.dart
@@ -0,0 +1,1486 @@
+
+import 'dart:convert';
+
+List orderModelFromJson(String str) => List.from(json.decode(str).map((x) => OrderModel.fromJson(x)));
+
+String orderModelToJson(List data) => json.encode(List.from(data.map((x) => x.toJson())));
+
+class OrderModel {
+ OrderModel({
+ this.id,
+ this.storeId,
+ this.orderGuid,
+ this.pickUpInStore,
+ this.paymentMethodSystemName,
+ this.paymentName,
+ this.paymentNamen,
+ this.customerCurrencyCode,
+ this.currencyRate,
+ this.customerTaxDisplayTypeId,
+ this.vatNumber,
+ this.orderSubtotalInclTax,
+ this.orderSubtotalExclTax,
+ this.orderSubTotalDiscountInclTax,
+ this.orderSubTotalDiscountExclTax,
+ this.orderShippingInclTax,
+ this.orderShippingExclTax,
+ this.paymentMethodAdditionalFeeInclTax,
+ this.paymentMethodAdditionalFeeExclTax,
+ this.taxRates,
+ this.orderTax,
+ this.orderDiscount,
+ this.orderTotal,
+ this.refundedAmount,
+ this.rewardPointsWereAdded,
+ this.rxAttachments,
+ this.checkoutAttributeDescription,
+ this.customerLanguageId,
+ this.affiliateId,
+ this.customerIp,
+ this.authorizationTransactionId,
+ this.authorizationTransactionCode,
+ this.authorizationTransactionResult,
+ this.captureTransactionId,
+ this.captureTransactionResult,
+ this.subscriptionTransactionId,
+ this.paidDateUtc,
+ this.shippingMethod,
+ this.shippingRateComputationMethodSystemName,
+ this.customValuesXml,
+ this.deleted,
+ this.createdOnUtc,
+ this.customer,
+ this.customerId,
+ this.billingAddress,
+ this.shippingAddress,
+ this.orderItems,
+ this.orderStatusId,
+ this.orderStatus,
+ this.orderStatusn,
+ this.paymentStatusId,
+ this.paymentStatus,
+ this.paymentStatusn,
+ this.shippingStatus,
+ this.shippingStatusn,
+ this.customerTaxDisplayType,
+ this.canCancel,
+ this.canRefund,
+ this.lakumAmount,
+ this.preferDeliveryDate,
+ this.preferDeliveryTime,
+ this.preferDeliveryTimen,
+ });
+
+ String id;
+ dynamic storeId;
+ String orderGuid;
+ bool pickUpInStore;
+ PaymentMethodSystemName paymentMethodSystemName;
+ PaymentName paymentName;
+ PaymentName paymentNamen;
+ CustomerCurrencyCode customerCurrencyCode;
+ dynamic currencyRate;
+ dynamic customerTaxDisplayTypeId;
+ dynamic vatNumber;
+ double orderSubtotalInclTax;
+ double orderSubtotalExclTax;
+ dynamic orderSubTotalDiscountInclTax;
+ dynamic orderSubTotalDiscountExclTax;
+ double orderShippingInclTax;
+ dynamic orderShippingExclTax;
+ dynamic paymentMethodAdditionalFeeInclTax;
+ dynamic paymentMethodAdditionalFeeExclTax;
+ String taxRates;
+ double orderTax;
+ dynamic orderDiscount;
+ double orderTotal;
+ dynamic refundedAmount;
+ dynamic rewardPointsWereAdded;
+ String rxAttachments;
+ CheckoutAttributeDescription checkoutAttributeDescription;
+ dynamic customerLanguageId;
+ dynamic affiliateId;
+ CustomerIp customerIp;
+ String authorizationTransactionId;
+ dynamic authorizationTransactionCode;
+ dynamic authorizationTransactionResult;
+ dynamic captureTransactionId;
+ dynamic captureTransactionResult;
+ dynamic subscriptionTransactionId;
+ DateTime paidDateUtc;
+ ShippingMethod shippingMethod;
+ ShippingRateComputationMethodSystemName shippingRateComputationMethodSystemName;
+ String customValuesXml;
+ bool deleted;
+ DateTime createdOnUtc;
+ OrderModelCustomer customer;
+ dynamic customerId;
+ IngAddress billingAddress;
+ IngAddress shippingAddress;
+ List orderItems;
+ dynamic orderStatusId;
+ OrderStatus orderStatus;
+ OrderStatusn orderStatusn;
+ dynamic paymentStatusId;
+ PaymentStatus paymentStatus;
+ PaymentStatusn paymentStatusn;
+ ShippingStatus shippingStatus;
+ ShippingStatusn shippingStatusn;
+ CustomerTaxDisplayType customerTaxDisplayType;
+ bool canCancel;
+ bool canRefund;
+ dynamic lakumAmount;
+ DateTime preferDeliveryDate;
+ PreferDeliveryTime preferDeliveryTime;
+ PreferDeliveryTimen preferDeliveryTimen;
+
+ factory OrderModel.fromJson(Map json) => OrderModel(
+ id: json["id"],
+ storeId: json["store_id"],
+ orderGuid: json["order_guid"],
+ pickUpInStore: json["pick_up_in_store"],
+ paymentMethodSystemName: paymentMethodSystemNameValues.map[json["payment_method_system_name"]],
+ paymentName: paymentNameValues.map[json["payment_name"]],
+ paymentNamen: paymentNameValues.map[json["payment_namen"]],
+ customerCurrencyCode: customerCurrencyCodeValues.map[json["customer_currency_code"]],
+ currencyRate: json["currency_rate"],
+ customerTaxDisplayTypeId: json["customer_tax_display_type_id"],
+ vatNumber: json["vat_number"],
+ orderSubtotalInclTax: json["order_subtotal_incl_tax"].toDouble(),
+ orderSubtotalExclTax: json["order_subtotal_excl_tax"].toDouble(),
+ orderSubTotalDiscountInclTax: json["order_sub_total_discount_incl_tax"],
+ orderSubTotalDiscountExclTax: json["order_sub_total_discount_excl_tax"],
+ orderShippingInclTax: json["order_shipping_incl_tax"].toDouble(),
+ orderShippingExclTax: json["order_shipping_excl_tax"],
+ paymentMethodAdditionalFeeInclTax: json["payment_method_additional_fee_incl_tax"],
+ paymentMethodAdditionalFeeExclTax: json["payment_method_additional_fee_excl_tax"],
+ taxRates: json["tax_rates"],
+ orderTax: json["order_tax"].toDouble(),
+ orderDiscount: json["order_discount"],
+ orderTotal: json["order_total"].toDouble(),
+ refundedAmount: json["refunded_amount"],
+ rewardPointsWereAdded: json["reward_points_were_added"],
+ rxAttachments: json["rx_attachments"] == null ? null : json["rx_attachments"],
+ checkoutAttributeDescription: checkoutAttributeDescriptionValues.map[json["checkout_attribute_description"]],
+ customerLanguageId: json["customer_language_id"],
+ affiliateId: json["affiliate_id"],
+ customerIp: customerIpValues.map[json["customer_ip"]],
+ authorizationTransactionId: json["authorization_transaction_id"] == null ? null : json["authorization_transaction_id"],
+ authorizationTransactionCode: json["authorization_transaction_code"],
+ authorizationTransactionResult: json["authorization_transaction_result"],
+ captureTransactionId: json["capture_transaction_id"],
+ captureTransactionResult: json["capture_transaction_result"],
+ subscriptionTransactionId: json["subscription_transaction_id"],
+ paidDateUtc: json["paid_date_utc"] == null ? null : DateTime.parse(json["paid_date_utc"]),
+ shippingMethod: shippingMethodValues.map[json["shipping_method"]],
+ shippingRateComputationMethodSystemName: shippingRateComputationMethodSystemNameValues.map[json["shipping_rate_computation_method_system_name"]],
+ customValuesXml: json["custom_values_xml"],
+ deleted: json["deleted"],
+ createdOnUtc: DateTime.parse(json["created_on_utc"]),
+ customer: OrderModelCustomer.fromJson(json["customer"]),
+ customerId: json["customer_id"],
+ billingAddress: IngAddress.fromJson(json["billing_address"]),
+ shippingAddress: IngAddress.fromJson(json["shipping_address"]),
+ orderItems: List.from(json["order_items"].map((x) => OrderItem.fromJson(x))),
+ orderStatusId: json["order_status_id"],
+ orderStatus: orderStatusValues.map[json["order_status"]],
+ orderStatusn: orderStatusnValues.map[json["order_statusn"]],
+ paymentStatusId: json["payment_status_id"],
+ paymentStatus: paymentStatusValues.map[json["payment_status"]],
+ paymentStatusn: paymentStatusnValues.map[json["payment_statusn"]],
+ shippingStatus: shippingStatusValues.map[json["shipping_status"]],
+ shippingStatusn: shippingStatusnValues.map[json["shipping_statusn"]],
+ customerTaxDisplayType: customerTaxDisplayTypeValues.map[json["customer_tax_display_type"]],
+ canCancel: json["can_cancel"],
+ canRefund: json["can_refund"],
+ lakumAmount: json["lakum_amount"],
+ preferDeliveryDate: json["prefer_delivery_date"] == null ? null : DateTime.parse(json["prefer_delivery_date"]),
+ preferDeliveryTime: json["prefer_delivery_time"] == null ? null : preferDeliveryTimeValues.map[json["prefer_delivery_time"]],
+ preferDeliveryTimen: json["prefer_delivery_timen"] == null ? null : preferDeliveryTimenValues.map[json["prefer_delivery_timen"]],
+ );
+
+ Map toJson() => {
+ "id": id,
+ "store_id": storeId,
+ "order_guid": orderGuid,
+ "pick_up_in_store": pickUpInStore,
+ "payment_method_system_name": paymentMethodSystemNameValues.reverse[paymentMethodSystemName],
+ "payment_name": paymentNameValues.reverse[paymentName],
+ "payment_namen": paymentNameValues.reverse[paymentNamen],
+ "customer_currency_code": customerCurrencyCodeValues.reverse[customerCurrencyCode],
+ "currency_rate": currencyRate,
+ "customer_tax_display_type_id": customerTaxDisplayTypeId,
+ "vat_number": vatNumber,
+ "order_subtotal_incl_tax": orderSubtotalInclTax,
+ "order_subtotal_excl_tax": orderSubtotalExclTax,
+ "order_sub_total_discount_incl_tax": orderSubTotalDiscountInclTax,
+ "order_sub_total_discount_excl_tax": orderSubTotalDiscountExclTax,
+ "order_shipping_incl_tax": orderShippingInclTax,
+ "order_shipping_excl_tax": orderShippingExclTax,
+ "payment_method_additional_fee_incl_tax": paymentMethodAdditionalFeeInclTax,
+ "payment_method_additional_fee_excl_tax": paymentMethodAdditionalFeeExclTax,
+ "tax_rates": taxRates,
+ "order_tax": orderTax,
+ "order_discount": orderDiscount,
+ "order_total": orderTotal,
+ "refunded_amount": refundedAmount,
+ "reward_points_were_added": rewardPointsWereAdded,
+ "rx_attachments": rxAttachments == null ? null : rxAttachments,
+ "checkout_attribute_description": checkoutAttributeDescriptionValues.reverse[checkoutAttributeDescription],
+ "customer_language_id": customerLanguageId,
+ "affiliate_id": affiliateId,
+ "customer_ip": customerIpValues.reverse[customerIp],
+ "authorization_transaction_id": authorizationTransactionId == null ? null : authorizationTransactionId,
+ "authorization_transaction_code": authorizationTransactionCode,
+ "authorization_transaction_result": authorizationTransactionResult,
+ "capture_transaction_id": captureTransactionId,
+ "capture_transaction_result": captureTransactionResult,
+ "subscription_transaction_id": subscriptionTransactionId,
+ "paid_date_utc": paidDateUtc == null ? null : paidDateUtc.toIso8601String(),
+ "shipping_method": shippingMethodValues.reverse[shippingMethod],
+ "shipping_rate_computation_method_system_name": shippingRateComputationMethodSystemNameValues.reverse[shippingRateComputationMethodSystemName],
+ "custom_values_xml": customValuesXml,
+ "deleted": deleted,
+ "created_on_utc": createdOnUtc.toIso8601String(),
+ "customer": customer.toJson(),
+ "customer_id": customerId,
+ "billing_address": billingAddress.toJson(),
+ "shipping_address": shippingAddress.toJson(),
+ "order_items": List.from(orderItems.map((x) => x.toJson())),
+ "order_status_id": orderStatusId,
+ "order_status": orderStatusValues.reverse[orderStatus],
+ "order_statusn": orderStatusnValues.reverse[orderStatusn],
+ "payment_status_id": paymentStatusId,
+ "payment_status": paymentStatusValues.reverse[paymentStatus],
+ "payment_statusn": paymentStatusnValues.reverse[paymentStatusn],
+ "shipping_status": shippingStatusValues.reverse[shippingStatus],
+ "shipping_statusn": shippingStatusnValues.reverse[shippingStatusn],
+ "customer_tax_display_type": customerTaxDisplayTypeValues.reverse[customerTaxDisplayType],
+ "can_cancel": canCancel,
+ "can_refund": canRefund,
+ "lakum_amount": lakumAmount,
+ "prefer_delivery_date": preferDeliveryDate == null ? null : "${preferDeliveryDate.year.toString().padLeft(4, '0')}-${preferDeliveryDate.month.toString().padLeft(2, '0')}-${preferDeliveryDate.day.toString().padLeft(2, '0')}",
+ "prefer_delivery_time": preferDeliveryTime == null ? null : preferDeliveryTimeValues.reverse[preferDeliveryTime],
+ "prefer_delivery_timen": preferDeliveryTimen == null ? null : preferDeliveryTimenValues.reverse[preferDeliveryTimen],
+ };
+}
+
+class IngAddress {
+ IngAddress({
+ this.id,
+ this.firstName,
+ this.lastName,
+ this.email,
+ this.company,
+ this.countryId,
+ this.country,
+ this.stateProvinceId,
+ this.city,
+ this.address1,
+ this.address2,
+ this.zipPostalCode,
+ this.phoneNumber,
+ this.faxNumber,
+ this.customerAttributes,
+ this.createdOnUtc,
+ this.province,
+ this.latLong,
+ });
+
+ String id;
+ FirstName firstName;
+ LastName lastName;
+ BillingAddressEmail email;
+ dynamic company;
+ dynamic countryId;
+ Country country;
+ dynamic stateProvinceId;
+ City city;
+ Address1 address1;
+ Address2 address2;
+ String zipPostalCode;
+ String phoneNumber;
+ dynamic faxNumber;
+ String customerAttributes;
+ DateTime createdOnUtc;
+ dynamic province;
+ LatLong latLong;
+
+ factory IngAddress.fromJson(Map json) => IngAddress(
+ id: json["id"],
+ firstName: firstNameValues.map[json["first_name"]],
+ lastName: lastNameValues.map[json["last_name"]],
+ email: billingAddressEmailValues.map[json["email"]],
+ company: json["company"],
+ countryId: json["country_id"],
+ country: countryValues.map[json["country"]],
+ stateProvinceId: json["state_province_id"],
+ city: cityValues.map[json["city"]],
+ address1: address1Values.map[json["address1"]],
+ address2: address2Values.map[json["address2"]],
+ zipPostalCode: json["zip_postal_code"],
+ phoneNumber: json["phone_number"],
+ faxNumber: json["fax_number"],
+ customerAttributes: json["customer_attributes"],
+ createdOnUtc: DateTime.parse(json["created_on_utc"]),
+ province: json["province"],
+ latLong: latLongValues.map[json["lat_long"]],
+ );
+
+ Map toJson() => {
+ "id": id,
+ "first_name": firstNameValues.reverse[firstName],
+ "last_name": lastNameValues.reverse[lastName],
+ "email": billingAddressEmailValues.reverse[email],
+ "company": company,
+ "country_id": countryId,
+ "country": countryValues.reverse[country],
+ "state_province_id": stateProvinceId,
+ "city": cityValues.reverse[city],
+ "address1": address1Values.reverse[address1],
+ "address2": address2Values.reverse[address2],
+ "zip_postal_code": zipPostalCode,
+ "phone_number": phoneNumber,
+ "fax_number": faxNumber,
+ "customer_attributes": customerAttributes,
+ "created_on_utc": createdOnUtc.toIso8601String(),
+ "province": province,
+ "lat_long": latLongValues.reverse[latLong],
+ };
+}
+
+enum Address1 { THE_7960_MOSAB_IBN_UMAIR_STREET_AL_RIYADH, THE_6500_AL_AMEEN_ABDULLAH_AL_ALI_AL_NAEEM_STREET_AL_RIYADH, THE_6603_IBRAHIM_IBN_AL_HAMASI_AR_RIYAD, THE_9626_SALAH_AD_DIN_AL_AYYUBI_ROAD_AL_RIYADH, THE_3075_PRINCE_MANSUR_BIN_ABDULAZIZ_STREET_AL_RIYADH, THE_40, THE_7801_AL_IHSA_AL_RIYADH }
+
+final address1Values = EnumValues({
+ "3075, Prince Mansur Bin Abdulaziz Street, Al Riyadh, ": Address1.THE_3075_PRINCE_MANSUR_BIN_ABDULAZIZ_STREET_AL_RIYADH,
+ "40,": Address1.THE_40,
+ "6500, Al Ameen Abdullah Al Ali Al Naeem Street, Al Riyadh, ": Address1.THE_6500_AL_AMEEN_ABDULLAH_AL_ALI_AL_NAEEM_STREET_AL_RIYADH,
+ "6603, Ibrahim Ibn Al Hamasi, Ar-Riyad, ": Address1.THE_6603_IBRAHIM_IBN_AL_HAMASI_AR_RIYAD,
+ "7801, Al Ihsa, Al Riyadh, ": Address1.THE_7801_AL_IHSA_AL_RIYADH,
+ "7960, Mosab Ibn Umair Street, Al Riyadh, ": Address1.THE_7960_MOSAB_IBN_UMAIR_STREET_AL_RIYADH,
+ "9626, Salah Ad Din Al Ayyubi Road, Al Riyadh, ": Address1.THE_9626_SALAH_AD_DIN_AL_AYYUBI_ROAD_AL_RIYADH
+});
+
+enum Address2 { AL_MALAZ_RIYADH_PROVINCE_3460, AL_MALAZ_RIYADH_PROVINCE_2817, AR_RAHMANIYYAH_RIYADH_PROVINCE_3816, AL_MALAZ_RIYADH_PROVINCE_3815, AL_WIZARAT_RIYADH_PROVINCE_7039, EASTERN_PROVINCE, AL_MALAZ_RIYADH_PROVINCE_3084 }
+
+final address2Values = EnumValues({
+ "Al Malaz, Riyadh Province, 2817, ": Address2.AL_MALAZ_RIYADH_PROVINCE_2817,
+ "Al Malaz, Riyadh Province, 3084, ": Address2.AL_MALAZ_RIYADH_PROVINCE_3084,
+ "Al Malaz, Riyadh Province, 3460, ": Address2.AL_MALAZ_RIYADH_PROVINCE_3460,
+ "Al Malaz, Riyadh Province, 3815, ": Address2.AL_MALAZ_RIYADH_PROVINCE_3815,
+ "Al Wizarat, Riyadh Province, 7039, ": Address2.AL_WIZARAT_RIYADH_PROVINCE_7039,
+ "Ar Rahmaniyyah, Riyadh Province, 3816, ": Address2.AR_RAHMANIYYAH_RIYADH_PROVINCE_3816,
+ "Eastern Province,": Address2.EASTERN_PROVINCE
+});
+
+enum City { RIYADH, DAMMAM }
+
+final cityValues = EnumValues({
+ "Dammam": City.DAMMAM,
+ "Riyadh": City.RIYADH
+});
+
+enum Country { SAUDI_ARABIA }
+
+final countryValues = EnumValues({
+ "Saudi Arabia": Country.SAUDI_ARABIA
+});
+
+enum BillingAddressEmail { TAMER_FANASHEH_GMAIL_COM, TAMER_DASDASDAS_GMAIL_COM, TAMER_FANASHEH_DRSULAIMANALHABIB_COM }
+
+final billingAddressEmailValues = EnumValues({
+ "Tamer.dasdasdas@gmail.com": BillingAddressEmail.TAMER_DASDASDAS_GMAIL_COM,
+ "tamer.fanasheh@drsulaimanalhabib.com": BillingAddressEmail.TAMER_FANASHEH_DRSULAIMANALHABIB_COM,
+ "Tamer.fanasheh@gmail.com": BillingAddressEmail.TAMER_FANASHEH_GMAIL_COM
+});
+
+enum FirstName { TAMER, TAMER_FANASHEH, FIRST_NAME_TAMER }
+
+final firstNameValues = EnumValues({
+ "tamer": FirstName.FIRST_NAME_TAMER,
+ "TAMER": FirstName.TAMER,
+ "TAMER FANASHEH": FirstName.TAMER_FANASHEH
+});
+
+enum LastName { FANASHEH, MUSA, LAST_NAME_FANASHEH }
+
+final lastNameValues = EnumValues({
+ "FANASHEH": LastName.FANASHEH,
+ "Fanasheh": LastName.LAST_NAME_FANASHEH,
+ "MUSA": LastName.MUSA
+});
+
+enum LatLong { THE_246784385694919524674091019299842, THE_24664749106968054673501121876645, THE_2470993657522702246664724647270134, THE_246626170308533764673348444086107, THE_24664875225999005467347443322574, THE_24674331807435784671024726818286, THE_263430228396836664991113909164471, THE_246767400793488074673774399406786, THE_24665374673515 }
+
+final latLongValues = EnumValues({
+ "24.662617030853376,46.73348444086107": LatLong.THE_246626170308533764673348444086107,
+ "24.66474910696805,46.73501121876645": LatLong.THE_24664749106968054673501121876645,
+ "24.664875225999005,46.7347443322574": LatLong.THE_24664875225999005467347443322574,
+ "24.66537,46.73515": LatLong.THE_24665374673515,
+ "24.67433180743578,46.71024726818286": LatLong.THE_24674331807435784671024726818286,
+ "24.676740079348807,46.73774399406786": LatLong.THE_246767400793488074673774399406786,
+ "24.678438569491952,46.74091019299842": LatLong.THE_246784385694919524674091019299842,
+ "24.709936575227022,46.664724647270134": LatLong.THE_2470993657522702246664724647270134,
+ "26.343022839683666, 49.91113909164471": LatLong.THE_263430228396836664991113909164471
+});
+
+enum CheckoutAttributeDescription { EMPTY, CHECKOUT_ATTRIBUTE_DESCRIPTION }
+
+final checkoutAttributeDescriptionValues = EnumValues({
+ "ارفاق وصفة: ": CheckoutAttributeDescription.CHECKOUT_ATTRIBUTE_DESCRIPTION,
+ "": CheckoutAttributeDescription.EMPTY
+});
+
+class OrderModelCustomer {
+ OrderModelCustomer({
+ 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,
+ });
+
+ String id;
+ Username username;
+ BillingAddressEmail email;
+ FirstName firstName;
+ LastName lastName;
+ String languageId;
+ dynamic adminComment;
+ bool isTaxExempt;
+ bool hasShoppingCartItems;
+ bool active;
+ bool deleted;
+ bool isSystemAccount;
+ dynamic systemName;
+ LastIpAddress lastIpAddress;
+ DateTime createdOnUtc;
+ DateTime lastLoginDateUtc;
+ DateTime lastActivityDateUtc;
+ dynamic registeredInStoreId;
+ List roleIds;
+
+ factory OrderModelCustomer.fromJson(Map json) => OrderModelCustomer(
+ id: json["id"],
+ username: usernameValues.map[json["username"]],
+ email: billingAddressEmailValues.map[json["email"]],
+ firstName: firstNameValues.map[json["first_name"]],
+ lastName: lastNameValues.map[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: lastIpAddressValues.map[json["last_ip_address"]],
+ createdOnUtc: DateTime.parse(json["created_on_utc"]),
+ lastLoginDateUtc: DateTime.parse(json["last_login_date_utc"]),
+ lastActivityDateUtc: DateTime.parse(json["last_activity_date_utc"]),
+ registeredInStoreId: json["registered_in_store_id"],
+ roleIds: List.from(json["role_ids"].map((x) => x)),
+ );
+
+ Map toJson() => {
+ "id": id,
+ "username": usernameValues.reverse[username],
+ "email": billingAddressEmailValues.reverse[email],
+ "first_name": firstNameValues.reverse[firstName],
+ "last_name": lastNameValues.reverse[lastName],
+ "language_id": languageId,
+ "admin_comment": adminComment,
+ "is_tax_exempt": isTaxExempt,
+ "has_shopping_cart_items": hasShoppingCartItems,
+ "active": active,
+ "deleted": deleted,
+ "is_system_account": isSystemAccount,
+ "system_name": systemName,
+ "last_ip_address": lastIpAddressValues.reverse[lastIpAddress],
+ "created_on_utc": createdOnUtc.toIso8601String(),
+ "last_login_date_utc": lastLoginDateUtc.toIso8601String(),
+ "last_activity_date_utc": lastActivityDateUtc.toIso8601String(),
+ "registered_in_store_id": registeredInStoreId,
+ "role_ids": List.from(roleIds.map((x) => x)),
+ };
+}
+
+enum LastIpAddress { THE_1050220126 }
+
+final lastIpAddressValues = EnumValues({
+ "10.50.220.126": LastIpAddress.THE_1050220126
+});
+
+enum Username { TAMERF }
+
+final usernameValues = EnumValues({
+ "tamerf": Username.TAMERF
+});
+
+enum CustomerCurrencyCode { SAR }
+
+final customerCurrencyCodeValues = EnumValues({
+ "SAR": CustomerCurrencyCode.SAR
+});
+
+enum CustomerIp { THE_105010210, THE_127001, THE_1020200101, THE_102020041, THE_10501028, THE_102020033, THE_1020200170, THE_102020011 }
+
+final customerIpValues = EnumValues({
+ "10.20.200.101": CustomerIp.THE_1020200101,
+ "10.20.200.11": CustomerIp.THE_102020011,
+ "10.20.200.170": CustomerIp.THE_1020200170,
+ "10.20.200.33": CustomerIp.THE_102020033,
+ "10.20.200.41": CustomerIp.THE_102020041,
+ "10.50.102.10": CustomerIp.THE_105010210,
+ "10.50.102.8": CustomerIp.THE_10501028,
+ "127.0.0.1": CustomerIp.THE_127001
+});
+
+enum CustomerTaxDisplayType { EXCLUDING_TAX }
+
+final customerTaxDisplayTypeValues = EnumValues({
+ "ExcludingTax": CustomerTaxDisplayType.EXCLUDING_TAX
+});
+
+class OrderItem {
+ OrderItem({
+ this.quantity,
+ this.unitPriceInclTax,
+ this.unitPriceExclTax,
+ this.priceInclTax,
+ this.priceExclTax,
+ this.discountAmountInclTax,
+ this.discountAmountExclTax,
+ this.originalProductCost,
+ this.attributeDescription,
+ this.downloadCount,
+ this.isDownloadActivated,
+ this.licenseDownloadId,
+ this.itemWeight,
+ this.rentalStartDateUtc,
+ this.rentalEndDateUtc,
+ this.product,
+ this.productId,
+ });
+
+ dynamic quantity;
+ double unitPriceInclTax;
+ double unitPriceExclTax;
+ double priceInclTax;
+ double priceExclTax;
+ double discountAmountInclTax;
+ double discountAmountExclTax;
+ double originalProductCost;
+ String attributeDescription;
+ dynamic downloadCount;
+ bool isDownloadActivated;
+ dynamic licenseDownloadId;
+ double itemWeight;
+ dynamic rentalStartDateUtc;
+ dynamic rentalEndDateUtc;
+ Product product;
+ dynamic productId;
+
+ factory OrderItem.fromJson(Map json) => OrderItem(
+ quantity: json["quantity"],
+ unitPriceInclTax: json["unit_price_incl_tax"].toDouble(),
+ unitPriceExclTax: json["unit_price_excl_tax"].toDouble(),
+ priceInclTax: json["price_incl_tax"].toDouble(),
+ priceExclTax: json["price_excl_tax"].toDouble(),
+ discountAmountInclTax: json["discount_amount_incl_tax"].toDouble(),
+ discountAmountExclTax: json["discount_amount_excl_tax"].toDouble(),
+ originalProductCost: json["original_product_cost"].toDouble(),
+ attributeDescription: json["attribute_description"],
+ downloadCount: json["download_count"],
+ isDownloadActivated: json["isDownload_activated"],
+ licenseDownloadId: json["license_download_id"],
+ itemWeight: json["item_weight"].toDouble(),
+ rentalStartDateUtc: json["rental_start_date_utc"],
+ rentalEndDateUtc: json["rental_end_date_utc"],
+ product: Product.fromJson(json["product"]),
+ productId: json["product_id"],
+ );
+
+ Map toJson() => {
+ "quantity": quantity,
+ "unit_price_incl_tax": unitPriceInclTax,
+ "unit_price_excl_tax": unitPriceExclTax,
+ "price_incl_tax": priceInclTax,
+ "price_excl_tax": priceExclTax,
+ "discount_amount_incl_tax": discountAmountInclTax,
+ "discount_amount_excl_tax": discountAmountExclTax,
+ "original_product_cost": originalProductCost,
+ "attribute_description": attributeDescription,
+ "download_count": downloadCount,
+ "isDownload_activated": isDownloadActivated,
+ "license_download_id": licenseDownloadId,
+ "item_weight": itemWeight,
+ "rental_start_date_utc": rentalStartDateUtc,
+ "rental_end_date_utc": rentalEndDateUtc,
+ "product": product.toJson(),
+ "product_id": productId,
+ };
+}
+
+class Product {
+ Product({
+ 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,
+ });
+
+ String id;
+ bool visibleIndividually;
+ String name;
+ String namen;
+ dynamic localizedNames;
+ String shortDescription;
+ String shortDescriptionn;
+ String fullDescription;
+ String fullDescriptionn;
+ bool markasNew;
+ bool showOnHomePage;
+ String metaKeywords;
+ String metaDescription;
+ String metaTitle;
+ bool allowCustomerReviews;
+ dynamic approvedRatingSum;
+ dynamic notApprovedRatingSum;
+ dynamic approvedTotalReviews;
+ dynamic notApprovedTotalReviews;
+ String sku;
+ bool isRx;
+ bool prescriptionRequired;
+ dynamic rxMessage;
+ dynamic rxMessagen;
+ dynamic manufacturerPartNumber;
+ dynamic gtin;
+ bool isGiftCard;
+ bool requireOtherProducts;
+ bool automaticallyAddRequiredProducts;
+ bool isDownload;
+ bool unlimitedDownloads;
+ dynamic maxNumberOfDownloads;
+ dynamic downloadExpirationDays;
+ bool hasSampleDownload;
+ bool hasUserAgreement;
+ bool isRecurring;
+ dynamic recurringCycleLength;
+ dynamic recurringTotalCycles;
+ bool isRental;
+ dynamic rentalPriceLength;
+ bool isShipEnabled;
+ bool isFreeShipping;
+ bool shipSeparately;
+ dynamic additionalShippingCharge;
+ bool isTaxExempt;
+ bool isTelecommunicationsOrBroadcastingOrElectronicServices;
+ bool useMultipleWarehouses;
+ dynamic manageInventoryMethodId;
+ dynamic stockQuantity;
+ dynamic stockAvailability;
+ dynamic stockAvailabilityn;
+ bool displayStockAvailability;
+ bool displayStockQuantity;
+ dynamic minStockQuantity;
+ dynamic notifyAdminForQuantityBelow;
+ bool allowBackInStockSubscriptions;
+ dynamic orderMinimumQuantity;
+ dynamic orderMaximumQuantity;
+ dynamic allowedQuantities;
+ bool allowAddingOnlyExistingAttributeCombinations;
+ bool disableBuyButton;
+ bool disableWishlistButton;
+ bool availableForPreOrder;
+ dynamic preOrderAvailabilityStartDateTimeUtc;
+ bool callForPrice;
+ double price;
+ dynamic oldPrice;
+ double productCost;
+ dynamic specialPrice;
+ dynamic specialPriceStartDateTimeUtc;
+ dynamic specialPriceEndDateTimeUtc;
+ bool customerEntersPrice;
+ dynamic minimumCustomerEnteredPrice;
+ dynamic maximumCustomerEnteredPrice;
+ bool basepriceEnabled;
+ dynamic basepriceAmount;
+ dynamic basepriceBaseAmount;
+ bool hasTierPrices;
+ bool hasDiscountsApplied;
+ dynamic discountName;
+ dynamic discountNamen;
+ dynamic discountDescription;
+ dynamic discountDescriptionn;
+ dynamic discountPercentage;
+ dynamic currency;
+ dynamic currencyn;
+ double weight;
+ dynamic length;
+ dynamic width;
+ dynamic height;
+ dynamic availableStartDateTimeUtc;
+ dynamic availableEndDateTimeUtc;
+ dynamic displayOrder;
+ bool published;
+ bool deleted;
+ DateTime createdOnUtc;
+ DateTime updatedOnUtc;
+ ProductType productType;
+ dynamic parentGroupedProductId;
+ dynamic roleIds;
+ dynamic discountIds;
+ dynamic storeIds;
+ dynamic manufacturerIds;
+ List reviews;
+ List images;
+ dynamic attributes;
+ dynamic specifications;
+ dynamic associatedProductIds;
+ List tags;
+ dynamic vendorId;
+ String seName;
+
+ factory Product.fromJson(Map json) => Product(
+ id: json["id"],
+ visibleIndividually: json["visible_individually"],
+ name: json["name"],
+ namen: json["namen"],
+ localizedNames: json["localized_names"],
+ shortDescription: json["short_description"] == null ? null : json["short_description"],
+ shortDescriptionn: json["short_descriptionn"] == null ? null : 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"] == null ? null : json["meta_keywords"],
+ metaDescription: json["meta_description"] == null ? null : json["meta_description"],
+ metaTitle: json["meta_title"] == null ? null : 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"].toDouble(),
+ oldPrice: json["old_price"],
+ productCost: json["product_cost"].toDouble(),
+ 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"].toDouble(),
+ 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: DateTime.parse(json["created_on_utc"]),
+ updatedOnUtc: DateTime.parse(json["updated_on_utc"]),
+ productType: productTypeValues.map[json["product_type"]],
+ parentGroupedProductId: json["parent_grouped_product_id"],
+ roleIds: json["role_ids"],
+ discountIds: json["discount_ids"],
+ storeIds: json["store_ids"],
+ manufacturerIds: json["manufacturer_ids"],
+ reviews: List.from(json["reviews"].map((x) => Review.fromJson(x))),
+ images: List.from(json["images"].map((x) => Image.fromJson(x))),
+ attributes: json["attributes"],
+ specifications: json["specifications"],
+ associatedProductIds: json["associated_product_ids"],
+ tags: List.from(json["tags"].map((x) => x)),
+ vendorId: json["vendor_id"],
+ seName: json["se_name"],
+ );
+
+ Map toJson() => {
+ "id": id,
+ "visible_individually": visibleIndividually,
+ "name": name,
+ "namen": namen,
+ "localized_names": localizedNames,
+ "short_description": shortDescription == null ? null : shortDescription,
+ "short_descriptionn": shortDescriptionn == null ? null : shortDescriptionn,
+ "full_description": fullDescription,
+ "full_descriptionn": fullDescriptionn,
+ "markas_new": markasNew,
+ "show_on_home_page": showOnHomePage,
+ "meta_keywords": metaKeywords == null ? null : metaKeywords,
+ "meta_description": metaDescription == null ? null : metaDescription,
+ "meta_title": metaTitle == null ? null : metaTitle,
+ "allow_customer_reviews": allowCustomerReviews,
+ "approved_rating_sum": approvedRatingSum,
+ "not_approved_rating_sum": notApprovedRatingSum,
+ "approved_total_reviews": approvedTotalReviews,
+ "not_approved_total_reviews": notApprovedTotalReviews,
+ "sku": sku,
+ "is_rx": isRx,
+ "prescription_required": prescriptionRequired,
+ "rx_message": rxMessage,
+ "rx_messagen": rxMessagen,
+ "manufacturer_part_number": manufacturerPartNumber,
+ "gtin": gtin,
+ "is_gift_card": isGiftCard,
+ "require_other_products": requireOtherProducts,
+ "automatically_add_required_products": automaticallyAddRequiredProducts,
+ "is_download": isDownload,
+ "unlimited_downloads": unlimitedDownloads,
+ "max_number_of_downloads": maxNumberOfDownloads,
+ "download_expiration_days": downloadExpirationDays,
+ "has_sample_download": hasSampleDownload,
+ "has_user_agreement": hasUserAgreement,
+ "is_recurring": isRecurring,
+ "recurring_cycle_length": recurringCycleLength,
+ "recurring_total_cycles": recurringTotalCycles,
+ "is_rental": isRental,
+ "rental_price_length": rentalPriceLength,
+ "is_ship_enabled": isShipEnabled,
+ "is_free_shipping": isFreeShipping,
+ "ship_separately": shipSeparately,
+ "additional_shipping_charge": additionalShippingCharge,
+ "is_tax_exempt": isTaxExempt,
+ "is_telecommunications_or_broadcasting_or_electronic_services": isTelecommunicationsOrBroadcastingOrElectronicServices,
+ "use_multiple_warehouses": useMultipleWarehouses,
+ "manage_inventory_method_id": manageInventoryMethodId,
+ "stock_quantity": stockQuantity,
+ "stock_availability": stockAvailability,
+ "stock_availabilityn": stockAvailabilityn,
+ "display_stock_availability": displayStockAvailability,
+ "display_stock_quantity": displayStockQuantity,
+ "min_stock_quantity": minStockQuantity,
+ "notify_admin_for_quantity_below": notifyAdminForQuantityBelow,
+ "allow_back_in_stock_subscriptions": allowBackInStockSubscriptions,
+ "order_minimum_quantity": orderMinimumQuantity,
+ "order_maximum_quantity": orderMaximumQuantity,
+ "allowed_quantities": allowedQuantities,
+ "allow_adding_only_existing_attribute_combinations": allowAddingOnlyExistingAttributeCombinations,
+ "disable_buy_button": disableBuyButton,
+ "disable_wishlist_button": disableWishlistButton,
+ "available_for_pre_order": availableForPreOrder,
+ "pre_order_availability_start_date_time_utc": preOrderAvailabilityStartDateTimeUtc,
+ "call_for_price": callForPrice,
+ "price": price,
+ "old_price": oldPrice,
+ "product_cost": productCost,
+ "special_price": specialPrice,
+ "special_price_start_date_time_utc": specialPriceStartDateTimeUtc,
+ "special_price_end_date_time_utc": specialPriceEndDateTimeUtc,
+ "customer_enters_price": customerEntersPrice,
+ "minimum_customer_entered_price": minimumCustomerEnteredPrice,
+ "maximum_customer_entered_price": maximumCustomerEnteredPrice,
+ "baseprice_enabled": basepriceEnabled,
+ "baseprice_amount": basepriceAmount,
+ "baseprice_base_amount": basepriceBaseAmount,
+ "has_tier_prices": hasTierPrices,
+ "has_discounts_applied": hasDiscountsApplied,
+ "discount_name": discountName,
+ "discount_namen": discountNamen,
+ "discount_description": discountDescription,
+ "discount_Descriptionn": discountDescriptionn,
+ "discount_percentage": discountPercentage,
+ "currency": currency,
+ "currencyn": currencyn,
+ "weight": weight,
+ "length": length,
+ "width": width,
+ "height": height,
+ "available_start_date_time_utc": availableStartDateTimeUtc,
+ "available_end_date_time_utc": availableEndDateTimeUtc,
+ "display_order": displayOrder,
+ "published": published,
+ "deleted": deleted,
+ "created_on_utc": createdOnUtc.toIso8601String(),
+ "updated_on_utc": updatedOnUtc.toIso8601String(),
+ "product_type": productTypeValues.reverse[productType],
+ "parent_grouped_product_id": parentGroupedProductId,
+ "role_ids": roleIds,
+ "discount_ids": discountIds,
+ "store_ids": storeIds,
+ "manufacturer_ids": manufacturerIds,
+ "reviews": List.from(reviews.map((x) => x.toJson())),
+ "images": List.from(images.map((x) => x.toJson())),
+ "attributes": attributes,
+ "specifications": specifications,
+ "associated_product_ids": associatedProductIds,
+ "tags": List.from(tags.map((x) => x)),
+ "vendor_id": vendorId,
+ "se_name": seName,
+ };
+}
+
+class Image {
+ Image({
+ this.id,
+ this.position,
+ this.src,
+ this.thumb,
+ this.attachment,
+ });
+
+ dynamic id;
+ dynamic position;
+ String src;
+ String thumb;
+ String attachment;
+
+ factory Image.fromJson(Map json) => Image(
+ id: json["id"],
+ position: json["position"],
+ src: json["src"],
+ thumb: json["thumb"],
+ attachment: json["attachment"],
+ );
+
+ Map toJson() => {
+ "id": id,
+ "position": position,
+ "src": src,
+ "thumb": thumb,
+ "attachment": attachment,
+ };
+}
+
+enum ProductType { SIMPLE_PRODUCT }
+
+final productTypeValues = EnumValues({
+ "SimpleProduct": ProductType.SIMPLE_PRODUCT
+});
+
+class Review {
+ Review({
+ 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,
+ });
+
+ dynamic id;
+ dynamic position;
+ dynamic reviewId;
+ dynamic customerId;
+ dynamic productId;
+ dynamic storeId;
+ bool isApproved;
+ Title title;
+ ReviewText reviewText;
+ dynamic replyText;
+ dynamic rating;
+ dynamic helpfulYesTotal;
+ dynamic helpfulNoTotal;
+ DateTime createdOnUtc;
+ ReviewCustomer customer;
+ dynamic product;
+
+ factory Review.fromJson(Map json) => Review(
+ 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: titleValues.map[json["title"]],
+ reviewText: reviewTextValues.map[json["review_text"]],
+ replyText: json["reply_text"],
+ rating: json["rating"],
+ helpfulYesTotal: json["helpful_yes_total"],
+ helpfulNoTotal: json["helpful_no_total"],
+ createdOnUtc: DateTime.parse(json["created_on_utc"]),
+ customer: ReviewCustomer.fromJson(json["customer"]),
+ product: json["product"],
+ );
+
+ Map toJson() => {
+ "id": id,
+ "position": position,
+ "review_id": reviewId,
+ "customer_id": customerId,
+ "product_id": productId,
+ "store_id": storeId,
+ "is_approved": isApproved,
+ "title": titleValues.reverse[title],
+ "review_text": reviewTextValues.reverse[reviewText],
+ "reply_text": replyText,
+ "rating": rating,
+ "helpful_yes_total": helpfulYesTotal,
+ "helpful_no_total": helpfulNoTotal,
+ "created_on_utc": createdOnUtc.toIso8601String(),
+ "customer": customer.toJson(),
+ "product": product,
+ };
+}
+
+class ReviewCustomer {
+ ReviewCustomer({
+ 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,
+ });
+
+ dynamic fileNumber;
+ dynamic iqamaNumber;
+ dynamic isOutSa;
+ dynamic patientType;
+ dynamic gender;
+ DateTime birthDate;
+ dynamic phone;
+ dynamic countryCode;
+ dynamic yahalaAccountno;
+ dynamic billingAddress;
+ dynamic shippingAddress;
+ List addresses;
+ String id;
+ String username;
+ PurpleEmail email;
+ dynamic firstName;
+ dynamic lastName;
+ dynamic languageId;
+ dynamic adminComment;
+ dynamic isTaxExempt;
+ dynamic hasShoppingCartItems;
+ dynamic active;
+ dynamic deleted;
+ dynamic isSystemAccount;
+ dynamic systemName;
+ dynamic lastIpAddress;
+ dynamic createdOnUtc;
+ dynamic lastLoginDateUtc;
+ dynamic lastActivityDateUtc;
+ dynamic registeredInStoreId;
+ List roleIds;
+
+ factory ReviewCustomer.fromJson(Map json) => ReviewCustomer(
+ fileNumber: json["file_number"],
+ iqamaNumber: json["iqama_number"],
+ isOutSa: json["is_out_sa"],
+ patientType: json["patient_type"],
+ gender: json["gender"],
+ birthDate: DateTime.parse(json["birth_date"]),
+ phone: json["phone"],
+ countryCode: json["country_code"],
+ yahalaAccountno: json["yahala_accountno"],
+ billingAddress: json["billing_address"],
+ shippingAddress: json["shipping_address"],
+ addresses: List.from(json["addresses"].map((x) => x)),
+ id: json["id"],
+ username: json["username"],
+ email: purpleEmailValues.map[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"],
+ roleIds: List.from(json["role_ids"].map((x) => x)),
+ );
+
+ Map toJson() => {
+ "file_number": fileNumber,
+ "iqama_number": iqamaNumber,
+ "is_out_sa": isOutSa,
+ "patient_type": patientType,
+ "gender": gender,
+ "birth_date": birthDate.toIso8601String(),
+ "phone": phone,
+ "country_code": countryCode,
+ "yahala_accountno": yahalaAccountno,
+ "billing_address": billingAddress,
+ "shipping_address": shippingAddress,
+ "addresses": List.from(addresses.map((x) => x)),
+ "id": id,
+ "username": username,
+ "email": purpleEmailValues.reverse[email],
+ "first_name": firstName,
+ "last_name": lastName,
+ "language_id": languageId,
+ "admin_comment": adminComment,
+ "is_tax_exempt": isTaxExempt,
+ "has_shopping_cart_items": hasShoppingCartItems,
+ "active": active,
+ "deleted": deleted,
+ "is_system_account": isSystemAccount,
+ "system_name": systemName,
+ "last_ip_address": lastIpAddress,
+ "created_on_utc": createdOnUtc,
+ "last_login_date_utc": lastLoginDateUtc,
+ "last_activity_date_utc": lastActivityDateUtc,
+ "registered_in_store_id": registeredInStoreId,
+ "role_ids": List.from(roleIds.map((x) => x)),
+ };
+}
+
+enum PurpleEmail { STEVE_GATES_NOP_COMMERCE_COM, TAMER_FANASHEH_DRSULAIMANALHABIB_COM, ASIF_RAZA_DRSULAIMANALHABIB_COM, ABOSAMI_YMAIL_COM }
+
+final purpleEmailValues = EnumValues({
+ "abosami@ymail.com": PurpleEmail.ABOSAMI_YMAIL_COM,
+ "asif.raza@drsulaimanalhabib.com": PurpleEmail.ASIF_RAZA_DRSULAIMANALHABIB_COM,
+ "steve_gates@nopCommerce.com": PurpleEmail.STEVE_GATES_NOP_COMMERCE_COM,
+ "tamer.fanasheh@drsulaimanalhabib.com": PurpleEmail.TAMER_FANASHEH_DRSULAIMANALHABIB_COM
+});
+
+enum ReviewText { GOOD, NICE_PRICE, GREAT, REVIEW_TEXT_GOOD, GG, ENAD_TEST_REVIEW_001, ENAD, ENADDD, ENAD_TEST_0001, PURPLE_GOOD, EMPTY }
+
+final reviewTextValues = EnumValues({
+ "افضل علاج للزكام": ReviewText.EMPTY,
+ "ENAD ": ReviewText.ENAD,
+ "enaddd": ReviewText.ENADDD,
+ "ENAD TEST 0001": ReviewText.ENAD_TEST_0001,
+ "Enad Test Review 001": ReviewText.ENAD_TEST_REVIEW_001,
+ "gg": ReviewText.GG,
+ "good ": ReviewText.GOOD,
+ "great": ReviewText.GREAT,
+ "nice price": ReviewText.NICE_PRICE,
+ "Good": ReviewText.PURPLE_GOOD,
+ "good": ReviewText.REVIEW_TEXT_GOOD
+});
+
+enum Title { EMPTY, GOOD, TITLE }
+
+final titleValues = EnumValues({
+ "": Title.EMPTY,
+ "Good": Title.GOOD,
+ "ممتاز": Title.TITLE
+});
+
+enum OrderStatus { ORDER_SUBMITTED, PENDING, ORDER_IN_PROGRESS, ORDER_COMPLETED, CANCELLED, PROCESSING, ORDER_REFUNDED, COMPLETE }
+
+final orderStatusValues = EnumValues({
+ "Cancelled": OrderStatus.CANCELLED,
+ "Complete": OrderStatus.COMPLETE,
+ "OrderCompleted": OrderStatus.ORDER_COMPLETED,
+ "OrderInProgress": OrderStatus.ORDER_IN_PROGRESS,
+ "OrderRefunded": OrderStatus.ORDER_REFUNDED,
+ "OrderSubmitted": OrderStatus.ORDER_SUBMITTED,
+ "Pending": OrderStatus.PENDING,
+ "Processing": OrderStatus.PROCESSING
+});
+
+enum OrderStatusn { ORDER_SUBMITTED, EMPTY, ORDER_IN_PROGRESS, ORDER_COMPLETED, ORDER_STATUSN, PURPLE, FLUFFY, TENTACLED }
+
+final orderStatusnValues = EnumValues({
+ "معلقة": OrderStatusn.EMPTY,
+ "تم ارجاع مبلغ الطلبية المدفوع للعميل": OrderStatusn.FLUFFY,
+ "Order Completed": OrderStatusn.ORDER_COMPLETED,
+ "Order In Progress": OrderStatusn.ORDER_IN_PROGRESS,
+ "ملغي": OrderStatusn.ORDER_STATUSN,
+ "Order Submitted": OrderStatusn.ORDER_SUBMITTED,
+ "قيد التنفيذ": OrderStatusn.PURPLE,
+ "مكتمل": OrderStatusn.TENTACLED
+});
+
+enum PaymentMethodSystemName { PAYMENTS_PAY_FORT, PAYMENTS_CASH_ON_DELIVERY }
+
+final paymentMethodSystemNameValues = EnumValues({
+ "Payments.CashOnDelivery": PaymentMethodSystemName.PAYMENTS_CASH_ON_DELIVERY,
+ "Payments.PayFort": PaymentMethodSystemName.PAYMENTS_PAY_FORT
+});
+
+enum PaymentName { CREDIT_DEBIT_CARD_PAYFORT, CASH_ON_DELIVERY_COD }
+
+final paymentNameValues = EnumValues({
+ "Cash On Delivery (COD)": PaymentName.CASH_ON_DELIVERY_COD,
+ "Credit / Debit Card Payfort": PaymentName.CREDIT_DEBIT_CARD_PAYFORT
+});
+
+enum PaymentStatus { PAID, PENDING }
+
+final paymentStatusValues = EnumValues({
+ "Paid": PaymentStatus.PAID,
+ "Pending": PaymentStatus.PENDING
+});
+
+enum PaymentStatusn { EMPTY, PAYMENT_STATUSN }
+
+final paymentStatusnValues = EnumValues({
+ "تم الدفع": PaymentStatusn.EMPTY,
+ "قيد الإنتظار": PaymentStatusn.PAYMENT_STATUSN
+});
+
+enum PreferDeliveryTime { THE_1000_AM_330_PM, THE_530_PM_730_PM }
+
+final preferDeliveryTimeValues = EnumValues({
+ "10:00 AM - 3:30 PM": PreferDeliveryTime.THE_1000_AM_330_PM,
+ "5:30 PM - 7:30 PM": PreferDeliveryTime.THE_530_PM_730_PM
+});
+
+enum PreferDeliveryTimen { THE_1000330, THE_530730 }
+
+final preferDeliveryTimenValues = EnumValues({
+ "10:00 ص - 3:30 م": PreferDeliveryTimen.THE_1000330,
+ "5:30 م - 7:30 م": PreferDeliveryTimen.THE_530730
+});
+
+enum ShippingMethod { EMPTY, FIXED_PRICE }
+
+final shippingMethodValues = EnumValues({
+ "سعر ثابت ": ShippingMethod.EMPTY,
+ "Fixed Price": ShippingMethod.FIXED_PRICE
+});
+
+enum ShippingRateComputationMethodSystemName { SHIPPING_FIXED_OR_BY_WEIGHT }
+
+final shippingRateComputationMethodSystemNameValues = EnumValues({
+ "Shipping.FixedOrByWeight": ShippingRateComputationMethodSystemName.SHIPPING_FIXED_OR_BY_WEIGHT
+});
+
+enum ShippingStatus { NOT_YET_SHIPPED }
+
+final shippingStatusValues = EnumValues({
+ "NotYetShipped": ShippingStatus.NOT_YET_SHIPPED
+});
+
+enum ShippingStatusn { EMPTY }
+
+final shippingStatusnValues = EnumValues({
+ "لم يتم شحنها بعد": ShippingStatusn.EMPTY
+});
+
+class EnumValues {
+ Map map;
+ Map reverseMap;
+
+ EnumValues(this.map);
+
+ Map get reverse {
+ if (reverseMap == null) {
+ reverseMap = map.map((k, v) => new MapEntry(v, k));
+ }
+ return reverseMap;
+ }
+}
+
+
+
diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart
index 696489c6..57af3169 100644
--- a/lib/core/service/client/base_app_client.dart
+++ b/lib/core/service/client/base_app_client.dart
@@ -170,6 +170,38 @@ class BaseAppClient {
}
}
+ getPharmacy(String endPoint,
+ {Function(dynamic response, int statusCode) onSuccess,
+ Function(String error, int statusCode) onFailure,
+ bool isAllowAny = false,
+ Map queryParams}) async {
+ String url = PHARMACY_BASE_URL + endPoint;
+ if (queryParams != null) {
+ String queryString = Uri(queryParameters: queryParams).query;
+ url += '?' + queryString;
+ }
+
+ print("URL : $url");
+
+ if (await Utils.checkConnection()) {
+ final response = await http.get(url.trim(), headers: {
+ 'Content-Type': 'application/json',
+ 'Accept': 'application/json'
+ });
+ final int statusCode = response.statusCode;
+ print("statusCode :$statusCode");
+
+ if (statusCode < 200 || statusCode >= 400 || json == null) {
+ onFailure('Error While Fetching data', statusCode);
+ } else {
+ var parsed = json.decode(response.body.toString());
+ onSuccess(parsed, statusCode);
+ }
+ } else {
+ onFailure('Please Check The Internet Connection', -1);
+ }
+ }
+
logout() async {
await sharedPref.remove(LOGIN_TOKEN_ID);
Navigator.of(AppGlobal.context).pushReplacementNamed(LOGIN_TYPE);
diff --git a/lib/core/viewModels/pharmacyModule/PharmacyAddressesViewModel.dart b/lib/core/viewModels/pharmacyModule/PharmacyAddressesViewModel.dart
new file mode 100644
index 00000000..75a178fa
--- /dev/null
+++ b/lib/core/viewModels/pharmacyModule/PharmacyAddressesViewModel.dart
@@ -0,0 +1,24 @@
+
+import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
+import 'package:diplomaticquarterapp/services/pharmacy_services/pharmacyAddress_service.dart';
+import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyAddressesModel.dart';
+import '../../../locator.dart';
+import '../base_view_model.dart';
+
+class PharmacyAddressesViewModel extends BaseViewModel {
+ PharmacyAddressService _PharmacyAddressService = locator();
+
+ List get address => _PharmacyAddressService.address;
+
+
+ Future getAddress() async {
+ setState(ViewState.Busy);
+ await _PharmacyAddressService.getAddress();
+ if (_PharmacyAddressService.hasError) {
+ error = _PharmacyAddressService.error;
+ setState(ViewState.Error);
+ } else {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/lib/core/viewModels/pharmacyModule/order_model_view_model.dart b/lib/core/viewModels/pharmacyModule/order_model_view_model.dart
new file mode 100644
index 00000000..beb62a53
--- /dev/null
+++ b/lib/core/viewModels/pharmacyModule/order_model_view_model.dart
@@ -0,0 +1,39 @@
+import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
+import 'package:diplomaticquarterapp/services/pharmacy_services/orderDetails_service.dart';
+import 'package:diplomaticquarterapp/services/pharmacy_services/order_service.dart';
+import 'package:diplomaticquarterapp/core/model/pharmacies/order_model.dart';
+import '../../../locator.dart';
+import '../base_view_model.dart';
+
+class OrderModelViewModel extends BaseViewModel {
+ OrderService _orderService = locator();
+ List get order => _orderService.orderList;
+
+ OrderDetailsService _orderDetailsService = locator();
+ List get orderDetails => _orderDetailsService.orderDetails;
+
+
+
+
+ Future getOrder(id, pageId) async {
+ setState(ViewState.Busy);
+ await _orderService.getOrder(id,pageId);
+ if (_orderService.hasError) {
+ error = _orderService.error;
+ setState(ViewState.Error);
+ } else {
+
+ }
+ }
+
+ Future getOrderDetails(orderId) async {
+ setState(ViewState.Busy);
+ await _orderDetailsService.getOrderDetails(orderId);
+ if (_orderDetailsService.hasError) {
+ error = _orderDetailsService.error;
+ setState(ViewState.Error);
+ } else {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/lib/locator.dart b/lib/locator.dart
index a7352b47..dee43d78 100644
--- a/lib/locator.dart
+++ b/lib/locator.dart
@@ -4,6 +4,9 @@ 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/core/viewModels/pharmacyModule/PharmacyAddressesViewModel.dart';
+import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/order_model_view_model.dart';
+import 'package:diplomaticquarterapp/services/pharmacy_services/order_service.dart';
import 'package:diplomaticquarterapp/uitl/navigation_service.dart';
import 'package:get_it/get_it.dart';
@@ -86,6 +89,9 @@ import 'core/viewModels/pharmacyModule/pharmacy_module_view_model.dart';
import 'core/viewModels/qr_view_model.dart';
import 'core/viewModels/vaccine_view_model.dart';
import 'core/service/vaccine_service.dart';
+import 'services/pharmacy_services/orderDetails_service.dart';
+import 'services/pharmacy_services/pharmacyAddress_service.dart';
+
GetIt locator = GetIt.instance;
@@ -142,6 +148,9 @@ void setupLocator() {
locator.registerLazySingleton(() => PharmacyModuleService());
locator.registerLazySingleton(() => OrderPreviewService());
+ locator.registerLazySingleton(() => OrderService());
+ locator.registerLazySingleton(() => PharmacyAddressService());
+ locator.registerLazySingleton(() => OrderDetailsService());
/// View Model
@@ -173,6 +182,8 @@ void setupLocator() {
locator.registerFactory(() => ChildVaccinesViewModel());
locator.registerFactory(() => UserInformationViewModel());
locator.registerFactory(() => VaccinationTableViewModel());
+ locator.registerFactory(() => OrderModelViewModel());
+ locator.registerFactory(() => PharmacyAddressesViewModel());
diff --git a/lib/pages/base/base_view.dart b/lib/pages/base/base_view.dart
index f5311aae..91e8a80f 100644
--- a/lib/pages/base/base_view.dart
+++ b/lib/pages/base/base_view.dart
@@ -24,9 +24,9 @@ class _BaseViewState extends State> {
@override
void initState() {
- if (widget.onModelReady != null && authenticatedUserObject.isLogin) {
+// if (widget.onModelReady != null && authenticatedUserObject.isLogin) {
widget.onModelReady(model);
- }
+// }
super.initState();
}
diff --git a/lib/pages/landing/home_page.dart b/lib/pages/landing/home_page.dart
index 8de6fe6b..57fc074a 100644
--- a/lib/pages/landing/home_page.dart
+++ b/lib/pages/landing/home_page.dart
@@ -489,7 +489,7 @@ class _HomePageState extends State {
),
DashboardItem(
onTap: () => Navigator.push(
- context, FadePage(page: PharmacyPage())),
+ context, FadePage(page: OrderPage())),
child: Center(
child: Padding(
diff --git a/lib/pages/pharmacy/order/Order.dart b/lib/pages/pharmacy/order/Order.dart
index bfbca83f..17849c47 100644
--- a/lib/pages/pharmacy/order/Order.dart
+++ b/lib/pages/pharmacy/order/Order.dart
@@ -1,3 +1,6 @@
+import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/order_model_view_model.dart';
+import 'package:diplomaticquarterapp/pages/base/base_view.dart';
+import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter_svg/flutter_svg.dart';
@@ -8,17 +11,26 @@ import 'package:diplomaticquarterapp/pages/pharmacy/order/OrderDetails.dart';
class OrderPage extends StatefulWidget {
+// orderList({this.customerId, this.pageId});
+
@override
_OrderPageState createState() => _OrderPageState();
}
class _OrderPageState extends State with SingleTickerProviderStateMixin{
+ String customerId="";
+ String page_id="";
+
+ List delivered = [] ;
+ List processing = [];
+ List cancelled = [];
+ List pending = [];
TabController _tabController;
AppSharedPreferences sharedPref = AppSharedPreferences();
@override
void initState() {
- WidgetsBinding.instance.addPostFrameCallback((_) => getOrder());
+// WidgetsBinding.instance.addPostFrameCallback((_) => getOrder());
super.initState();
_tabController = new TabController(length: 4, vsync: this,);
@@ -26,54 +38,61 @@ class _OrderPageState extends State with SingleTickerProviderStateMix
@override
Widget build(BuildContext context) {
- return Scaffold(
- appBar: AppBar(
- centerTitle: true,
- title: Text(TranslationBase.of(context).order, style: TextStyle(color:Colors.white)),
- backgroundColor: Colors.green,
- ),
- body: Container(
- child: Column(
- children: [
- TabBar(
- tabs: [
- Tab(text: TranslationBase.of(context).delivered),
- Tab(text: TranslationBase.of(context).processing),
- Tab(text: TranslationBase.of(context).pending),
- Tab(text: TranslationBase.of(context).cancelled),
- ],
- controller: _tabController,
- ),
- Divider(
- color: Colors.grey[350],
- height: 10,
- thickness: 6,
- indent: 0,
- endIndent: 0,
- ),
- Expanded(
- child: new TabBarView(
- physics: NeverScrollableScrollPhysics(),
- children: [
- getDeliveredOrder(),
- getProcessingOrder(),
- getPendingOrder(),
- getCancelledOrder(),
+ return BaseView(
+ onModelReady: (model) => model.getOrder(customerId, page_id),
+ builder: (_,model, wi )=> AppScaffold(
+ appBarTitle:(TranslationBase.of(context).order),
+// backgroundColor: Colors.green ,
+// centerTitle: true,
+// title: Text(TranslationBase.of(context).order, style: TextStyle(color:Colors.white)),
+// backgroundColor: Colors.green,
+ isShowAppBar: true,
+ isPharmacy:true ,
+ body: Container(
+ child: Column(
+ children: [
+ TabBar(
+ tabs: [
+ Tab(text: TranslationBase.of(context).delivered),
+// Tab(text: model.order.length.toString()),
+ Tab(text: TranslationBase.of(context).processing),
+ Tab(text: TranslationBase.of(context).pending),
+ Tab(text: TranslationBase.of(context).cancelled),
],
controller: _tabController,
),
- ),
- ],
+ Divider(
+ color: Colors.grey[350],
+ height: 10,
+ thickness: 6,
+ indent: 0,
+ endIndent: 0,
+ ),
+ Expanded(
+ child: new TabBarView(
+ physics: NeverScrollableScrollPhysics(),
+ children: [
+ getDeliveredOrder(model),
+ getProcessingOrder(model),
+ getPendingOrder(model),
+ getCancelledOrder(model),
+ ],
+ controller: _tabController,
+ ),
+ ),
+ ],
+ ),
),
),
);
}
- Widget getDeliveredOrder(){
+ Widget getDeliveredOrder(OrderModelViewModel model){
return Container(
width: MediaQuery.of(context).size.width,
- child: SingleChildScrollView(
- child: Column(
+ child: model.order.length != 0 && model.order[0].orderStatusId == 30
+ ? SingleChildScrollView(
+ child: Column(
children: [
ListView.builder(
scrollDirection: Axis.vertical,
@@ -96,13 +115,13 @@ class _OrderPageState extends State with SingleTickerProviderStateMix
children: [
Container(
margin: EdgeInsets.only(right: 5),
- child: Text('Order#:',
+ child: Text(TranslationBase.of(context).orderNumber,
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold,
),
),
),
Container(
- child: Text('3183',
+ child: Text(model.order[0].id.toString(),
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold,
),
),
@@ -115,13 +134,13 @@ class _OrderPageState extends State with SingleTickerProviderStateMix
children: [
Container(
margin: EdgeInsets.only(right: 5),
- child: Text('Date',
+ child: Text(TranslationBase.of(context).orderDate,
style: TextStyle(fontSize: 14.0,
),
),
),
Container(
- child: Text('Aug 12, 2020',
+ child: Text(model.order[0].createdOnUtc.toString(),
style: TextStyle(fontSize: 14.0,
),
),
@@ -156,24 +175,27 @@ class _OrderPageState extends State with SingleTickerProviderStateMix
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
- Container(
- margin: EdgeInsets.only(left: 8, right: 8, top: 1, bottom: 8),
- padding: EdgeInsets.only(left: 13.0, right: 13.0),
- decoration: BoxDecoration(
- border: Border.all(
+ Expanded(
+ child: Container(
+ margin: EdgeInsets.only(left: 8, right: 8, top: 1, bottom: 8),
+ padding: EdgeInsets.only(left: 13.0, right: 13.0),
+ decoration: BoxDecoration(
+ border: Border.all(
+ color: Colors.blue[700],
+ style: BorderStyle.solid,
+ width: 5.0,
+ ),
color: Colors.blue[700],
- style: BorderStyle.solid,
- width: 5.0,
+ borderRadius: BorderRadius.circular(30.0)
+ ),
+ child: Text(
+ model.order[0].orderStatus.toString(),
+// TranslationBase.of(context).delivered,
+ style: TextStyle(
+ color: Colors.white,
+ fontSize: 15.0,
+ fontWeight: FontWeight.bold,
),
- color: Colors.blue[700],
- borderRadius: BorderRadius.circular(30.0)
- ),
- child: Text(
- TranslationBase.of(context).delivered,
- style: TextStyle(
- color: Colors.white,
- fontSize: 15.0,
- fontWeight: FontWeight.bold,
),
),
),
@@ -186,14 +208,14 @@ class _OrderPageState extends State with SingleTickerProviderStateMix
children: [
Container(
margin: EdgeInsets.only(left: 5),
- child: Text('564',
+ child: Text(model.order[0].orderTotal.toString(),
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold,
),
),
),
Container(
margin: EdgeInsets.only(left: 5),
- child: Text('SAR',
+ child: Text(TranslationBase.of(context).sar,
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold,
),
),
@@ -212,7 +234,7 @@ class _OrderPageState extends State with SingleTickerProviderStateMix
),
Container(
margin: EdgeInsets.only(left: 5),
- child: Text('items(s)',
+ child: Text(TranslationBase.of(context).itemsNo,
style: TextStyle(fontSize: 14.0,
),
),
@@ -238,14 +260,34 @@ class _OrderPageState extends State with SingleTickerProviderStateMix
)
],
),
+ )
+ : Container(
+ child: Center(
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.center,
+ crossAxisAlignment: CrossAxisAlignment.center,
+ children: [
+ Image.asset(
+ 'assets/images/pharmacy/empty_box.svg'),
+ Container(
+ margin: EdgeInsets.only(top: 10.0),
+ child: Text(TranslationBase.of(context).noOrder,
+ style: TextStyle(
+ fontSize: 16.0,
+ )),
+ ),
+ ],
+ ),
+ ),
),
);
}
- Widget getProcessingOrder(){
+ Widget getProcessingOrder(OrderModelViewModel model){
return Container(
- child: SingleChildScrollView(
- child: Column(
+ child: model.order.length != 0 && model.order[0].orderStatusId == 20
+ ? SingleChildScrollView(
+ child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
@@ -259,13 +301,13 @@ class _OrderPageState extends State with SingleTickerProviderStateMix
children: [
Container(
margin: EdgeInsets.only(right: 5),
- child: Text('Order#:',
+ child: Text(TranslationBase.of(context).orderNumber,
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold,
),
),
),
Container(
- child: Text('3183',
+ child: Text(model.order[0].id.toString(),
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold,
),
),
@@ -278,13 +320,13 @@ class _OrderPageState extends State with SingleTickerProviderStateMix
children: [
Container(
margin: EdgeInsets.only(right: 5),
- child: Text('Date',
+ child: Text(TranslationBase.of(context).orderDate,
style: TextStyle(fontSize: 14.0,
),
),
),
Container(
- child: Text('Aug 12, 2020',
+ child: Text(model.order[0].createdOnUtc.toString(),
style: TextStyle(fontSize: 14.0,
),
),
@@ -319,24 +361,27 @@ class _OrderPageState extends State with SingleTickerProviderStateMix
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
- Container(
- margin: EdgeInsets.only(left: 8, right: 8, top: 1, bottom: 8),
- padding: EdgeInsets.only(left: 13.0, right: 13.0),
- decoration: BoxDecoration(
- border: Border.all(
+ Expanded(
+ child: Container(
+ margin: EdgeInsets.only(left: 8, right: 8, top: 1, bottom: 8),
+ padding: EdgeInsets.only(left: 13.0, right: 13.0),
+ decoration: BoxDecoration(
+ border: Border.all(
+ color: Colors.green,
+ style: BorderStyle.solid,
+ width: 5.0,
+ ),
color: Colors.green,
- style: BorderStyle.solid,
- width: 5.0,
+ borderRadius: BorderRadius.circular(30.0)
+ ),
+ child: Text(
+ model.order[0].orderStatus.toString(),
+// TranslationBase.of(context).processing,
+ style: TextStyle(
+ color: Colors.white,
+ fontSize: 15.0,
+ fontWeight: FontWeight.bold,
),
- color: Colors.green,
- borderRadius: BorderRadius.circular(30.0)
- ),
- child: Text(
- TranslationBase.of(context).processing,
- style: TextStyle(
- color: Colors.white,
- fontSize: 15.0,
- fontWeight: FontWeight.bold,
),
),
),
@@ -349,14 +394,14 @@ class _OrderPageState extends State with SingleTickerProviderStateMix
children: [
Container(
margin: EdgeInsets.only(left: 5),
- child: Text('564',
+ child: Text(model.order[0].orderTotal.toString(),
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold,
),
),
),
Container(
margin: EdgeInsets.only(left: 5),
- child: Text('SAR',
+ child: Text(TranslationBase.of(context).sar,
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold,
),
),
@@ -375,7 +420,7 @@ class _OrderPageState extends State with SingleTickerProviderStateMix
),
Container(
margin: EdgeInsets.only(left: 5),
- child: Text('items(s)',
+ child: Text(TranslationBase.of(context).itemsNo,
style: TextStyle(fontSize: 14.0,
),
),
@@ -396,15 +441,35 @@ class _OrderPageState extends State with SingleTickerProviderStateMix
),
],
),
- ),
+ )
+ : Container(
+ child: Center(
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.center,
+ crossAxisAlignment: CrossAxisAlignment.center,
+ children: [
+ Image.asset(
+ 'assets/images/pharmacy/empty_box.svg'),
+ Container(
+ margin: EdgeInsets.only(top: 10.0),
+ child: Text(TranslationBase.of(context).noOrder,
+ style: TextStyle(
+ fontSize: 16.0,
+ )),
+ ),
+ ],
+ ),
+ ),
+ ),
);
}
- Widget getPendingOrder(){
+ Widget getPendingOrder(OrderModelViewModel model){
return Container(
- child: SingleChildScrollView(
- child: Column(
- children: [
+ child: model.order.length != 0 && model.order[0].orderStatusId == 10
+ ? SingleChildScrollView(
+ child: Column(
+ children: [
ListView.builder(
scrollDirection: Axis.vertical,
shrinkWrap: true,
@@ -427,13 +492,13 @@ class _OrderPageState extends State with SingleTickerProviderStateMix
children: [
Container(
margin: EdgeInsets.only(right: 5),
- child: Text('Order#:',
+ child: Text(TranslationBase.of(context).orderNumber,
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold,
),
),
),
Container(
- child: Text('3183',
+ child: Text(model.order[0].id.toString(),
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold,
),
),
@@ -446,13 +511,13 @@ class _OrderPageState extends State with SingleTickerProviderStateMix
children: [
Container(
margin: EdgeInsets.only(right: 5),
- child: Text('Date',
+ child: Text(TranslationBase.of(context).orderDate,
style: TextStyle(fontSize: 14.0,
),
),
),
Container(
- child: Text('Aug 12, 2020',
+ child: Text(model.order[0].createdOnUtc.toString(),
style: TextStyle(fontSize: 14.0,
),
),
@@ -487,27 +552,28 @@ class _OrderPageState extends State with SingleTickerProviderStateMix
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
- Container(
- margin: EdgeInsets.all(8.0),
- padding: EdgeInsets.only(left: 13.0, right: 13.0),
- decoration: BoxDecoration(
- border: Border.all(
- color: Colors.orange[300],
- style: BorderStyle.solid,
- width: 5.0,
+ Expanded(
+ child:Container(
+ margin: EdgeInsets.all(8.0),
+ padding: EdgeInsets.only(left: 13.0, right: 13.0),
+ decoration: BoxDecoration(
+ border: Border.all(
+ color: Colors.orange[300],
+ style: BorderStyle.solid,
+ width: 5.0,
+ ),
+ color: Colors.orange[300],
+ borderRadius: BorderRadius.circular(30.0)
),
- color: Colors.orange[300],
- borderRadius: BorderRadius.circular(30.0)
- ),
- child: Text(
- TranslationBase.of(context).pending,
- style: TextStyle(
- color: Colors.white,
- fontSize: 15.0,
- fontWeight: FontWeight.bold,
- ),
- ),
- ),
+ child: Text(
+ model.order[0].orderStatus.toString(),
+ style: TextStyle(
+ color: Colors.white,
+ fontSize: 15.0,
+ fontWeight: FontWeight.bold,
+ ),
+ ),
+ ), ),
Container(
margin: EdgeInsets.all(8.0),
child: Column(
@@ -517,14 +583,14 @@ class _OrderPageState extends State with SingleTickerProviderStateMix
children: [
Container(
margin: EdgeInsets.only(left: 5),
- child: Text('564',
+ child: Text(model.order[0].orderTotal.toString(),
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold,
),
),
),
Container(
margin: EdgeInsets.only(left: 5),
- child: Text('SAR',
+ child: Text(TranslationBase.of(context).sar,
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold,
),
),
@@ -543,7 +609,7 @@ class _OrderPageState extends State with SingleTickerProviderStateMix
),
Container(
margin: EdgeInsets.only(left: 5),
- child: Text('items(s)',
+ child: Text(TranslationBase.of(context).itemsNo,
style: TextStyle(fontSize: 14.0,
),
),
@@ -571,13 +637,34 @@ class _OrderPageState extends State with SingleTickerProviderStateMix
)
],
),
+ )
+ : Container(
+ child: Center(
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.center,
+ crossAxisAlignment: CrossAxisAlignment.center,
+ children: [
+ Image.asset(
+ 'assets/images/pharmacy/empty_box.svg'),
+ Container(
+ margin: EdgeInsets.only(top: 10.0),
+ child: Text(TranslationBase.of(context).noOrder,
+ style: TextStyle(
+ fontSize: 16.0,
+ )),
+ ),
+ ],
+ ),
+ ),
),
+
);
}
- Widget getCancelledOrder(){
+ Widget getCancelledOrder(OrderModelViewModel model){
return Container(
- child: SingleChildScrollView(
+ child: model.order.length != 0 && model.order[0].orderStatusId == 40
+ ? SingleChildScrollView(
child: Column(
children: [
ListView.builder(
@@ -602,13 +689,13 @@ class _OrderPageState extends State with SingleTickerProviderStateMix
children: [
Container(
margin: EdgeInsets.only(right: 5),
- child: Text('Order#:',
+ child: Text(TranslationBase.of(context).orderNumber,
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold,
),
),
),
Container(
- child: Text('3183',
+ child: Text(model.order[0].id.toString(),
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold,
),
),
@@ -621,13 +708,13 @@ class _OrderPageState extends State with SingleTickerProviderStateMix
children: [
Container(
margin: EdgeInsets.only(right: 5),
- child: Text('Date',
+ child: Text(TranslationBase.of(context).orderDate,
style: TextStyle(fontSize: 14.0,
),
),
),
Container(
- child: Text('Aug 12, 2020',
+ child: Text(model.order[0].createdOnUtc.toString(),
style: TextStyle(fontSize: 14.0,
),
),
@@ -662,27 +749,28 @@ class _OrderPageState extends State with SingleTickerProviderStateMix
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
- Container(
- margin: EdgeInsets.only(left: 8, right: 8, top: 1, bottom: 8),
- padding: EdgeInsets.only(left: 10.0, right: 10.0),
- decoration: BoxDecoration(
- border: Border.all(
- color: Colors.red[900],
- style: BorderStyle.solid,
- width: 5.0,
+ Expanded(
+ child:Container(
+ margin: EdgeInsets.only(left: 8, right: 8, top: 1, bottom: 8),
+ padding: EdgeInsets.only(left: 10.0, right: 10.0),
+ decoration: BoxDecoration(
+ border: Border.all(
+ color: Colors.red[900],
+ style: BorderStyle.solid,
+ width: 5.0,
+ ),
+ color: Colors.red[900],
+ borderRadius: BorderRadius.circular(30.0)
),
- color: Colors.red[900],
- borderRadius: BorderRadius.circular(30.0)
- ),
- child: Text(
- TranslationBase.of(context).cancelled,
- style: TextStyle(
- color: Colors.white,
- fontSize: 15.0,
- fontWeight: FontWeight.bold,
- ),
- ),
- ),
+ child: Text(
+ model.order[0].orderStatus.toString(),
+ style: TextStyle(
+ color: Colors.white,
+ fontSize: 15.0,
+ fontWeight: FontWeight.bold,
+ ),
+ ),
+ ), ),
Container(
margin: EdgeInsets.only(left: 8, right: 8, top: 1, bottom: 8),
child: Column(
@@ -692,14 +780,14 @@ class _OrderPageState extends State with SingleTickerProviderStateMix
children: [
Container(
margin: EdgeInsets.only(left: 5),
- child: Text('564',
+ child: Text(model.order[0].orderTotal.toString(),
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold,
),
),
),
Container(
margin: EdgeInsets.only(left: 5),
- child: Text('SAR',
+ child: Text(TranslationBase.of(context).sar,
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold,
),
),
@@ -718,7 +806,7 @@ class _OrderPageState extends State with SingleTickerProviderStateMix
),
Container(
margin: EdgeInsets.only(left: 5),
- child: Text('items(s)',
+ child: Text(TranslationBase.of(context).itemsNo,
style: TextStyle(fontSize: 14.0,
),
),
@@ -746,20 +834,32 @@ class _OrderPageState extends State with SingleTickerProviderStateMix
)
],
),
- ),
+ )
+ : Container(
+ child: Center(
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.center,
+ crossAxisAlignment: CrossAxisAlignment.center,
+ children: [
+ Image.asset(
+ 'assets/images/pharmacy/empty_box.svg'),
+ Container(
+ margin: EdgeInsets.only(top: 10.0),
+ child: Text(TranslationBase.of(context).noOrder,
+ style: TextStyle(
+ fontSize: 16.0,
+ )),
+ ),
+ ],
+ ),
+ ),
+ ),
);
}
}
-getOrder() {
- print("getOrder no4665");
- OrderService service = new OrderService();
- service.getOrder(AppGlobal.context).then((res) {
- print(res);
- });
-}
// filterOrders() {
// for () {
diff --git a/lib/pages/pharmacy/order/OrderDetails.dart b/lib/pages/pharmacy/order/OrderDetails.dart
index 777ef1dd..d406e7f5 100644
--- a/lib/pages/pharmacy/order/OrderDetails.dart
+++ b/lib/pages/pharmacy/order/OrderDetails.dart
@@ -1,4 +1,7 @@
+import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/order_model_view_model.dart';
+import 'package:diplomaticquarterapp/pages/base/base_view.dart';
+import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter_svg/flutter_svg.dart';
@@ -17,7 +20,9 @@ class OrderDetailsPage extends StatefulWidget {
class _OrderDetailsPageState extends State {
AppSharedPreferences sharedPref = AppSharedPreferences();
-
+ String customerId="";
+ String page_id="";
+ String orderId="3516";
@override
void initState() {
WidgetsBinding.instance.addPostFrameCallback((_) => getOrderDetails());
@@ -26,385 +31,388 @@ class _OrderDetailsPageState extends State {
@override
Widget build(BuildContext context) {
- return Scaffold(
- appBar: AppBar(
- centerTitle: true,
- title: Text(TranslationBase.of(context).orderDetail, style: TextStyle(color:Colors.white)),
- backgroundColor: Colors.green,
- ),
- body: Container(
- color: Colors.white,
- child: SingleChildScrollView(
- child: Column(
- children: [
- Row(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: [
- Container(
- margin: EdgeInsets.fromLTRB(10.0, 15.0, 1.0, 5.0),
- child: Row(
- children: [
- SvgPicture.asset(
- 'assets/images/pharmacy/shipping_mark_icon.svg',
- width: 28,
- height: 28,),
- Text(TranslationBase.of(context).shippingAddress,
- style: TextStyle(fontSize: 13.0, fontWeight: FontWeight.bold,
+ return BaseView(
+ onModelReady:(model) => model.getOrderDetails(orderId),
+ builder: (_,model, wi )=> AppScaffold(
+ appBarTitle: (TranslationBase.of(context).orderDetail),
+// title: Text(TranslationBase.of(context).orderDetail, style: TextStyle(color:Colors.white)),
+// backgroundColor: Colors.green,
+ isShowAppBar: true,
+ isPharmacy:true ,
+ body: Container(
+ color: Colors.white,
+ child: SingleChildScrollView(
+ child: Column(
+ children: [
+ Row(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [
+ Container(
+ margin: EdgeInsets.fromLTRB(10.0, 15.0, 1.0, 5.0),
+ child: Row(
+ children: [
+ SvgPicture.asset(
+ 'assets/images/pharmacy/shipping_mark_icon.svg',
+ width: 28,
+ height: 28,),
+ Text(TranslationBase.of(context).shippingAddress,
+ style: TextStyle(fontSize: 13.0, fontWeight: FontWeight.bold,
+ ),
),
- ),
- ],
+ ],
+ ),
),
- ),
- Container(
- margin: EdgeInsets.only(top: 15.0, right: 10.0),
- padding: EdgeInsets.only(left: 11.0, right: 11.0),
- decoration: BoxDecoration(
- border: Border.all(
+ Container(
+ margin: EdgeInsets.only(top: 15.0, right: 10.0),
+ padding: EdgeInsets.only(left: 11.0, right: 11.0),
+ decoration: BoxDecoration(
+ border: Border.all(
+ color: Colors.blue,
+ style: BorderStyle.solid,
+ width: 5.0,
+ ),
color: Colors.blue,
- style: BorderStyle.solid,
- width: 5.0,
+ borderRadius: BorderRadius.circular(30.0)
+ ),
+ child: Text(
+ TranslationBase.of(context).delivered,
+ style: TextStyle(
+ color: Colors.white,
+ fontSize: 13.0,
+ fontWeight: FontWeight.bold,
),
- color: Colors.blue,
- borderRadius: BorderRadius.circular(30.0)
- ),
- child: Text(
- TranslationBase.of(context).delivered,
- style: TextStyle(
- color: Colors.white,
- fontSize: 13.0,
- fontWeight: FontWeight.bold,
),
),
+ ],
+ ),
+ Container(
+ margin: EdgeInsets.only(left: 10.0, top: 13.0),
+ child: Row(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text('NAME',
+ style: TextStyle(fontSize: 15.0, fontWeight: FontWeight.bold,
+ ),
+ ),
+ ],
),
- ],
- ),
- Container(
- margin: EdgeInsets.only(left: 10.0, top: 13.0),
- child: Row(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Text('NAME',
- style: TextStyle(fontSize: 15.0, fontWeight: FontWeight.bold,
+ ),
+ Container(
+ margin: EdgeInsets.fromLTRB(10.0, 5.0, 1.0, 5.0),
+ child: Row(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text('Cloud Solutions',
+ style: TextStyle(fontSize: 15.0, fontWeight: FontWeight.bold,
+ color: Colors.grey,
+ ),
),
- ),
- ],
+ ],
+ ),
),
- ),
- Container(
- margin: EdgeInsets.fromLTRB(10.0, 5.0, 1.0, 5.0),
- child: Row(
- crossAxisAlignment: CrossAxisAlignment.start,
+ Row(
children: [
- Text('Cloud Solutions',
- style: TextStyle(fontSize: 15.0, fontWeight: FontWeight.bold,
- color: Colors.grey,
+ Container(
+ margin: EdgeInsets.fromLTRB(10.0, 5.0, 8.0, 5.0),
+ child: SvgPicture.asset(
+ 'assets/images/pharmacy/mobile_number_icon.svg',
+ height: 13,),
+ ),
+ Container(
+ margin: EdgeInsets.only(top: 5.0, bottom: 5.0),
+ child: Text('588888778',
+ style: TextStyle(fontSize: 15.0,
+ ),
),
),
],
),
- ),
- Row(
- children: [
- Container(
- margin: EdgeInsets.fromLTRB(10.0, 5.0, 8.0, 5.0),
- child: SvgPicture.asset(
- 'assets/images/pharmacy/mobile_number_icon.svg',
- height: 13,),
- ),
- Container(
- margin: EdgeInsets.only(top: 5.0, bottom: 5.0),
- child: Text('588888778',
- style: TextStyle(fontSize: 15.0,
- ),
+ Divider(
+ color: Colors.grey[350],
+ height: 20,
+ thickness: 1,
+ indent: 0,
+ endIndent: 0,
+ ),
+ Row(
+ children: [
+ Container(
+ margin: EdgeInsets.fromLTRB(10.0, 10.0, 5.0, 10.0),
+ child: SvgPicture.asset(
+ 'assets/images/pharmacy/shipping_truck_icon.svg',
+ height: 20,
+ width: 20,),
),
- ),
- ],
- ),
- Divider(
- color: Colors.grey[350],
- height: 20,
- thickness: 1,
- indent: 0,
- endIndent: 0,
- ),
- Row(
- children: [
- Container(
- margin: EdgeInsets.fromLTRB(10.0, 10.0, 5.0, 10.0),
- child: SvgPicture.asset(
- 'assets/images/pharmacy/shipping_truck_icon.svg',
- height: 20,
- width: 20,),
- ),
- Container(
- margin: EdgeInsets.all(10.0),
- child:Text(TranslationBase.of(context).shippedMethod,
- style: TextStyle(fontSize: 13.0, fontWeight: FontWeight.bold,
+ Container(
+ margin: EdgeInsets.all(10.0),
+ child:Text(TranslationBase.of(context).shippedMethod,
+ style: TextStyle(fontSize: 13.0, fontWeight: FontWeight.bold,
+ ),
),
),
- ),
- Container(
- margin: EdgeInsets.only(bottom: 10.0, top: 10.0),
- child: SvgPicture.asset(
- 'assets/images/pharmacy/hmg_shipping_logo.svg',
- height: 25,
- width: 25,),
- ),
- ],
- ),
- Divider(
- color: Colors.grey[350],
- height: 20,
- thickness: 8,
- indent: 0,
- endIndent: 0,
- ),
- Row(
- children: [
- Container(
- margin: EdgeInsets.fromLTRB(10.0, 10.0, 1.0, 10.0),
- child: SvgPicture.asset(
- 'assets/images/pharmacy/credit_card_icon.svg',
- height: 20,
- width: 20,),
- ),
- Container(
- margin: EdgeInsets.all(10.0),
- child: SvgPicture.asset(
- 'assets/images/pharmacy/credit_card_icon.svg',
- height: 20,
- width: 20,),
- ),
- Container(
- margin: EdgeInsets.only(bottom: 10.0, top: 10.0),
- child:Text('Mada',
- style: TextStyle(fontSize: 13.0, fontWeight: FontWeight.bold,
- ),
+ Container(
+ margin: EdgeInsets.only(bottom: 10.0, top: 10.0),
+ child: SvgPicture.asset(
+ 'assets/images/pharmacy/hmg_shipping_logo.svg',
+ height: 25,
+ width: 25,),
),
- ),
- ],
- ),
- Divider(
- color: Colors.grey[350],
- height: 20,
- thickness: 8,
- indent: 0,
- endIndent: 0,
- ),
- Container(
- padding: EdgeInsets.only(bottom: 15.0),
- margin: EdgeInsets.only(left: 10.0),
- child: Row(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Text(TranslationBase.of(context).orderDetail,
- style: TextStyle(fontSize: 15.0, fontWeight: FontWeight.bold,
- ),
- ),
],
),
- ),
- Container(
- child: productTile(productName: 'Panadol Extra 500 MG', productPrice: '10.00', productRate: 3.00,
- productReviews:4, totalPrice: '10.00', qyt: '3',),
- ),
- Container(
- padding: EdgeInsets.only(bottom: 10.0),
- margin: EdgeInsets.only(left: 10.0, top: 5.0),
- child: Row(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Text(TranslationBase.of(context).orderSummary,
- style: TextStyle(fontSize: 15.0, fontWeight: FontWeight.bold,
+ Divider(
+ color: Colors.grey[350],
+ height: 20,
+ thickness: 8,
+ indent: 0,
+ endIndent: 0,
+ ),
+ Row(
+ children: [
+ Container(
+ margin: EdgeInsets.fromLTRB(10.0, 10.0, 1.0, 10.0),
+ child: SvgPicture.asset(
+ 'assets/images/pharmacy/credit_card_icon.svg',
+ height: 20,
+ width: 20,),
+ ),
+ Container(
+ margin: EdgeInsets.all(10.0),
+ child: SvgPicture.asset(
+ 'assets/images/pharmacy/credit_card_icon.svg',
+ height: 20,
+ width: 20,),
+ ),
+ Container(
+ margin: EdgeInsets.only(bottom: 10.0, top: 10.0),
+ child:Text('Mada',
+ style: TextStyle(fontSize: 13.0, fontWeight: FontWeight.bold,
),
),
+ ),
],
),
- ),
- Row(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: [
- Container(
- padding: EdgeInsets.only(bottom: 10.0),
- margin: EdgeInsets.only(top: 5.0, left: 10.0 ),
- child: Text(
- TranslationBase.of(context).subtotal,
- style: TextStyle(
- fontSize: 13.0,
- ),
- ),
- ),
- Container(
- padding: EdgeInsets.only(bottom: 10.0),
- margin: EdgeInsets.fromLTRB(10.0, 5.0, 5.0, 5.0),
- child: Row(
- children: [
- Container(
- margin: EdgeInsets.only(right: 5.0),
- child: Text(TranslationBase.of(context).sar,
- style: TextStyle(fontSize: 13.0,
- ),
+ Divider(
+ color: Colors.grey[350],
+ height: 20,
+ thickness: 8,
+ indent: 0,
+ endIndent: 0,
+ ),
+ Container(
+ padding: EdgeInsets.only(bottom: 15.0),
+ margin: EdgeInsets.only(left: 10.0),
+ child: Row(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text(TranslationBase.of(context).orderDetail,
+ style: TextStyle(fontSize: 15.0, fontWeight: FontWeight.bold,
),
),
- Text('343.55',
- style: TextStyle(fontSize: 13.0,
+ ],
+ ),
+ ),
+ Container(
+ child: productTile(productName: 'Panadol Extra 500 MG', productPrice: '10.00', productRate: 3.00,
+ productReviews:4, totalPrice: '10.00', qyt: '3',),
+ ),
+ Container(
+ padding: EdgeInsets.only(bottom: 10.0),
+ margin: EdgeInsets.only(left: 10.0, top: 5.0),
+ child: Row(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text(TranslationBase.of(context).orderSummary,
+ style: TextStyle(fontSize: 15.0, fontWeight: FontWeight.bold,
),
),
- ],
- ),
+ ],
),
- ],
- ),
- Row(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: [
- Container(
- padding: EdgeInsets.only(bottom: 10.0),
- margin: EdgeInsets.only(top: 5.0, left: 10.0 ),
- child: Text(
- TranslationBase.of(context).shipping,
- style: TextStyle(
- fontSize: 13.0,
+ ),
+ Row(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [
+ Container(
+ padding: EdgeInsets.only(bottom: 10.0),
+ margin: EdgeInsets.only(top: 5.0, left: 10.0 ),
+ child: Text(
+ TranslationBase.of(context).subtotal,
+ style: TextStyle(
+ fontSize: 13.0,
+ ),
),
),
- ),
- Container(
- padding: EdgeInsets.only(bottom: 10.0),
- margin: EdgeInsets.fromLTRB(10.0, 5.0, 5.0, 5.0),
- child: Row(
- children: [
- Container(
- margin: EdgeInsets.only(right: 5.0),
- child: Text(TranslationBase.of(context).sar,
- style: TextStyle(fontSize: 13.0,
+ Container(
+ padding: EdgeInsets.only(bottom: 10.0),
+ margin: EdgeInsets.fromLTRB(10.0, 5.0, 5.0, 5.0),
+ child: Row(
+ children: [
+ Container(
+ margin: EdgeInsets.only(right: 5.0),
+ child: Text(TranslationBase.of(context).sar,
+ style: TextStyle(fontSize: 13.0,
+ ),
),
),
- ),
- Text('343.55',
- style: TextStyle(fontSize: 13.0,
+ Text('343.55',
+ style: TextStyle(fontSize: 13.0,
+ ),
),
- ),
- ],
+ ],
+ ),
),
- ),
- ],
- ),
- Row(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: [
- Container(
- padding: EdgeInsets.only(bottom: 10.0),
- margin: EdgeInsets.only(top: 5.0,left: 10.0 ),
- child: Text(
- TranslationBase.of(context).vat,
- style: TextStyle(
- fontSize: 13.0,
+ ],
+ ),
+ Row(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [
+ Container(
+ padding: EdgeInsets.only(bottom: 10.0),
+ margin: EdgeInsets.only(top: 5.0, left: 10.0 ),
+ child: Text(
+ TranslationBase.of(context).shipping,
+ style: TextStyle(
+ fontSize: 13.0,
+ ),
),
),
- ),
- Container(
- padding: EdgeInsets.only(bottom: 10.0),
- margin: EdgeInsets.fromLTRB(10.0, 5.0, 5.0, 5.0),
- child: Row(
- children: [
- Container(
- margin: EdgeInsets.only(right: 5.0),
- child: Text(TranslationBase.of(context).sar,
+ Container(
+ padding: EdgeInsets.only(bottom: 10.0),
+ margin: EdgeInsets.fromLTRB(10.0, 5.0, 5.0, 5.0),
+ child: Row(
+ children: [
+ Container(
+ margin: EdgeInsets.only(right: 5.0),
+ child: Text(TranslationBase.of(context).sar,
+ style: TextStyle(fontSize: 13.0,
+ ),
+ ),
+ ),
+ Text('343.55',
style: TextStyle(fontSize: 13.0,
),
),
+ ],
+ ),
+ ),
+ ],
+ ),
+ Row(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [
+ Container(
+ padding: EdgeInsets.only(bottom: 10.0),
+ margin: EdgeInsets.only(top: 5.0,left: 10.0 ),
+ child: Text(
+ TranslationBase.of(context).vat,
+ style: TextStyle(
+ fontSize: 13.0,
),
- Text('343.55',
- style: TextStyle(fontSize: 13.0,
+ ),
+ ),
+ Container(
+ padding: EdgeInsets.only(bottom: 10.0),
+ margin: EdgeInsets.fromLTRB(10.0, 5.0, 5.0, 5.0),
+ child: Row(
+ children: [
+ Container(
+ margin: EdgeInsets.only(right: 5.0),
+ child: Text(TranslationBase.of(context).sar,
+ style: TextStyle(fontSize: 13.0,
+ ),
+ ),
),
- ),
- ],
+ Text('343.55',
+ style: TextStyle(fontSize: 13.0,
+ ),
+ ),
+ ],
+ ),
),
- ),
- ],
- ),
- Row(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: [
- Container(
- margin: EdgeInsets.only(top: 5.0,left: 10.0 ),
- child: Text(
- TranslationBase.of(context).total,
- style: TextStyle(
- fontSize: 15.0,fontWeight: FontWeight.bold,
+ ],
+ ),
+ Row(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [
+ Container(
+ margin: EdgeInsets.only(top: 5.0,left: 10.0 ),
+ child: Text(
+ TranslationBase.of(context).total,
+ style: TextStyle(
+ fontSize: 15.0,fontWeight: FontWeight.bold,
+ ),
),
),
- ),
- Container(
- margin: EdgeInsets.fromLTRB(10.0, 5.0, 5.0, 5.0),
- child: Row(
- children: [
- Container(
- margin: EdgeInsets.only(right: 5.0),
- child: Text(TranslationBase.of(context).sar,
- style: TextStyle(fontSize: 15.0,fontWeight: FontWeight.bold,
+ Container(
+ margin: EdgeInsets.fromLTRB(10.0, 5.0, 5.0, 5.0),
+ child: Row(
+ children: [
+ Container(
+ margin: EdgeInsets.only(right: 5.0),
+ child: Text(TranslationBase.of(context).sar,
+ style: TextStyle(fontSize: 15.0,fontWeight: FontWeight.bold,
+ ),
),
),
- ),
- Text('343.55',
- style: TextStyle(fontSize: 15.0, fontWeight: FontWeight.bold,
+ Text('343.55',
+ style: TextStyle(fontSize: 15.0, fontWeight: FontWeight.bold,
+ ),
),
- ),
- ],
+ ],
+ ),
),
- ),
- ],
- ),
- InkWell(
- onTap: (){
- },
- child: Container(
- margin: EdgeInsets.only(top: 20.0),
- height: 50.0,
- color: Colors.transparent,
+ ],
+ ),
+ InkWell(
+ onTap: (){
+ },
child: Container(
- decoration: BoxDecoration(
- border: Border.all(
- color: Colors.green,
- style: BorderStyle.solid,
- width: 1.0
- ),
- color: Colors.green,
- borderRadius: BorderRadius.circular(5.0)
- ),
- child: Center(
- child: Text(
- TranslationBase.of(context).payOnline,
- style: TextStyle(
- color: Colors.white,
- fontWeight: FontWeight.bold,
+ margin: EdgeInsets.only(top: 20.0),
+ height: 50.0,
+ color: Colors.transparent,
+ child: Container(
+ decoration: BoxDecoration(
+ border: Border.all(
+ color: Colors.green,
+ style: BorderStyle.solid,
+ width: 1.0
+ ),
+ color: Colors.green,
+ borderRadius: BorderRadius.circular(5.0)
+ ),
+ child: Center(
+ child: Text(
+ TranslationBase.of(context).payOnline,
+ style: TextStyle(
+ color: Colors.white,
+ fontWeight: FontWeight.bold,
+ ),
),
),
),
),
),
- ),
- InkWell(
- onTap: () {
+ InkWell(
+ onTap: () {
// confirmDelete(snapshot.data[index]["id"]);
- cancelOrder("id");
- },
- child: Container(
- height: 50.0,
- color: Colors.transparent,
- child: Center(
- child: Text(
- TranslationBase.of(context).cancelOrder,
- style: TextStyle(
- color: Colors.red[900],
- fontWeight: FontWeight.bold,
- decoration: TextDecoration.underline
+ cancelOrder("id");
+ },
+ child: Container(
+ height: 50.0,
+ color: Colors.transparent,
+ child: Center(
+ child: Text(
+ TranslationBase.of(context).cancelOrder,
+ style: TextStyle(
+ color: Colors.red[900],
+ fontWeight: FontWeight.bold,
+ decoration: TextDecoration.underline
+ ),
),
),
),
- ),
- ),
- ],
+ ),
+ ],
+ ),
),
),
),
diff --git a/lib/pages/pharmacy/pharmacyAddresses/AddAddress.dart b/lib/pages/pharmacy/pharmacyAddresses/AddAddress.dart
index bc19e510..30fd4cd6 100644
--- a/lib/pages/pharmacy/pharmacyAddresses/AddAddress.dart
+++ b/lib/pages/pharmacy/pharmacyAddresses/AddAddress.dart
@@ -60,18 +60,18 @@ class _AddAddressState extends State {
zoom: 13.0,
),
),
- Align(
- alignment: Alignment.topRight,
- child: Column(
- children: [
- button(_onMapTypeButtonPressed,Icons.map),
- SizedBox(
- height:16.0,
- ),
- button(_onAddMarkerButtonPressed, Icons.add_location)
- ],
- ),
- ),
+// Align(
+// alignment: Alignment.topRight,
+// child: Column(
+// children: [
+// button(_onMapTypeButtonPressed,Icons.map),
+// SizedBox(
+// height:16.0,
+// ),
+// button(_onAddMarkerButtonPressed, Icons.add_location)
+// ],
+// ),
+// ),
]
),
bottomSheet: InkWell(
@@ -112,16 +112,16 @@ class _AddAddressState extends State {
}
- Widget button(Function function, IconData icon){
- return FloatingActionButton(
- onPressed: function,
- materialTapTargetSize: MaterialTapTargetSize.padded,
- backgroundColor: Colors.red,
- child: Icon(
- icon,
- size: 18.0,
- ),);
- }
+// Widget button(Function function, IconData icon){
+// return FloatingActionButton(
+// onPressed: function,
+// materialTapTargetSize: MaterialTapTargetSize.padded,
+// backgroundColor: Colors.red,
+// child: Icon(
+// icon,
+// size: 18.0,
+// ),);
+// }
}
diff --git a/lib/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart b/lib/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart
index 2de45546..44df964d 100644
--- a/lib/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart
+++ b/lib/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart
@@ -1,4 +1,7 @@
+import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/PharmacyAddressesViewModel.dart';
+import 'package:diplomaticquarterapp/pages/base/base_view.dart';
+import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
@@ -23,7 +26,7 @@ class _PharmacyAddressesState extends State{
@override
void initState(){
- WidgetsBinding.instance.addPostFrameCallback((_) => getAllAddress());
+// WidgetsBinding.instance.addPostFrameCallback((_) => getAllAddress());
super.initState();
selectedRadio=0;
@@ -35,269 +38,273 @@ class _PharmacyAddressesState extends State{
}
Widget build (BuildContext context){
- return Scaffold(
- appBar: AppBar(
- centerTitle: true,
- title: Text(TranslationBase.of(context).changeAddress, style: TextStyle(color:Colors.white)),
- backgroundColor: Colors.green,
- ),
- body: Container(
- child:SingleChildScrollView(
- child: Column(
- children:[
- ListView.builder(
- scrollDirection: Axis.vertical,
- shrinkWrap: true,
- physics: ScrollPhysics(),
- itemCount: 5 ,
- itemBuilder: (context, index){
- return Container(
- child: Padding(
- padding:EdgeInsets.only(top:10.0, left:5.0, right:5.0, bottom:5.0,),
- child: Column(
- children: [
- Row(
- crossAxisAlignment: CrossAxisAlignment.center,
- children: [
- Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- InkWell(
- onTap: () {
- setState(() {
- _value = !_value;
- });
- },
- child: Container(
- margin: EdgeInsets.only(right: 20),
+ return BaseView(
+ onModelReady: (model) => model.getAddress(),
+ builder: (_,model, wi )=> AppScaffold(
+ appBarTitle: "",
+// centerTitle: true,
+// title: Text(TranslationBase.of(context).changeAddress, style: TextStyle(color:Colors.white)),
+// backgroundColor: Colors.green,
+ isShowAppBar: true,
+ isPharmacy:true ,
+ body: Container(
+ child:SingleChildScrollView(
+ child: Column(
+ children:[
+ ListView.builder(
+ scrollDirection: Axis.vertical,
+ shrinkWrap: true,
+ physics: ScrollPhysics(),
+ itemCount: 5 ,
+ itemBuilder: (context, index){
+ return Container(
+ child: Padding(
+ padding:EdgeInsets.only(top:10.0, left:5.0, right:5.0, bottom:5.0,),
+ child: Column(
+ children: [
+ Row(
+ crossAxisAlignment: CrossAxisAlignment.center,
+ children: [
+ Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ InkWell(
+ onTap: () {
+ setState(() {
+ _value = !_value;
+ });
+ },
+ child: Container(
+ margin: EdgeInsets.only(right: 20),
- child: Padding(
- padding: const EdgeInsets.all(5.0),
- child: _value
- ? Container(
- child: SvgPicture.asset(
- 'assets/images/pharmacy/check_icon.svg',
- height: 25,
- width: 25,),
- )
- : Container(
- child: SvgPicture.asset(
- 'assets/images/pharmacy/check_icon.svg',
- height: 23,
- width: 23,
- color: Colors.transparent,
- ),
- decoration: BoxDecoration(
- border: Border.all(
- color: Colors.grey,
- style: BorderStyle.solid,
- width: 1.0
- ),
- color: Colors.transparent,
- borderRadius: BorderRadius.circular(50.0)
+ child: Padding(
+ padding: const EdgeInsets.all(5.0),
+ child: _value
+ ? Container(
+ child: SvgPicture.asset(
+ 'assets/images/pharmacy/check_icon.svg',
+ height: 25,
+ width: 25,),
+ )
+ : Container(
+ child: SvgPicture.asset(
+ 'assets/images/pharmacy/check_icon.svg',
+ height: 23,
+ width: 23,
+ color: Colors.transparent,
),
+ decoration: BoxDecoration(
+ border: Border.all(
+ color: Colors.grey,
+ style: BorderStyle.solid,
+ width: 1.0
+ ),
+ color: Colors.transparent,
+ borderRadius: BorderRadius.circular(50.0)
),
+ ),
+ ),
),
),
- ),
- ],
- ),
- Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Text('NAME',
- style: TextStyle(fontSize: 15.0, fontWeight: FontWeight.bold,
- ),
- ),
- SizedBox(
- height: 5,),
- Text('Address',
- style: TextStyle(fontSize: 15.0, color: Colors.grey,
+ ],
+ ),
+ Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text('NAME',
+ style: TextStyle(fontSize: 15.0, fontWeight: FontWeight.bold,
+ ),
),
- ),
- SizedBox(
- height: 5,),
- Row(
- children: [
- Container(
- margin: EdgeInsets.only(bottom: 8),
- child: SvgPicture.asset(
- 'assets/images/pharmacy/mobile_number_icon.svg',
- height: 13,),
+ SizedBox(
+ height: 5,),
+ Text('Address',
+ style: TextStyle(fontSize: 15.0, color: Colors.grey,
),
- Container(
- margin: EdgeInsets.only(left: 10, bottom: 8),
- child: Text('588888778',
- style: TextStyle(fontSize: 15.0,
+ ),
+ SizedBox(
+ height: 5,),
+ Row(
+ children: [
+ Container(
+ margin: EdgeInsets.only(bottom: 8),
+ child: SvgPicture.asset(
+ 'assets/images/pharmacy/mobile_number_icon.svg',
+ height: 13,),
+ ),
+ Container(
+ margin: EdgeInsets.only(left: 10, bottom: 8),
+ child: Text('588888778',
+ style: TextStyle(fontSize: 15.0,
+ ),
),
),
- ),
- ],
- ),
- SizedBox(
- height: 15,),
- Row(
- children: [
- Column(
- children: [
- InkWell(
- onTap: () {
- Navigator.push(
- context,
- MaterialPageRoute(builder: (context) {
- return AddAddressPage();
- }),
- );
- },
- child: Row(
- children: [
- Container(
- margin: EdgeInsets.only(right:10, bottom: 15),
- child: SvgPicture.asset(
- 'assets/images/pharmacy/edit_icon.svg',
- height: 15,),
- ),
- Container(
- margin: EdgeInsets.only(right:5, bottom: 15),
- padding: EdgeInsets.only(right: 10.0),
- child: Text(TranslationBase.of(context).edit,
- style: TextStyle(fontSize: 15.0,
- color: Colors.blue,
- ),
+ ],
+ ),
+ SizedBox(
+ height: 15,),
+ Row(
+ children: [
+ Column(
+ children: [
+ InkWell(
+ onTap: () {
+ Navigator.push(
+ context,
+ MaterialPageRoute(builder: (context) {
+ return AddAddressPage();
+ }),
+ );
+ },
+ child: Row(
+ children: [
+ Container(
+ margin: EdgeInsets.only(right:10, bottom: 15),
+ child: SvgPicture.asset(
+ 'assets/images/pharmacy/edit_icon.svg',
+ height: 15,),
),
- decoration: BoxDecoration(
- border: Border(
- right: BorderSide(
- color: Colors.grey,
- width: 1.0,
+ Container(
+ margin: EdgeInsets.only(right:5, bottom: 15),
+ padding: EdgeInsets.only(right: 10.0),
+ child: Text(TranslationBase.of(context).edit,
+ style: TextStyle(fontSize: 15.0,
+ color: Colors.blue,
),
- ),
- ),
- ),
- ],
+ ),
+ decoration: BoxDecoration(
+ border: Border(
+ right: BorderSide(
+ color: Colors.grey,
+ width: 1.0,
+ ),
+ ),
+ ),
+ ),
+ ],
+ ),
),
- ),
- ],
- ),
- Column(
- children: [
- InkWell(
- onTap: () {
+ ],
+ ),
+ Column(
+ children: [
+ InkWell(
+ onTap: () {
// confirmDelete(snapshot.data[index]["id"]);
- confirmDelete("address");
- },
- child: Row(
- children: [
- Container(
- margin: EdgeInsets.only(left: 15, right: 10, bottom: 15),
- child: SvgPicture.asset(
- 'assets/images/pharmacy/delete_red_icon.svg',
- height: 15,),
- ),
- Container(
- margin: EdgeInsets.only(bottom: 15),
- child: Text(TranslationBase.of(context).delete,
- style: TextStyle(fontSize: 15.0,
- color: Colors.redAccent,
+ confirmDelete("address");
+ },
+ child: Row(
+ children: [
+ Container(
+ margin: EdgeInsets.only(left: 15, right: 10, bottom: 15),
+ child: SvgPicture.asset(
+ 'assets/images/pharmacy/delete_red_icon.svg',
+ height: 15,),
+ ),
+ Container(
+ margin: EdgeInsets.only(bottom: 15),
+ child: Text(TranslationBase.of(context).delete,
+ style: TextStyle(fontSize: 15.0,
+ color: Colors.redAccent,
+ ),
),
),
- ),
- ],
+ ],
+ ),
),
- ),
- ],
- )
- ],
- ),
- ],
- ),
- SizedBox(
- height: 10,
- ),
- ],
- ),
- Divider(
- color: Colors.grey[350],
- height: 20,
- thickness: 6,
- indent: 0,
- endIndent: 0,
- ),
- ],
+ ],
+ )
+ ],
+ ),
+ ],
+ ),
+ SizedBox(
+ height: 10,
+ ),
+ ],
+ ),
+ Divider(
+ color: Colors.grey[350],
+ height: 20,
+ thickness: 6,
+ indent: 0,
+ endIndent: 0,
+ ),
+ ],
+ ),
),
- ),
- );
- }
- ),
- SizedBox(
- height: 10,
- ),
- InkWell(
- onTap: () {
- Navigator.push(
- context,
- MaterialPageRoute(builder: (context) {
- return AddAddressPage();
- }),
- );
- },
- child: Container(
- margin: EdgeInsets.only(bottom: 100.0),
- height: 50.0,
- color: Colors.transparent,
+ );
+ }
+ ),
+ SizedBox(
+ height: 10,
+ ),
+ InkWell(
+ onTap: () {
+ Navigator.push(
+ context,
+ MaterialPageRoute(builder: (context) {
+ return AddAddressPage();
+ }),
+ );
+ },
child: Container(
- decoration: BoxDecoration(
- border: Border.all(
- color: Colors.green,
- style: BorderStyle.solid,
- width: 1.0
- ),
- color: Colors.transparent,
- borderRadius: BorderRadius.circular(5.0)
- ),
- child: Center(
- child: Text(
- TranslationBase.of(context).addAddress,
- style: TextStyle(
+ margin: EdgeInsets.only(bottom: 100.0),
+ height: 50.0,
+ color: Colors.transparent,
+ child: Container(
+ decoration: BoxDecoration(
+ border: Border.all(
color: Colors.green,
- fontWeight: FontWeight.bold,
+ style: BorderStyle.solid,
+ width: 1.0
+ ),
+ color: Colors.transparent,
+ borderRadius: BorderRadius.circular(5.0)
+ ),
+ child: Center(
+ child: Text(
+ TranslationBase.of(context).addAddress,
+ style: TextStyle(
+ color: Colors.green,
+ fontWeight: FontWeight.bold,
+ ),
),
),
),
),
),
- ),
- ],
+ ],
+ ),
),
),
- ),
- bottomSheet: InkWell(
- onTap: () {
- Navigator.push(
- context,
- MaterialPageRoute(builder: (context) {
- return AddAddressPage();
- }),
- );
- },
- child: Container(
- height: 50.0,
- color: Colors.green,
+ bottomSheet: InkWell(
+ onTap: () {
+ Navigator.push(
+ context,
+ MaterialPageRoute(builder: (context) {
+ return AddAddressPage();
+ }),
+ );
+ },
child: Container(
- decoration: BoxDecoration(
- border: Border.all(
- color: Colors.green,
- style: BorderStyle.solid,
- width: 1.0
- ),
- color: Colors.green,
- borderRadius: BorderRadius.circular(5.0)
- ),
- child: Center(
- child: Text(TranslationBase.of(context).confirmAddress,
- style: TextStyle(
- color: Colors.white,
- fontWeight: FontWeight.bold,
+ height: 50.0,
+ color: Colors.green,
+ child: Container(
+ decoration: BoxDecoration(
+ border: Border.all(
+ color: Colors.green,
+ style: BorderStyle.solid,
+ width: 1.0
+ ),
+ color: Colors.green,
+ borderRadius: BorderRadius.circular(5.0)
+ ),
+ child: Center(
+ child: Text(TranslationBase.of(context).confirmAddress,
+ style: TextStyle(
+ color: Colors.white,
+ fontWeight: FontWeight.bold,
+ ),
),
),
),
@@ -347,11 +354,11 @@ class _PharmacyAddressesState extends State{
}
getAllAddress() {
- print("ADDRESSES");
- PharmacyAddressService service = new PharmacyAddressService();
- service.getAddress(AppGlobal.context).then((res) {
- print(res);
- });
+// print("ADDRESSES");
+// PharmacyAddressService service = new PharmacyAddressService();
+// service.getAddress(AppGlobal.context).then((res) {
+// print(res);
+// });
}
diff --git a/lib/services/pharmacy_services/orderDetails_service.dart b/lib/services/pharmacy_services/orderDetails_service.dart
index b8201dc6..fb58097f 100644
--- a/lib/services/pharmacy_services/orderDetails_service.dart
+++ b/lib/services/pharmacy_services/orderDetails_service.dart
@@ -1,6 +1,7 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
+import 'package:diplomaticquarterapp/core/model/pharmacies/order_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';
@@ -16,24 +17,23 @@ class OrderDetailsService extends BaseService{
AuthenticatedUser authUser = new AuthenticatedUser();
AuthProvider authProvider = new AuthProvider();
- Future