Merge branch 'development' into Haroon

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

@ -1,3 +1,5 @@
import 'package:google_maps_flutter/google_maps_flutter.dart';
class BillingAddress { class BillingAddress {
String id; String id;
String firstName; String firstName;
@ -81,4 +83,19 @@ class BillingAddress {
data['lat_long'] = this.latLong; data['lat_long'] = this.latLong;
return data; return data;
} }
LatLng getLocation(){
if(latLong.contains(',')){
var parts = latLong.trim().split(',');
if(parts.length == 2){
var lat = double.tryParse(parts.first);
var lng = double.tryParse(parts.last);
if(lat != null || lng != null) {
var location = LatLng(lat, lng);
return location;
}
}
}
return null;
}
} }

@ -32,6 +32,7 @@ class Customer {
String lastLoginDateUtc; String lastLoginDateUtc;
String lastActivityDateUtc; String lastActivityDateUtc;
int registeredInStoreId; int registeredInStoreId;
List<int> roleIds;
Customer( Customer(
{this.billingAddress, {this.billingAddress,
@ -63,7 +64,8 @@ class Customer {
this.createdOnUtc, this.createdOnUtc,
this.lastLoginDateUtc, this.lastLoginDateUtc,
this.lastActivityDateUtc, this.lastActivityDateUtc,
this.registeredInStoreId}); this.registeredInStoreId,
this.roleIds});
Customer.fromJson(Map<String, dynamic> json) { Customer.fromJson(Map<String, dynamic> json) {
billingAddress = json['billing_address'] != null billingAddress = json['billing_address'] != null
@ -105,6 +107,7 @@ class Customer {
lastLoginDateUtc = json['last_login_date_utc']; lastLoginDateUtc = json['last_login_date_utc'];
lastActivityDateUtc = json['last_activity_date_utc']; lastActivityDateUtc = json['last_activity_date_utc'];
registeredInStoreId = json['registered_in_store_id']; registeredInStoreId = json['registered_in_store_id'];
roleIds = json['role_ids'].cast<int>();
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -145,6 +148,7 @@ class Customer {
data['last_login_date_utc'] = this.lastLoginDateUtc; data['last_login_date_utc'] = this.lastLoginDateUtc;
data['last_activity_date_utc'] = this.lastActivityDateUtc; data['last_activity_date_utc'] = this.lastActivityDateUtc;
data['registered_in_store_id'] = this.registeredInStoreId; data['registered_in_store_id'] = this.registeredInStoreId;
data['role_ids'] = this.roleIds;
return data; return data;
} }
} }

@ -7,22 +7,33 @@ class ShoppingCart {
// List<Null> productAttributes; // List<Null> productAttributes;
double customerEnteredPrice; double customerEnteredPrice;
int quantity; int quantity;
String discountAmountInclTax; dynamic discountAmountInclTax;
String subtotal; dynamic subtotal;
String subtotalWithVat; dynamic subtotalWithVat;
String subtotalVatAmount; dynamic subtotalVatAmount;
String subtotalVatRate; dynamic subtotalVatRate;
String currency; dynamic currency;
String currencyn; dynamic currencyn;
String rentalStartDateUtc; dynamic rentalStartDateUtc;
String rentalEndDateUtc; dynamic rentalEndDateUtc;
String createdOnUtc; dynamic createdOnUtc;
String updatedOnUtc; dynamic updatedOnUtc;
String shoppingCartType; dynamic shoppingCartType;
int productId; int productId;
PharmacyProduct product; PharmacyProduct product;
int customerId; int customerId;
Customer customer; Customer customer;
double unitPriceInclTax;
double unitPriceExclTax;
double priceInclTax;
double priceExclTax;
dynamic discountAmountExclTax;
double originalProductCost;
String attributeDescription;
int downloadCount;
bool isDownloadActivated;
int licenseDownloadId;
double itemWeight;
ShoppingCart( ShoppingCart(
{this.languageId, {this.languageId,
@ -45,7 +56,19 @@ class ShoppingCart {
this.productId, this.productId,
this.product, this.product,
this.customerId, this.customerId,
this.customer}); this.customer,
this.unitPriceInclTax,
this.unitPriceExclTax,
this.priceInclTax,
this.priceExclTax,
this.discountAmountExclTax,
this.originalProductCost,
this.attributeDescription,
this.downloadCount,
this.isDownloadActivated,
this.licenseDownloadId,
this.itemWeight,
});
ShoppingCart.fromJson(Map<String, dynamic> json) { ShoppingCart.fromJson(Map<String, dynamic> json) {
languageId = json['language_id']; languageId = json['language_id'];
@ -78,6 +101,18 @@ class ShoppingCart {
customer = json['customer'] != null customer = json['customer'] != null
? new Customer.fromJson(json['customer']) ? new Customer.fromJson(json['customer'])
: null; : null;
unitPriceInclTax = json['unit_price_incl_tax'];
unitPriceExclTax = json['unit_price_excl_tax'];
priceInclTax = json['price_incl_tax'];
priceExclTax = json['price_excl_tax'];
discountAmountExclTax = json['discount_amount_excl_tax'];
originalProductCost = json['original_product_cost'];
attributeDescription = json['attribute_description'];
downloadCount = json['download_count'];
isDownloadActivated = json['isDownload_activated'];
licenseDownloadId = json['license_download_id'];
itemWeight = json['item_weight'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -110,6 +145,18 @@ class ShoppingCart {
if (this.customer != null) { if (this.customer != null) {
data['customer'] = this.customer.toJson(); data['customer'] = this.customer.toJson();
} }
data['unit_price_incl_tax'] = this.unitPriceInclTax;
data['unit_price_excl_tax'] = this.unitPriceExclTax;
data['price_incl_tax'] = this.priceInclTax;
data['price_excl_tax'] = this.priceExclTax;
data['discount_amount_excl_tax'] = this.discountAmountExclTax;
data['original_product_cost'] = this.originalProductCost;
data['attribute_description'] = this.attributeDescription;
data['download_count'] = this.downloadCount;
data['isDownload_activated'] = this.isDownloadActivated;
data['license_download_id'] = this.licenseDownloadId;
data['item_weight'] = this.itemWeight;
return data; return data;
} }
} }

@ -0,0 +1,297 @@
import 'package:diplomaticquarterapp/core/model/pharmacies/BillingAddress.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/Customer.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/ShoppingCart.dart';
class OrderDetailModel {
String id;
int storeId;
String orderGuid;
bool pickUpInStore;
String paymentMethodSystemName;
String paymentName;
String paymentNamen;
String 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;
dynamic productCount;
dynamic orderTotal;
dynamic refundedAmount;
dynamic rewardPointsWereAdded;
dynamic rxAttachments;
String checkoutAttributeDescription;
int customerLanguageId;
int affiliateId;
String customerIp;
dynamic authorizationTransactionId;
dynamic authorizationTransactionCode;
dynamic authorizationTransactionResult;
dynamic captureTransactionId;
dynamic captureTransactionResult;
dynamic subscriptionTransactionId;
dynamic paidDateUtc;
String shippingMethod;
String shippingRateComputationMethodSystemName;
String customValuesXml;
bool deleted;
String createdOnUtc;
Customer customer;
int customerId;
BillingAddress billingAddress;
BillingAddress shippingAddress;
List<ShoppingCart> orderItems;
int orderStatusId;
String orderStatus;
String orderStatusn;
int paymentStatusId;
String paymentStatus;
String paymentStatusn;
String shippingStatus;
String shippingStatusn;
String customerTaxDisplayType;
bool canCancel;
bool canRefund;
dynamic lakumAmount;
String preferDeliveryDate;
String preferDeliveryTime;
String preferDeliveryTimen;
OrderDetailModel(
{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.productCount,
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});
OrderDetailModel.fromJson(Map<String, dynamic> json) {
id = json['id'];
storeId = json['store_id'];
orderGuid = json['order_guid'];
pickUpInStore = json['pick_up_in_store'];
paymentMethodSystemName = json['payment_method_system_name'];
paymentName = json['payment_name'];
paymentNamen = json['payment_namen'];
customerCurrencyCode = 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'];
orderSubtotalExclTax = json['order_subtotal_excl_tax'];
orderSubTotalDiscountInclTax = json['order_sub_total_discount_incl_tax'];
orderSubTotalDiscountExclTax = json['order_sub_total_discount_excl_tax'];
orderShippingInclTax = json['order_shipping_incl_tax'];
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'];
orderDiscount = json['order_discount'];
productCount = json['product_count'];
orderTotal = json['order_total'];
refundedAmount = json['refunded_amount'];
rewardPointsWereAdded = json['reward_points_were_added'];
rxAttachments = json['rx_attachments'];
checkoutAttributeDescription = json['checkout_attribute_description'];
customerLanguageId = json['customer_language_id'];
affiliateId = json['affiliate_id'];
customerIp = json['customer_ip'];
authorizationTransactionId = 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'];
shippingMethod = json['shipping_method'];
shippingRateComputationMethodSystemName =
json['shipping_rate_computation_method_system_name'];
customValuesXml = json['custom_values_xml'];
deleted = json['deleted'];
createdOnUtc = json['created_on_utc'];
customer = json['customer'] != null
? new Customer.fromJson(json['customer'])
: null;
customerId = json['customer_id'];
billingAddress = json['billing_address'] != null
? new BillingAddress.fromJson(json['billing_address'])
: null;
shippingAddress = json['shipping_address'] != null
? new BillingAddress.fromJson(json['shipping_address'])
: null;
if (json['order_items'] != null) {
orderItems = new List<ShoppingCart>();
json['order_items'].forEach((v) {
orderItems.add(new ShoppingCart.fromJson(v));
});
}
orderStatusId = json['order_status_id'];
orderStatus = json['order_status'];
orderStatusn = json['order_statusn'];
paymentStatusId = json['payment_status_id'];
paymentStatus = json['payment_status'];
paymentStatusn = json['payment_statusn'];
shippingStatus = json['shipping_status'];
shippingStatusn = json['shipping_statusn'];
customerTaxDisplayType = json['customer_tax_display_type'];
canCancel = json['can_cancel'];
canRefund = json['can_refund'];
lakumAmount = json['lakum_amount'];
preferDeliveryDate = json['prefer_delivery_date'];
preferDeliveryTime = json['prefer_delivery_time'];
preferDeliveryTimen = json['prefer_delivery_timen'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['store_id'] = this.storeId;
data['order_guid'] = this.orderGuid;
data['pick_up_in_store'] = this.pickUpInStore;
data['payment_method_system_name'] = this.paymentMethodSystemName;
data['payment_name'] = this.paymentName;
data['payment_namen'] = this.paymentNamen;
data['customer_currency_code'] = this.customerCurrencyCode;
data['currency_rate'] = this.currencyRate;
data['customer_tax_display_type_id'] = this.customerTaxDisplayTypeId;
data['vat_number'] = this.vatNumber;
data['order_subtotal_incl_tax'] = this.orderSubtotalInclTax;
data['order_subtotal_excl_tax'] = this.orderSubtotalExclTax;
data['order_sub_total_discount_incl_tax'] =
this.orderSubTotalDiscountInclTax;
data['order_sub_total_discount_excl_tax'] =
this.orderSubTotalDiscountExclTax;
data['order_shipping_incl_tax'] = this.orderShippingInclTax;
data['order_shipping_excl_tax'] = this.orderShippingExclTax;
data['payment_method_additional_fee_incl_tax'] =
this.paymentMethodAdditionalFeeInclTax;
data['payment_method_additional_fee_excl_tax'] =
this.paymentMethodAdditionalFeeExclTax;
data['tax_rates'] = this.taxRates;
data['order_tax'] = this.orderTax;
data['order_discount'] = this.orderDiscount;
data['product_count'] = this.productCount;
data['order_total'] = this.orderTotal;
data['refunded_amount'] = this.refundedAmount;
data['reward_points_were_added'] = this.rewardPointsWereAdded;
data['rx_attachments'] = this.rxAttachments;
data['checkout_attribute_description'] = this.checkoutAttributeDescription;
data['customer_language_id'] = this.customerLanguageId;
data['affiliate_id'] = this.affiliateId;
data['customer_ip'] = this.customerIp;
data['authorization_transaction_id'] = this.authorizationTransactionId;
data['authorization_transaction_code'] = this.authorizationTransactionCode;
data['authorization_transaction_result'] =
this.authorizationTransactionResult;
data['capture_transaction_id'] = this.captureTransactionId;
data['capture_transaction_result'] = this.captureTransactionResult;
data['subscription_transaction_id'] = this.subscriptionTransactionId;
data['paid_date_utc'] = this.paidDateUtc;
data['shipping_method'] = this.shippingMethod;
data['shipping_rate_computation_method_system_name'] =
this.shippingRateComputationMethodSystemName;
data['custom_values_xml'] = this.customValuesXml;
data['deleted'] = this.deleted;
data['created_on_utc'] = this.createdOnUtc;
if (this.customer != null) {
data['customer'] = this.customer.toJson();
}
data['customer_id'] = this.customerId;
if (this.billingAddress != null) {
data['billing_address'] = this.billingAddress.toJson();
}
if (this.shippingAddress != null) {
data['shipping_address'] = this.shippingAddress.toJson();
}
if (this.orderItems != null) {
data['order_items'] = this.orderItems.map((v) => v.toJson()).toList();
}
data['order_status_id'] = this.orderStatusId;
data['order_status'] = this.orderStatus;
data['order_statusn'] = this.orderStatusn;
data['payment_status_id'] = this.paymentStatusId;
data['payment_status'] = this.paymentStatus;
data['payment_statusn'] = this.paymentStatusn;
data['shipping_status'] = this.shippingStatus;
data['shipping_statusn'] = this.shippingStatusn;
data['customer_tax_display_type'] = this.customerTaxDisplayType;
data['can_cancel'] = this.canCancel;
data['can_refund'] = this.canRefund;
data['lakum_amount'] = this.lakumAmount;
data['prefer_delivery_date'] = this.preferDeliveryDate;
data['prefer_delivery_time'] = this.preferDeliveryTime;
data['prefer_delivery_timen'] = this.preferDeliveryTimen;
return data;
}
}

@ -9,6 +9,71 @@ List<OrderModel> orderModelFromJson(String str) => List<OrderModel>.from(json.de
String orderModelToJson(List<OrderModel> data) => json.encode(List<dynamic>.from(data.map((x) => x.toJson()))); String orderModelToJson(List<OrderModel> data) => json.encode(List<dynamic>.from(data.map((x) => x.toJson())));
class OrderModel { class OrderModel {
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;
dynamic productCount;
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<OrderItem> 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;
OrderModel({ OrderModel({
this.id, this.id,
this.storeId, this.storeId,
@ -75,70 +140,6 @@ class OrderModel {
this.preferDeliveryTimen, 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;
dynamic productCount;
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<OrderItem> 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<String, dynamic> json) => OrderModel( factory OrderModel.fromJson(Map<String, dynamic> json) => OrderModel(
id: json["id"], id: json["id"],
storeId: json["store_id"], storeId: json["store_id"],
@ -1470,6 +1471,3 @@ class EnumValues<T> {
return reverseMap; return reverseMap;
} }
} }

@ -1,4 +1,6 @@
import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart';
import 'package:diplomaticquarterapp/core/model/pharmacy/brands_model.dart'; import 'package:diplomaticquarterapp/core/model/pharmacy/brands_model.dart';
import 'package:diplomaticquarterapp/core/model/pharmacy/categorise_parent_model.dart'; import 'package:diplomaticquarterapp/core/model/pharmacy/categorise_parent_model.dart';
import 'package:diplomaticquarterapp/core/model/pharmacy/final_products_model.dart'; import 'package:diplomaticquarterapp/core/model/pharmacy/final_products_model.dart';
@ -21,20 +23,20 @@ class PharmacyCategoriseService extends BaseService {
List<CategoriseParentModel> get parentCategoriseList => _parentCategoriseList; List<CategoriseParentModel> get parentCategoriseList => _parentCategoriseList;
//service three //service three
List<ParentProductsModel> _parentProductsList = List(); List<PharmacyProduct> _parentProductsList = List();
List<ParentProductsModel> get parentProductsList => _parentProductsList; List<PharmacyProduct> get parentProductsList => _parentProductsList;
//service four //service four
List<SubCategoriesModel> _subCategoriseList = List(); List<SubCategoriesModel> _subCategoriseList = List();
List<SubCategoriesModel> get subCategoriseList => _subCategoriseList; List<SubCategoriesModel> get subCategoriseList => _subCategoriseList;
//service five //service five
List<SubProductsModel> _subProductsList = List(); List<PharmacyProduct> _subProductsList = List();
List<SubProductsModel> get subProductsList => _subProductsList; List<PharmacyProduct> get subProductsList => _subProductsList;
//service six //service six
List<FinalProductsModel> _finalProducts = List(); List<PharmacyProduct> _finalProducts = List();
List<FinalProductsModel> get finalProducts => _finalProducts; List<PharmacyProduct> get finalProducts => _finalProducts;
//service 7 //service 7
@ -43,8 +45,8 @@ class PharmacyCategoriseService extends BaseService {
// service 8 // service 8
List<SearchProductsModel> _searchList = List(); List<PharmacyProduct> _searchList = List();
List<SearchProductsModel> get searchList => _searchList; List<PharmacyProduct> get searchList => _searchList;
List<ScanQrModel> _scanList = List(); List<ScanQrModel> _scanList = List();
List<ScanQrModel> get scanList => _scanList; List<ScanQrModel> get scanList => _scanList;
@ -100,7 +102,7 @@ class PharmacyCategoriseService extends BaseService {
endPoint, endPoint,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
response['products'].forEach((item) { response['products'].forEach((item) {
_searchList.add(SearchProductsModel.fromJson(item)); _searchList.add(PharmacyProduct.fromJson(item));
}); });
}, },
onFailure: (String error, int statusCode) { onFailure: (String error, int statusCode) {
@ -156,7 +158,7 @@ class PharmacyCategoriseService extends BaseService {
endPoint, endPoint,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
response['products'].forEach((item) { response['products'].forEach((item) {
_parentProductsList.add(ParentProductsModel.fromJson(item)); _parentProductsList.add(PharmacyProduct.fromJson(item));
}); });
}, },
onFailure: (String error, int statusCode) { onFailure: (String error, int statusCode) {
@ -196,7 +198,7 @@ class PharmacyCategoriseService extends BaseService {
endPoint, endPoint,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
response['products'].forEach((item) { response['products'].forEach((item) {
_subProductsList.add(SubProductsModel.fromJson(item)); _subProductsList.add(PharmacyProduct.fromJson(item));
}); });
}, },
onFailure: (String error, int statusCode) { onFailure: (String error, int statusCode) {
@ -215,7 +217,7 @@ class PharmacyCategoriseService extends BaseService {
endPoint, endPoint,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
response['products'].forEach((item) { response['products'].forEach((item) {
_finalProducts.add(FinalProductsModel.fromJson(item)); _finalProducts.add(PharmacyProduct.fromJson(item));
}); });
}, },
onFailure: (String error, int statusCode) { onFailure: (String error, int statusCode) {
@ -229,18 +231,64 @@ class PharmacyCategoriseService extends BaseService {
hasError = false; hasError = false;
Map<String, String> queryParams = {'ManufacturerId': id}; Map<String, String> queryParams = {'ManufacturerId': id};
manufacturerProducts.clear(); _finalProducts.clear();
await baseAppClient.getPharmacy( await baseAppClient.getPharmacy(
GET_BRAND_ITEMS, GET_BRAND_ITEMS,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
response['products'].forEach((item) { response['products'].forEach((item) {
manufacturerProducts.add(FinalProductsModel.fromJson(item)); _finalProducts.add(PharmacyProduct.fromJson(item));
}); });
}, },
onFailure: (String error, int statusCode) { onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, queryParams: queryParams, },
queryParams: queryParams,
); );
} }
Future getLastVisitedProducts() async {
String lastVisited = "";
if (await this.sharedPref.getString(PHARMACY_LAST_VISITED_PRODUCTS) !=
null) {
lastVisited =
await this.sharedPref.getString(PHARMACY_LAST_VISITED_PRODUCTS);
try {
await baseAppClient
.getPharmacy("$GET_PHARMACY_PRODUCTs_BY_IDS$lastVisited",
onSuccess: (dynamic response, int statusCode) {
_finalProducts.clear();
response['products'].forEach((item) {
_finalProducts.add(PharmacyProduct.fromJson(item));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
});
} catch (error) {
throw error;
}
}
}
Future getBestSellerProducts() async {
Map<String, String> queryParams = {
'fields':
'id,discount_ids,name,namen,localized_names,display_order,short_description,full_description,full_descriptionn,sku,order_minimum_quantity,order_maximum_quantity,price,old_price,images,is_rx,rx_message,rx_messagen,discount_name,discount_namen,approved_rating_sum,approved_total_reviews,allow_back_in_stock_subscriptions,stock_quantity,stock_availability,stock_availabilityn,discount_percentage,reviews',
};
try {
await baseAppClient.getPharmacy(GET_PHARMACY_BEST_SELLER_PRODUCT,
onSuccess: (dynamic response, int statusCode) {
_finalProducts.clear();
response['products'].forEach((item) {
_finalProducts.add(PharmacyProduct.fromJson(item));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, queryParams: queryParams);
} catch (error) {
throw error;
}
}
} }

@ -185,7 +185,7 @@ class OrderPreviewViewModel extends BaseViewModel {
await _orderService.makeOrder(paymentCheckoutData, cartResponse.shoppingCarts); await _orderService.makeOrder(paymentCheckoutData, cartResponse.shoppingCarts);
if (_orderService.hasError) { if (_orderService.hasError) {
error = _orderService.error; error = _orderService.error;
setState(ViewState.Error); setState(ViewState.ErrorLocal);
} else { } else {
setState(ViewState.Idle); setState(ViewState.Idle);
} }

@ -1,18 +1,17 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/Addresses.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/Addresses.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/LacumAccountInformation.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/LacumAccountInformation.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/ShoppingCartResponse.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/ShoppingCartResponse.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/order_detail.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/payment-checkout-data.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/payment-checkout-data.dart';
import 'package:diplomaticquarterapp/core/service/parmacyModule/order-preview-service.dart'; import 'package:diplomaticquarterapp/core/service/parmacyModule/order-preview-service.dart';
import 'package:diplomaticquarterapp/pages/pharmacy/order/Order.dart';
import 'package:diplomaticquarterapp/pages/pharmacy/order/OrderDetails.dart';
import 'package:diplomaticquarterapp/services/pharmacy_services/cancelOrder_service.dart'; import 'package:diplomaticquarterapp/services/pharmacy_services/cancelOrder_service.dart';
import 'package:diplomaticquarterapp/services/pharmacy_services/orderDetails_service.dart'; import 'package:diplomaticquarterapp/services/pharmacy_services/orderDetails_service.dart';
import 'package:diplomaticquarterapp/services/pharmacy_services/order_service.dart'; import 'package:diplomaticquarterapp/services/pharmacy_services/order_service.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/order_model.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/order_model.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/orders_model.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/orders_model.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:flutter/material.dart';
import '../../../locator.dart'; import '../../../locator.dart';
import '../base_view_model.dart'; import '../base_view_model.dart';
@ -21,10 +20,10 @@ class OrderModelViewModel extends BaseViewModel {
List<Orders> get orders => _orderService.orderList; List<Orders> get orders => _orderService.orderList;
OrderDetailsService _orderDetailsService = locator<OrderDetailsService>(); OrderDetailsService _orderDetailsService = locator<OrderDetailsService>();
List<OrderModel> get orderListModel => _orderDetailsService.orderList; List<OrderDetailModel> get orderListModel => _orderDetailsService.orderList;
CancelOrderService _cancelOrderService = locator<CancelOrderService>(); CancelOrderService _cancelOrderService = locator<CancelOrderService>();
List<OrderModel> get cancelOrder => _cancelOrderService.cancelOrderList; List<OrderDetailModel> get cancelOrder => _cancelOrderService.cancelOrderList;
OrderPreviewService _orderServices = locator<OrderPreviewService>(); OrderPreviewService _orderServices = locator<OrderPreviewService>();
@ -98,7 +97,7 @@ class OrderModelViewModel extends BaseViewModel {
return res; return res;
} }
Future makeReview(Product product, double rating, String reviewText) async { Future makeReview(PharmacyProduct product, double rating, String reviewText) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _orderDetailsService.makeReview(product, rating, reviewText); await _orderDetailsService.makeReview(product, rating, reviewText);
if (_orderDetailsService.hasError) { if (_orderDetailsService.hasError) {

@ -1,4 +1,5 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart';
import 'package:diplomaticquarterapp/core/model/pharmacy/brands_model.dart'; import 'package:diplomaticquarterapp/core/model/pharmacy/brands_model.dart';
import 'package:diplomaticquarterapp/core/model/pharmacy/categorise_parent_model.dart'; import 'package:diplomaticquarterapp/core/model/pharmacy/categorise_parent_model.dart';
import 'package:diplomaticquarterapp/core/model/pharmacy/final_products_model.dart'; import 'package:diplomaticquarterapp/core/model/pharmacy/final_products_model.dart';
@ -16,22 +17,29 @@ import 'base_view_model.dart';
class PharmacyCategoriseViewModel extends BaseViewModel { class PharmacyCategoriseViewModel extends BaseViewModel {
bool hasError = false; bool hasError = false;
PharmacyCategoriseService _pharmacyCategoriseService = locator<PharmacyCategoriseService>(); PharmacyCategoriseService _pharmacyCategoriseService =
locator<PharmacyCategoriseService>();
List<PharmacyCategorise> get categorise => _pharmacyCategoriseService.categoriseList; List<PharmacyCategorise> get categorise =>
_pharmacyCategoriseService.categoriseList;
List<CategoriseParentModel> get categoriseParent => _pharmacyCategoriseService.parentCategoriseList; List<CategoriseParentModel> get categoriseParent =>
_pharmacyCategoriseService.parentCategoriseList;
List<ParentProductsModel> get parentProducts => _pharmacyCategoriseService.parentProductsList; List<PharmacyProduct> get parentProducts =>
_pharmacyCategoriseService.parentProductsList;
List<SubCategoriesModel> get subCategorise => _pharmacyCategoriseService.subCategoriseList; List<SubCategoriesModel> get subCategorise =>
_pharmacyCategoriseService.subCategoriseList;
List<SubProductsModel> get subProducts => _pharmacyCategoriseService.subProductsList; List<PharmacyProduct> get subProducts =>
_pharmacyCategoriseService.subProductsList;
List<FinalProductsModel> get finalProducts => _pharmacyCategoriseService.finalProducts; List<PharmacyProduct> get finalProducts =>
_pharmacyCategoriseService.finalProducts;
List<BrandsModel> get brandsList => _pharmacyCategoriseService.brandsList; List<BrandsModel> get brandsList => _pharmacyCategoriseService.brandsList;
List<SearchProductsModel> get searchList => _pharmacyCategoriseService.searchList; List<PharmacyProduct> get searchList => _pharmacyCategoriseService.searchList;
List<ScanQrModel> get scanList => _pharmacyCategoriseService.scanList; List<ScanQrModel> get scanList => _pharmacyCategoriseService.scanList;
@ -158,4 +166,26 @@ class PharmacyCategoriseViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
} }
Future getLastVisitedProducts() async {
setState(ViewState.Busy);
await _pharmacyCategoriseService.getLastVisitedProducts();
if (_pharmacyCategoriseService.hasError) {
error = _pharmacyCategoriseService.error;
setState(ViewState.Error);
} else {
setState(ViewState.Idle);
}
}
Future getBestSellerProducts() async {
setState(ViewState.Busy);
await _pharmacyCategoriseService.getBestSellerProducts();
if (_pharmacyCategoriseService.hasError) {
error = _pharmacyCategoriseService.error;
setState(ViewState.Error);
} else {
setState(ViewState.Idle);
}
}
} }

@ -1,16 +1,18 @@
import 'package:diplomaticquarterapp/core/viewModels/pharmacy_categorise_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacy_categorise_view_model.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/product_detail.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/StarRating.dart'; import 'package:diplomaticquarterapp/widgets/others/StarRating.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_pharmacy_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_pharmacy_widget.dart';
import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart'; import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'base/base_view.dart'; import 'base/base_view.dart';
class FinalProductsPage extends StatefulWidget { class FinalProductsPage extends StatefulWidget {
final String id; final String id;
final int productType; final int productType; // 1 : default, 2 : manufacturer , 3 : recently viewed
FinalProductsPage({this.id, this.productType = 1}); FinalProductsPage({this.id, this.productType = 1});
@ -20,9 +22,7 @@ class FinalProductsPage extends StatefulWidget {
class _FinalProductsPageState extends State<FinalProductsPage> { class _FinalProductsPageState extends State<FinalProductsPage> {
String id; String id;
_FinalProductsPageState({this.id}); _FinalProductsPageState({this.id});
String categoriseName = "Personal Care"; String categoriseName = "Personal Care";
bool styleOne = true; bool styleOne = true;
bool styleTwo = false; bool styleTwo = false;
@ -31,13 +31,21 @@ class _FinalProductsPageState extends State<FinalProductsPage> {
color: Colors.blue, color: Colors.blue,
size: 29.0, size: 29.0,
); );
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<PharmacyCategoriseViewModel>( return BaseView<PharmacyCategoriseViewModel>(
onModelReady: (model) => widget.productType == 1 onModelReady: (model) {
? model.getFinalProducts(i: id) if (widget.productType == 1) {
: model.getManufacturerProducts(id), model.getFinalProducts(i: id);
} else if (widget.productType == 2) {
model.getManufacturerProducts(id);
} else if (widget.productType == 3) {
model.getLastVisitedProducts();
} else {
model.getBestSellerProducts();
}
},
allowAny: true,
builder: (BuildContext context, PharmacyCategoriseViewModel model, builder: (BuildContext context, PharmacyCategoriseViewModel model,
Widget child) => Widget child) =>
PharmacyAppScaffold( PharmacyAppScaffold(
@ -126,193 +134,220 @@ class _FinalProductsPageState extends State<FinalProductsPage> {
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
return NetworkBaseView( return NetworkBaseView(
baseViewModel: model, baseViewModel: model,
child: Card( child: InkWell(
color: model.finalProducts[index] child: Card(
.discountName != color: model.finalProducts[index]
null .discountName !=
? Color(0xffFFFF00) null
: Colors.white, ? Color(0xffFFFF00)
elevation: 0, : Colors.white,
shape: Border( elevation: 0,
right: BorderSide( shape: Border(
color: Colors.grey.shade300, right: BorderSide(
width: 1, color: Colors.grey.shade300,
), width: 1,
left: BorderSide( ),
color: Colors.grey.shade300, left: BorderSide(
width: 1, color: Colors.grey.shade300,
), width: 1,
bottom: BorderSide( ),
color: Colors.grey.shade300, bottom: BorderSide(
width: 1, color: Colors.grey.shade300,
width: 1,
),
top: BorderSide(
color: Colors.grey.shade300,
width: 1,
),
), ),
top: BorderSide( margin: EdgeInsets.symmetric(
color: Colors.grey.shade300, horizontal: 8,
width: 1, vertical: 4,
), ),
), child: Container(
margin: EdgeInsets.symmetric( decoration: BoxDecoration(
horizontal: 8, borderRadius: BorderRadius.only(
vertical: 4, topLeft: Radius.circular(110.0),
), ),
child: Container( color: Colors.white,
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(110.0),
), ),
color: Colors.white, padding: EdgeInsets.symmetric(
), horizontal: 0),
padding: EdgeInsets.symmetric( width: MediaQuery.of(context)
horizontal: 0), .size
width: MediaQuery.of(context) .width /
.size 3,
.width / child: Column(
3, crossAxisAlignment:
child: Column( CrossAxisAlignment.start,
crossAxisAlignment: children: [
CrossAxisAlignment.start, Stack(
children: [ children: [
Stack( Container(
children: [ margin:
Container( EdgeInsets.fromLTRB(
margin: EdgeInsets.fromLTRB( 0, 16, 0, 0),
0, 16, 0, 0), alignment:
alignment: Alignment.center, Alignment.center,
child: Image.network( child: Image.network(
model.finalProducts[index] model
.images.isNotEmpty
? model
.finalProducts[
index]
.images[0]
.thumb
: 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png',
fit: BoxFit.cover,
height: 80,
),
),
Container(
width: model
.finalProducts[ .finalProducts[
index] index]
.rxMessage != .images
null .isNotEmpty
? MediaQuery.of(context) ? model
.size .finalProducts[
.width / index]
2.8 .images[0]
: 0, .thumb
padding: EdgeInsets.all(4), : 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png',
decoration: BoxDecoration( fit: BoxFit.cover,
color: Color(0xffb23838), height: 80,
borderRadius: ),
BorderRadius.only(
topLeft: Radius
.circular(6)),
), ),
child: Texts( Container(
model.finalProducts[index] width: model
.finalProducts[
index]
.rxMessage != .rxMessage !=
null null
? model ? MediaQuery.of(
.finalProducts[ context)
index] .size
.rxMessage .width /
: "", 2.8
color: Colors.white, : 0,
regular: true, padding:
fontSize: 10, EdgeInsets.all(4),
fontWeight: decoration: BoxDecoration(
FontWeight.w600, color:
Color(0xffb23838),
borderRadius:
BorderRadius.only(
topLeft: Radius
.circular(
6)),
),
child: Texts(
model
.finalProducts[
index]
.rxMessage !=
null
? model
.finalProducts[
index]
.rxMessage
: "",
color: Colors.white,
regular: true,
fontSize: 10,
fontWeight:
FontWeight.w600,
),
), ),
), ],
],
),
Container(
margin: EdgeInsets.symmetric(
horizontal: 6,
vertical: 0,
), ),
child: Column( Container(
crossAxisAlignment: margin: EdgeInsets.symmetric(
CrossAxisAlignment.start, horizontal: 6,
children: [ vertical: 0,
if (model ),
child: Column(
crossAxisAlignment:
CrossAxisAlignment
.start,
children: [
if (model
.finalProducts[
index]
.discountName !=
null)
Container(
width:
double.infinity,
height: 13.0,
decoration:
BoxDecoration(
color: Color(
0xff5AB145),
),
child: Center(
child: Texts(
model
.finalProducts[
index]
.discountName,
regular: true,
color:
Colors.white,
fontSize: 10.4,
),
),
),
Texts(
model
.finalProducts[ .finalProducts[
index] index]
.discountName != .name,
null) regular: true,
Container( fontSize: 12,
width: double.infinity, fontWeight:
height: 13.0, FontWeight.w400,
decoration: ),
BoxDecoration( Padding(
color: padding:
Color(0xff5AB145), const EdgeInsets
), .only(
child: Center( top: 4,
child: Texts( bottom: 4),
model child: Texts(
.finalProducts[ "SAR ${model.finalProducts[index].price}",
index] bold: true,
.discountName, fontSize: 14,
regular: true,
color: Colors.white,
fontSize: 10.4,
),
), ),
), ),
Texts( Row(
model.finalProducts[index] children: [
.name, StarRating(
regular: true, totalAverage: model
fontSize: 12, .finalProducts[
fontWeight: index]
FontWeight.w400, .approvedRatingSum >
), 0
Padding( ? (model.finalProducts[index].approvedRatingSum
padding: .toDouble() /
const EdgeInsets.only( model
top: 4, .finalProducts[index]
bottom: 4), .approvedRatingSum
child: Texts( .toDouble())
"SAR ${model.finalProducts[index].price}", .toDouble()
bold: true, : 0,
fontSize: 14, forceStars: true),
Texts(
"(${model.finalProducts[index].approvedTotalReviews})",
regular: true,
fontSize: 10,
fontWeight:
FontWeight.w400,
)
],
), ),
), ],
Row( ),
children: [
StarRating(
totalAverage: model
.finalProducts[
index]
.approvedRatingSum >
0
? (model.finalProducts[index].approvedRatingSum
.toDouble() /
model
.finalProducts[index]
.approvedRatingSum
.toDouble())
.toDouble()
: 0,
forceStars: true),
Texts(
"(${model.finalProducts[index].approvedTotalReviews})",
regular: true,
fontSize: 10,
fontWeight:
FontWeight.w400,
)
],
),
],
), ),
), ],
], ),
), ),
), ),
onTap: () => {
Navigator.push(
context,
FadePage(
page: ProductDetailPage(
model.finalProducts[index]),
)),
},
)); ));
}, },
), ),
@ -325,158 +360,186 @@ class _FinalProductsPageState extends State<FinalProductsPage> {
itemCount: model.finalProducts.length, itemCount: model.finalProducts.length,
itemBuilder: itemBuilder:
(BuildContext context, int index) { (BuildContext context, int index) {
return Card( return InkWell(
child: Row( child: Card(
children: [ child: Row(
Stack( children: [
children: [ Stack(
Column( children: [
children: [ Column(
Container( children: [
decoration: BoxDecoration(), Container(
child: Padding( decoration:
padding: EdgeInsets.only( BoxDecoration(),
left: 9.0, child: Padding(
top: 8.0, padding:
right: 10.0, EdgeInsets.only(
left: 9.0,
top: 8.0,
right: 10.0,
),
), ),
), ),
), Container(
Container( margin:
margin: EdgeInsets.fromLTRB( EdgeInsets.fromLTRB(
0, 0, 0, 0), 0, 0, 0, 0),
alignment: Alignment.center, alignment:
child: Image.network( Alignment.center,
model.finalProducts[index] child: Image.network(
.images.isNotEmpty model
? model .finalProducts[
.finalProducts[ index]
index] .images
.images[0] .isNotEmpty
.thumb ? model
: 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png', .finalProducts[
fit: BoxFit.contain, index]
height: 80, .images[0]
.thumb
: 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png',
fit: BoxFit.contain,
height: 80,
),
), ),
), ],
], ),
Column(
children: [
Container(
width: model
.finalProducts[
index]
.rxMessage !=
null
? MediaQuery.of(
context)
.size
.width /
3.5
: 0,
padding:
EdgeInsets.all(4),
decoration: BoxDecoration(
color:
Color(0xffb23838),
borderRadius:
BorderRadius.only(
topLeft: Radius
.circular(
6)),
),
child: Texts(
model
.finalProducts[
index]
.rxMessage !=
null
? model
.finalProducts[
index]
.rxMessage
: "",
color: Colors.white,
regular: true,
fontSize: 10,
fontWeight:
FontWeight.w600,
),
),
],
),
],
),
Container(
height: 100.0,
margin: EdgeInsets.symmetric(
horizontal: 6,
vertical: 0,
), ),
Column( child: Column(
mainAxisAlignment:
MainAxisAlignment
.spaceAround,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
SizedBox(
height: 4.0,
),
Container( Container(
width: model width:
.finalProducts[ MediaQuery.of(context)
index]
.rxMessage !=
null
? MediaQuery.of(context)
.size .size
.width / .width *
3.5 0.65,
: 0,
padding: EdgeInsets.all(4),
decoration: BoxDecoration(
color: Color(0xffb23838),
borderRadius:
BorderRadius.only(
topLeft: Radius
.circular(6)),
),
child: Texts( child: Texts(
model.finalProducts[index] model.finalProducts[index]
.rxMessage != .name,
null
? model
.finalProducts[
index]
.rxMessage
: "",
color: Colors.white,
regular: true, regular: true,
fontSize: 10, fontSize: 13.2,
fontWeight: fontWeight:
FontWeight.w600, FontWeight.w500,
maxLines: 5,
), ),
), ),
], SizedBox(
), height: 8.0,
],
),
Container(
height: 100.0,
margin: EdgeInsets.symmetric(
horizontal: 6,
vertical: 0,
),
child: Column(
mainAxisAlignment:
MainAxisAlignment.spaceAround,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
SizedBox(
height: 4.0,
),
Container(
height: 35.0,
width: 250.0,
child: Texts(
model.finalProducts[index]
.name,
regular: true,
fontSize: 13.2,
fontWeight: FontWeight.w500,
maxLines: 2,
), ),
), Padding(
SizedBox( padding:
height: 8.0, const EdgeInsets.only(
), top: 4, bottom: 4),
Padding( child: Texts(
padding: "SAR ${model.finalProducts[index].price}",
const EdgeInsets.only( bold: true,
top: 4, bottom: 4), fontSize: 14,
child: Texts( ),
"SAR ${model.finalProducts[index].price}",
bold: true,
fontSize: 14,
), ),
), Row(
Row( children: [
children: [ StarRating(
StarRating( totalAverage: model
totalAverage: model .finalProducts[
.finalProducts[ index]
index] .approvedRatingSum >
.approvedRatingSum > 0
0 ? (model
? (model .finalProducts[
.finalProducts[ index]
index] .approvedRatingSum
.approvedRatingSum .toDouble() /
.toDouble() / model
model .finalProducts[
.finalProducts[ index]
index] .approvedRatingSum
.approvedRatingSum .toDouble())
.toDouble()) .toDouble()
.toDouble() : 0,
: 0, forceStars: true),
forceStars: true), Texts(
Texts( "(${model.finalProducts[index].approvedTotalReviews})",
"(${model.finalProducts[index].approvedTotalReviews})", regular: true,
regular: true, fontSize: 10,
fontSize: 10, fontWeight:
fontWeight: FontWeight.w400,
FontWeight.w400, )
) ],
], ),
), ],
], ),
), ),
), ],
], ),
), ),
onTap: () => {
Navigator.push(
context,
FadePage(
page: ProductDetailPage(
model.finalProducts[index]),
)),
},
); );
}), }),
), ),

@ -49,78 +49,74 @@ class _LandingPagePharmacyState extends State<LandingPagePharmacy> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: appBar: currentTab != 4
? AppBar(
// currentTab == 0 || currentTab == 1 || currentTab == 2 backgroundColor: Color(0xff5AB145),
// ? elevation: 0,
title: Container(
AppBar( height: MediaQuery.of(context).size.height * 0.056,
backgroundColor: Color(0xff5AB145), decoration: BoxDecoration(
elevation: 0, borderRadius: BorderRadius.circular(5.0),
title: Container( color: Colors.white,
height: MediaQuery.of(context).size.height * 0.056, ),
decoration: BoxDecoration( child: InkWell(
borderRadius: BorderRadius.circular(5.0), child: Padding(
color: Colors.white, padding: EdgeInsets.all(8.0),
), child: Row(
child: InkWell( //crossAxisAlignment: CrossAxisAlignment.center,
child: Padding( mainAxisAlignment: MainAxisAlignment.start,
padding: EdgeInsets.all(8.0), children: [
child: Row( Icon(Icons.search, size: 25.0),
//crossAxisAlignment: CrossAxisAlignment.center, SizedBox(
mainAxisAlignment: MainAxisAlignment.start, width: 15.0,
children: [ ),
Icon(Icons.search, size: 25.0), Texts(
SizedBox( TranslationBase.of(context).searchProductHere,
width: 15.0, fontSize: 13,
)
],
),
), ),
Texts( onTap: () {
TranslationBase.of(context).searchProductHere, Navigator.push(
fontSize: 13, context,
) MaterialPageRoute(
], builder: (context) => SearchProductsPage()),
), );
), },
onTap: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => SearchProductsPage()),
);
},
),
),
leading: Builder(
builder: (BuildContext context) {
return InkWell(
onTap: () {
setState(() {
currentTab = 0;
pageController.jumpToPage(0);
});
},
child: Container(
height: 2.0,
width: 10.0,
child: Image.asset(
'assets/images/pharmacy_logo.png',
), ),
), ),
); leading: Builder(
}, builder: (BuildContext context) {
), return InkWell(
actions: [ onTap: () {
IconButton( setState(() {
// iconSize: 70, currentTab = 0;
icon: Image.asset( pageController.jumpToPage(0);
'assets/images/new-design/qr-code.png', });
},
child: Container(
height: 2.0,
width: 10.0,
child: Image.asset(
'assets/images/pharmacy_logo.png',
),
),
);
},
), ),
onPressed: _scanQrAndGetProduct //do something, actions: [
) IconButton(
], // iconSize: 70,
centerTitle: true, icon: Image.asset(
), 'assets/images/new-design/qr-code.png',
// : currentTab == 4 ),
// ? null:null, onPressed: _scanQrAndGetProduct //do something,
)
],
centerTitle: true,
)
: null,
// : AppBar( // : AppBar(
// backgroundColor: Color(0xff5AB145), // backgroundColor: Color(0xff5AB145),
// elevation: 0, // elevation: 0,
@ -155,7 +151,6 @@ class _LandingPagePharmacyState extends State<LandingPagePharmacy> {
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
controller: pageController, controller: pageController,
children: [ children: [
// TODO mosa_comeback
PharmacyPage(), PharmacyPage(),
PharmacyCategorisePage(), PharmacyCategorisePage(),
// OffersCategorisePage(), // OffersCategorisePage(),
@ -180,8 +175,9 @@ class _LandingPagePharmacyState extends State<LandingPagePharmacy> {
try { try {
String barcode = result; String barcode = result;
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await BaseAppClient().getPharmacy("$GET_PHARMACY_PRODUCTs_BY_SKU$barcode", await BaseAppClient()
onSuccess: (dynamic response, int statusCode) { .getPharmacy("$GET_PHARMACY_PRODUCTs_BY_SKU$barcode",
onSuccess: (dynamic response, int statusCode) {
print(response); print(response);
var product = PharmacyProduct.fromJson(response["products"][0]); var product = PharmacyProduct.fromJson(response["products"][0]);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);

File diff suppressed because it is too large Load Diff

@ -1,6 +1,7 @@
import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacy_categorise_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacy_categorise_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/product_detail.dart';
import 'package:diplomaticquarterapp/pages/sub_categorise_page.dart'; import 'package:diplomaticquarterapp/pages/sub_categorise_page.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
@ -8,6 +9,7 @@ import 'package:diplomaticquarterapp/widgets/others/StarRating.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_pharmacy_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_pharmacy_widget.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart'; import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:giffy_dialog/giffy_dialog.dart'; import 'package:giffy_dialog/giffy_dialog.dart';
@ -111,10 +113,10 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
context: context, context: context,
builder: (BuildContext context) { builder: (BuildContext context) {
return Container( return Container(
height: MediaQuery.of(context) // height: MediaQuery.of(context)
.size // .size
.height * // .height *
0.89, // 0.89,
color: Colors.white, color: Colors.white,
child: Center( child: Center(
child: ListView.builder( child: ListView.builder(
@ -130,7 +132,7 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
child: Padding( child: Padding(
padding: padding:
EdgeInsets.all( EdgeInsets.all(
8.0), 4.0),
child: InkWell( child: InkWell(
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment:
@ -229,10 +231,10 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
.size .size
.width * .width *
0.197, 0.197,
height: MediaQuery.of(context) // height: MediaQuery.of(context)
.size // .size
.height * // .height *
0.08, // 0.08,
child: Center( child: Center(
child: Texts( child: Texts(
projectViewModel.isArabic projectViewModel.isArabic
@ -646,246 +648,260 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
(BuildContext context, int index) { (BuildContext context, int index) {
return NetworkBaseView( return NetworkBaseView(
baseViewModel: model, baseViewModel: model,
child: Card( child: InkWell(
color: model.parentProducts[index] child: Card(
.discountName != color: model.parentProducts[index]
null .discountName !=
? Color(0xffFFFF00) null
: Colors.white, ? Color(0xffFFFF00)
elevation: 0, : Colors.white,
shape: Border( elevation: 0,
right: BorderSide( shape: Border(
color: Colors.grey.shade300, right: BorderSide(
width: 1, color: Colors.grey.shade300,
), width: 1,
left: BorderSide( ),
color: Colors.grey.shade300, left: BorderSide(
width: 1, color: Colors.grey.shade300,
), width: 1,
bottom: BorderSide( ),
color: Colors.grey.shade300, bottom: BorderSide(
width: 1, color: Colors.grey.shade300,
width: 1,
),
top: BorderSide(
color: Colors.grey.shade300,
width: 1,
),
), ),
top: BorderSide( margin: EdgeInsets.symmetric(
color: Colors.grey.shade300, horizontal: 8,
width: 1, vertical: 4,
), ),
), child: Container(
margin: EdgeInsets.symmetric( decoration: BoxDecoration(
horizontal: 8, borderRadius:
vertical: 4, BorderRadius.only(
), topLeft:
child: Container( Radius.circular(110.0),
decoration: BoxDecoration( ),
borderRadius: BorderRadius.only( color: Colors.white,
topLeft:
Radius.circular(110.0),
), ),
color: Colors.white, padding: EdgeInsets.symmetric(
), horizontal: 0),
padding: EdgeInsets.symmetric( width: MediaQuery.of(context)
horizontal: 0), .size
width: MediaQuery.of(context) .width /
.size 3,
.width / child: Column(
3, crossAxisAlignment:
child: Column( CrossAxisAlignment.start,
crossAxisAlignment: children: [
CrossAxisAlignment.start, Stack(
children: [ children: [
Stack( if (model
children: [ .parentProducts[
if (model index]
.parentProducts[ .discountName !=
index] null)
.discountName != RotatedBox(
null) quarterTurns: 4,
RotatedBox( child: Container(
quarterTurns: 4, decoration:
child: Container( BoxDecoration(),
decoration: child: Padding(
BoxDecoration(), padding:
child: Padding( EdgeInsets
padding: .only(
EdgeInsets right: 5.0,
.only( top: 20.0,
right: 5.0, bottom: 5.0,
top: 20.0, ),
bottom: 5.0, child: Texts(
), 'offer'
child: Texts( .toUpperCase(),
'offer' color: Colors
.toUpperCase(), .red,
color: fontSize:
Colors.red, 13.0,
fontSize: 13.0, fontWeight:
fontWeight: FontWeight
FontWeight .w900,
.w900, ),
), ),
transform: new Matrix4
.rotationZ(
5.837200),
), ),
transform: new Matrix4
.rotationZ(
5.837200),
), ),
), Container(
Container( margin: EdgeInsets
margin: .fromLTRB(
EdgeInsets.fromLTRB( 0, 16, 0, 0),
0, 16, 0, 0), alignment:
alignment: Alignment.center,
Alignment.center, child: Image.network(
child: Image.network( model
model
.parentProducts[
index]
.images
.isNotEmpty
? model
.parentProducts[
index]
.images[0]
.thumb
: 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png',
fit: BoxFit.cover,
height: 80,
),
),
Container(
width: model
.parentProducts[ .parentProducts[
index] index]
.rxMessage != .images
null .isNotEmpty
? MediaQuery.of( ? model
context) .parentProducts[
.size index]
.width / .images[0]
5 .thumb
: 0, : 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png',
padding: fit: BoxFit.cover,
EdgeInsets.all(4), height: 80,
decoration: ),
BoxDecoration(
color:
Color(0xffb23838),
borderRadius:
BorderRadius.only(
topLeft: Radius
.circular(
6)),
), ),
child: Texts( Container(
model width: model
.parentProducts[ .parentProducts[
index] index]
.rxMessage != .rxMessage !=
null null
? model ? MediaQuery.of(
.parentProducts[ context)
index] .size
.rxMessage .width /
: "", 5
color: Colors.white, : 0,
regular: true, padding:
fontSize: 10, EdgeInsets.all(4),
fontWeight: decoration:
FontWeight.w400, BoxDecoration(
color: Color(
0xffb23838),
borderRadius:
BorderRadius.only(
topLeft: Radius
.circular(
6)),
),
child: Texts(
model
.parentProducts[
index]
.rxMessage !=
null
? model
.parentProducts[
index]
.rxMessage
: "",
color: Colors.white,
regular: true,
fontSize: 10,
fontWeight:
FontWeight.w400,
),
), ),
), ],
],
),
Container(
margin:
EdgeInsets.symmetric(
horizontal: 6,
vertical: 0,
), ),
child: Column( Container(
crossAxisAlignment: margin:
CrossAxisAlignment EdgeInsets.symmetric(
.start, horizontal: 6,
children: [ vertical: 0,
if (model ),
child: Column(
crossAxisAlignment:
CrossAxisAlignment
.start,
children: [
if (model
.parentProducts[
index]
.discountName !=
null)
Container(
width: double
.infinity,
height: 13.0,
decoration:
BoxDecoration(
color: Color(
0xff5AB145),
),
child: Center(
child: Texts(
model
.parentProducts[
index]
.discountName,
regular: true,
color: Colors
.white,
fontSize:
10.4,
),
),
),
Texts(
model
.parentProducts[ .parentProducts[
index] index]
.discountName != .name,
null) regular: true,
Container( fontSize: 12,
width: fontWeight:
double.infinity, FontWeight.w700,
height: 13.0, ),
decoration: Padding(
BoxDecoration( padding:
color: Color( const EdgeInsets
0xff5AB145), .only(
), top: 4,
child: Center( bottom: 4),
child: Texts( child: Texts(
model "SAR ${model.parentProducts[index].price}",
.parentProducts[ bold: true,
index] fontSize: 14,
.discountName,
regular: true,
color: Colors
.white,
fontSize: 10.4,
),
), ),
), ),
Texts( Row(
model children: [
.parentProducts[ StarRating(
index] totalAverage: model
.name, .parentProducts[
regular: true, index]
fontSize: 12, .approvedRatingSum >
fontWeight: 0
FontWeight.w700, ? (model.parentProducts[index].approvedRatingSum.toDouble() /
), model.parentProducts[index].approvedRatingSum
Padding( .toDouble())
padding: .toDouble()
const EdgeInsets : 0,
.only( forceStars:
top: 4, true),
bottom: 4), Texts(
child: Texts( "(${model.parentProducts[index].approvedTotalReviews})",
"SAR ${model.parentProducts[index].price}", regular: true,
bold: true, fontSize: 10,
fontSize: 14, fontWeight:
FontWeight
.w400,
)
],
), ),
), ],
Row( ),
children: [
StarRating(
totalAverage: model
.parentProducts[
index]
.approvedRatingSum >
0
? (model.parentProducts[index].approvedRatingSum.toDouble() /
model.parentProducts[index].approvedRatingSum
.toDouble())
.toDouble()
: 0,
forceStars:
true),
Texts(
"(${model.parentProducts[index].approvedTotalReviews})",
regular: true,
fontSize: 10,
fontWeight:
FontWeight
.w400,
)
],
),
],
), ),
), ],
], ),
), ),
), ),
onTap: () => {
Navigator.push(
context,
FadePage(
page: ProductDetailPage(
model.parentProducts[
index]),
)),
},
)); ));
}, },
), ),
@ -898,168 +914,191 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
itemCount: model.parentProducts.length, itemCount: model.parentProducts.length,
itemBuilder: itemBuilder:
(BuildContext context, int index) { (BuildContext context, int index) {
return Card( return InkWell(
child: Row( child: Card(
children: [ child: Row(
Stack( children: [
children: [ Stack(
Column( children: [
children: [ Column(
Container( children: [
decoration: Container(
BoxDecoration(), decoration:
child: Padding( BoxDecoration(),
padding: child: Padding(
EdgeInsets.only( padding:
left: 9.0, EdgeInsets.only(
top: 8.0, left: 9.0,
right: 10.0, top: 8.0,
right: 10.0,
),
), ),
), ),
), Container(
Container( margin: EdgeInsets
margin: .fromLTRB(
EdgeInsets.fromLTRB( 0, 0, 0, 0),
0, 0, 0, 0), alignment:
alignment: Alignment.center,
Alignment.center, child: Image.network(
child: Image.network( model
model
.parentProducts[
index]
.images
.isNotEmpty
? model
.parentProducts[
index]
.images[0]
.thumb
: 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png',
fit: BoxFit.contain,
height: 80,
),
),
],
),
Column(
children: [
Container(
width: model
.parentProducts[ .parentProducts[
index] index]
.rxMessage != .images
null .isNotEmpty
? MediaQuery.of( ? model
context) .parentProducts[
.size index]
.width / .images[0]
5 .thumb
: 0, : 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png',
padding: fit: BoxFit.contain,
EdgeInsets.all(4), height: 80,
decoration: ),
BoxDecoration(
color:
Color(0xffb23838),
borderRadius:
BorderRadius.only(
topLeft: Radius
.circular(
6)),
), ),
child: Texts( ],
model ),
Column(
children: [
Container(
width: model
.parentProducts[ .parentProducts[
index] index]
.rxMessage != .rxMessage !=
null null
? model ? MediaQuery.of(
.parentProducts[ context)
index] .size
.rxMessage .width /
: "", 5
color: Colors.white, : 0,
padding:
EdgeInsets.all(4),
decoration:
BoxDecoration(
color: Color(
0xffb23838),
borderRadius:
BorderRadius.only(
topLeft: Radius
.circular(
6)),
),
child: Expanded(
child: Texts(
model
.parentProducts[
index]
.rxMessage !=
null
? model
.parentProducts[
index]
.rxMessage
: "",
color:
Colors.white,
regular: true,
fontSize: 10,
fontWeight:
FontWeight
.w400,
),
),
),
],
),
],
),
Container(
margin: EdgeInsets.symmetric(
horizontal: 6,
vertical: 0,
),
child: Column(
mainAxisAlignment:
MainAxisAlignment
.spaceAround,
crossAxisAlignment:
CrossAxisAlignment
.start,
children: [
SizedBox(
height: 4.0,
),
Container(
width: MediaQuery.of(
context)
.size
.width *
0.65,
child: Texts(
model
.parentProducts[
index]
.name,
regular: true, regular: true,
fontSize: 10, fontSize: 13.2,
fontWeight: fontWeight:
FontWeight.w400, FontWeight.w500,
maxLines: 5,
),
),
SizedBox(
height: 8.0,
),
Padding(
padding:
const EdgeInsets
.only(
top: 4,
bottom: 4),
child: Texts(
"SAR ${model.parentProducts[index].price}",
bold: true,
fontSize: 14,
), ),
), ),
Row(
children: [
StarRating(
totalAverage: model
.parentProducts[
index]
.approvedRatingSum >
0
? (model.parentProducts[index].approvedRatingSum
.toDouble() /
model
.parentProducts[index]
.approvedRatingSum
.toDouble())
.toDouble()
: 0,
forceStars: true),
Texts(
"(${model.parentProducts[index].approvedTotalReviews})",
regular: true,
fontSize: 10,
fontWeight:
FontWeight.w400,
)
],
),
], ],
), ),
],
),
Container(
height: 100.0,
margin: EdgeInsets.symmetric(
horizontal: 6,
vertical: 0,
),
child: Column(
mainAxisAlignment:
MainAxisAlignment
.spaceAround,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
SizedBox(
height: 4.0,
),
Texts(
model
.parentProducts[index]
.name,
regular: true,
fontSize: 13.2,
fontWeight:
FontWeight.w500,
maxLines: 5,
),
SizedBox(
height: 8.0,
),
Padding(
padding:
const EdgeInsets.only(
top: 4,
bottom: 4),
child: Texts(
"SAR ${model.parentProducts[index].price}",
bold: true,
fontSize: 14,
),
),
Row(
children: [
StarRating(
totalAverage: model
.parentProducts[
index]
.approvedRatingSum >
0
? (model.parentProducts[index].approvedRatingSum
.toDouble() /
model
.parentProducts[index]
.approvedRatingSum
.toDouble())
.toDouble()
: 0,
forceStars: true),
Texts(
"(${model.parentProducts[index].approvedTotalReviews})",
regular: true,
fontSize: 10,
fontWeight:
FontWeight.w400,
)
],
),
],
), ),
), ],
], ),
), ),
onTap: () => {
Navigator.push(
context,
FadePage(
page: ProductDetailPage(model
.parentProducts[index]),
)),
},
); );
}), }),
) )

File diff suppressed because it is too large Load Diff

@ -27,7 +27,7 @@ class CartOrderPage extends StatelessWidget {
value: model.cartResponse, value: model.cartResponse,
child: AppScaffold( child: AppScaffold(
appBarTitle: TranslationBase.of(context).shoppingCart, appBarTitle: TranslationBase.of(context).shoppingCart,
isShowAppBar: false, isShowAppBar: true,
isPharmacy: true, isPharmacy: true,
baseViewModel: model, baseViewModel: model,
backgroundColor: Colors.white, backgroundColor: Colors.white,

@ -9,6 +9,7 @@ import 'package:diplomaticquarterapp/pages/pharmacies/screens/payment-method-sel
import 'package:diplomaticquarterapp/pages/pharmacies/screens/pharmacy_module_page.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/pharmacy_module_page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/widgets/ProductOrderPreviewItem.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/widgets/ProductOrderPreviewItem.dart';
import 'package:diplomaticquarterapp/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart'; import 'package:diplomaticquarterapp/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -25,9 +26,7 @@ class OrderPreviewPage extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final mediaQuery = MediaQuery.of(context); final mediaQuery = MediaQuery.of(context);
final height = mediaQuery.size.height - final height = mediaQuery.size.height - 60 - mediaQuery.padding.top;
60 -
mediaQuery.padding.top;
return BaseView<OrderPreviewViewModel>( return BaseView<OrderPreviewViewModel>(
onModelReady: (model) => model.getShoppingCart(), onModelReady: (model) => model.getShoppingCart(),
@ -781,23 +780,16 @@ class PaymentBottomWidget extends StatelessWidget {
), ),
onPressed: (paymentData.address != null && onPressed: (paymentData.address != null &&
paymentData.paymentOption != null) paymentData.paymentOption != null)
? () => { ? () async {
model.makeOrder().then((_) { await model.makeOrder();
if (model.state != ViewState.Idle) { if (model.state != ViewState.Idle) {
SnackBar snackBar = SnackBar( AppToast.showSuccessToast(message: "Order has been placed successfully!!");
content: Text( } else {
'Order has been placed successfully!!')); AppToast.showErrorToast(message: model.error);
scaffold.showSnackBar(snackBar);
}
// Navigator.pushAndRemoveUntil(
// context,
// MaterialPageRoute(
// builder: (context) =>
// PharmacyPage()),
// (Route<dynamic> r) => false);
})
} }
Navigator.pop(context);
Navigator.pop(context);
}
: null, : null,
child: Padding( child: Padding(
padding: const EdgeInsets.symmetric(vertical: 16), padding: const EdgeInsets.symmetric(vertical: 16),

@ -20,6 +20,7 @@ import 'package:flutter_svg/svg.dart';
import 'package:rating_bar/rating_bar.dart'; import 'package:rating_bar/rating_bar.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/product-brands.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/product-brands.dart';
import '../../final_products_page.dart';
import 'lacum-activitaion-vida-page.dart'; import 'lacum-activitaion-vida-page.dart';
import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart';
@ -48,8 +49,8 @@ class PharmacyPage extends StatelessWidget {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
BannerPager(model), BannerPager(model),
// GridViewButtons(model), GridViewButtons(model),
Container( Container(
margin: EdgeInsets.fromLTRB(10, 10, 10, 10), margin: EdgeInsets.fromLTRB(10, 10, 10, 10),
child: Row( child: Row(
@ -77,181 +78,193 @@ class PharmacyPage extends StatelessWidget {
], ],
), ),
), ),
Container( Container(
padding: EdgeInsets.symmetric(horizontal: 16.0, vertical: 24.0), padding:
EdgeInsets.symmetric(horizontal: 16.0, vertical: 24.0),
height: MediaQuery.of(context).size.height * 0.30, height: MediaQuery.of(context).size.height * 0.30,
// width: 200.0, // width: 200.0,
// height: MediaQuery.of(context).size.height / 4 + 20, // height: MediaQuery.of(context).size.height / 4 + 20,
margin: EdgeInsets.only(left: 10), margin: EdgeInsets.only(left: 10),
child: BaseView<PharmacyModuleViewModel>( child: BaseView<PharmacyModuleViewModel>(
onModelReady: (model) => model.getPrescription(), onModelReady: (model) => model.getPrescription(),
builder: (_, model, wi) => model.prescriptionsList.length != 0 builder: (_, model, wi) => model.prescriptionsList.length !=
0
// model.getPrescription(); // model.getPrescription();
? ListView.builder( ? ListView.builder(
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
shrinkWrap: true, shrinkWrap: true,
physics: ScrollPhysics(), physics: ScrollPhysics(),
// physics: NeverScrollableScrollPhysics(), // physics: NeverScrollableScrollPhysics(),
// itemCount: 4, // itemCount: 4,
itemCount: model.prescriptionsList.length, itemCount: model.prescriptionsList.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
return Container( return Container(
// width: 160.0, // width: 160.0,
height: MediaQuery.of(context).size.height * 0.6, height:
padding: EdgeInsets.only(bottom: 5.0, left: 5.0), MediaQuery.of(context).size.height * 0.6,
margin: EdgeInsets.only(right: 10.0), padding:
decoration: BoxDecoration( EdgeInsets.only(bottom: 5.0, left: 5.0),
border: Border.all( margin: EdgeInsets.only(right: 10.0),
color: Colors.grey, decoration: BoxDecoration(
style: BorderStyle.solid, border: Border.all(
width: 1.0, color: Colors.grey,
), style: BorderStyle.solid,
color: Colors.white, width: 1.0,
borderRadius: BorderRadius.circular(10.0)), ),
child: Column( color: Colors.white,
crossAxisAlignment: CrossAxisAlignment.start, borderRadius: BorderRadius.circular(10.0)),
children: <Widget>[ child: Column(
Row( crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Column(children: [ Row(
Container( children: <Widget>[
padding: EdgeInsets.only( Column(children: [
top: 10.0, Container(
left: 10.0,
right: 3.0,
bottom: 15.0,
),
child: Image.network(
model.prescriptionsList[index]
.doctorImageURL,
width: 60,
height: 60,
),
),
]),
Column(
// crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
margin: EdgeInsets.only(left: 1),
padding: EdgeInsets.only( padding: EdgeInsets.only(
left: 15.0, right: 15.0), top: 10.0,
decoration: BoxDecoration( left: 10.0,
border: Border.all( right: 3.0,
color: Colors.green, bottom: 15.0,
style: BorderStyle.solid, ),
width: 4.0, child: Image.network(
model.prescriptionsList[index]
.doctorImageURL,
width: 60,
height: 60,
),
),
]),
Column(
// crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
margin:
EdgeInsets.only(left: 1),
padding: EdgeInsets.only(
left: 15.0, right: 15.0),
decoration: BoxDecoration(
border: Border.all(
color: Colors.green,
style:
BorderStyle.solid,
width: 4.0,
),
color: Colors.green,
borderRadius:
BorderRadius.circular(
30.0)),
child: Text(
model
.prescriptionsList[
index]
.isInOutPatientDescription
.toString(),
style: TextStyle(
color: Colors.white,
fontSize: 15.0,
// fontWeight: FontWeight.bold,
),
)),
Row(children: <Widget>[
Image.asset(
'assets/images/Icon-awesome-calendar.png',
width: 30,
height: 30,
),
Text(
model.prescriptionsList[index]
.appointmentDate
.toString(),
style: TextStyle(
color: Colors.black,
fontSize: 15.0,
// fontWeight: FontWeight.bold,
), ),
color: Colors.green, )
borderRadius: ]),
BorderRadius.circular( ],
30.0)), ),
child: Text( ],
),
Row(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
Container(
margin: EdgeInsets.only(left: 5),
child: Row(children: <Widget>[
Text(
model.prescriptionsList[index] model.prescriptionsList[index]
.isInOutPatientDescription .doctorTitle
.toString(), .toString(),
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.black,
fontSize: 15.0, fontSize: 15.0,
// fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
)), ),
Row(children: <Widget>[ Text(
Image.asset( model.prescriptionsList[index]
'assets/images/Icon-awesome-calendar.png', .doctorName
width: 30, .toString(),
height: 30, style: TextStyle(
), color: Colors.black,
Text( fontSize: 15.0,
fontWeight: FontWeight.bold,
),
),
]),
),
],
),
Row(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
Container(
margin: EdgeInsets.only(left: 5),
child: Text(
model.prescriptionsList[index] model.prescriptionsList[index]
.appointmentDate .clinicDescription
.toString(), .toString(),
style: TextStyle( style: TextStyle(
color: Colors.black, color: Colors.green,
fontSize: 15.0, fontSize: 15.0,
// fontWeight: FontWeight.bold, // fontWeight: FontWeight.bold,
), ),
)
]),
],
),
],
),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
margin: EdgeInsets.only(left: 5),
child: Row(children: <Widget>[
Text(
model.prescriptionsList[index]
.doctorTitle
.toString(),
style: TextStyle(
color: Colors.black,
fontSize: 15.0,
fontWeight: FontWeight.bold,
), ),
), ),
Text( ],
model.prescriptionsList[index]
.doctorName
.toString(),
style: TextStyle(
color: Colors.black,
fontSize: 15.0,
fontWeight: FontWeight.bold,
),
),
]),
),
],
),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
margin: EdgeInsets.only(left: 5),
child: Text(
model.prescriptionsList[index]
.clinicDescription
.toString(),
style: TextStyle(
color: Colors.green,
fontSize: 15.0,
// fontWeight: FontWeight.bold,
),
),
), ),
], Row(
), crossAxisAlignment:
Row( CrossAxisAlignment.start,
crossAxisAlignment: children: <Widget>[
CrossAxisAlignment.start, Container(
children: <Widget>[ margin: EdgeInsets.only(left: 5),
Container( child: Align(
margin: EdgeInsets.only(left: 5), alignment: Alignment.topLeft,
child: Align( child: RatingBar.readOnly(
alignment: Alignment.topLeft,
child: RatingBar.readOnly(
// initialRating: productRate, // initialRating: productRate,
size: 15.0, size: 15.0,
filledColor: Colors.yellow[700], filledColor:
emptyColor: Colors.grey[500], Colors.yellow[700],
isHalfAllowed: true, emptyColor: Colors.grey[500],
halfFilledIcon: Icons.star_half, isHalfAllowed: true,
filledIcon: Icons.star, halfFilledIcon:
emptyIcon: Icons.star, Icons.star_half,
), filledIcon: Icons.star,
), emptyIcon: Icons.star,
) ),
]), ),
]), )
); ]),
}) ]),
: Container(), );
), })
: Container(),
),
), ),
Container( Container(
margin: EdgeInsets.fromLTRB(10, 10, 10, 10), margin: EdgeInsets.fromLTRB(10, 10, 10, 10),
@ -333,7 +346,17 @@ class PharmacyPage extends StatelessWidget {
hPadding: 4, hPadding: 4,
borderColor: Colors.green, borderColor: Colors.green,
textColor: Colors.green, textColor: Colors.green,
handler: () {}, handler: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => FinalProductsPage(
id: "",
productType: 3,
),
),
);
},
), ),
], ],
), ),
@ -367,7 +390,14 @@ class PharmacyPage extends StatelessWidget {
hPadding: 4, hPadding: 4,
handler: () => { handler: () => {
Navigator.push( Navigator.push(
context, FadePage(page: ProductBrandsPage())), context,
MaterialPageRoute(
builder: (context) => FinalProductsPage(
id: "",
productType: 4,
),
),
),
}, },
), ),
], ],

File diff suppressed because it is too large Load Diff

@ -1,3 +1,4 @@
import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/order_model_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/order_model_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/pharmacy/profile/profile.dart'; import 'package:diplomaticquarterapp/pages/pharmacy/profile/profile.dart';
@ -12,7 +13,7 @@ import 'package:rating_bar/rating_bar.dart';
import 'package:flutter/src/widgets/image.dart' as flutterImage; import 'package:flutter/src/widgets/image.dart' as flutterImage;
class ProductReviewPage extends StatefulWidget { class ProductReviewPage extends StatefulWidget {
final Product product; final PharmacyProduct product;
ProductReviewPage(this.product); ProductReviewPage(this.product);

@ -1,6 +1,7 @@
import 'dart:async'; import 'dart:async';
import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/order_detail.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/order_model.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/order_model.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_polyline_points/flutter_polyline_points.dart'; import 'package:flutter_polyline_points/flutter_polyline_points.dart';
@ -9,7 +10,7 @@ import 'package:location/location.dart';
class TrackDriver extends StatefulWidget { class TrackDriver extends StatefulWidget {
final OrderModel order; final OrderDetailModel order;
TrackDriver({this.order}); TrackDriver({this.order});
@override @override
@ -17,7 +18,7 @@ class TrackDriver extends StatefulWidget {
} }
class _TrackDriverState extends State<TrackDriver> { class _TrackDriverState extends State<TrackDriver> {
OrderModel _order; OrderDetailModel _order;
Completer<GoogleMapController> _controller = Completer(); Completer<GoogleMapController> _controller = Completer();

@ -1,6 +1,8 @@
import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacy_categorise_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacy_categorise_view_model.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/product-brands.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/product_detail.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
@ -8,6 +10,7 @@ import 'package:diplomaticquarterapp/widgets/input/text_field.dart';
import 'package:diplomaticquarterapp/widgets/others/StarRating.dart'; import 'package:diplomaticquarterapp/widgets/others/StarRating.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_pharmacy_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_pharmacy_widget.dart';
import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart'; import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'base/base_view.dart'; import 'base/base_view.dart';
@ -45,13 +48,13 @@ class _SearchProductsPageState extends State<SearchProductsPage> {
child: Row( child: Row(
children: [ children: [
Container( Container(
width: MediaQuery.of(context).size.width * 0.79, width: MediaQuery.of(context).size.width * 0.70,
child: Form( child: Form(
key: _formKey, key: _formKey,
child: TextFields( child: TextFields(
autoFocus: true, autoFocus: true,
hintText: 'Search', hintText: 'Search',
fontSize: 19.0, fontSize: 14.5,
prefixIcon: Icon(Icons.search), prefixIcon: Icon(Icons.search),
inputAction: TextInputAction.search, inputAction: TextInputAction.search,
onSaved: (value) { onSaved: (value) {
@ -102,170 +105,192 @@ class _SearchProductsPageState extends State<SearchProductsPage> {
child: NetworkBaseView( child: NetworkBaseView(
baseViewModel: model, baseViewModel: model,
child: model.searchList.isNotEmpty child: model.searchList.isNotEmpty
? Container( ? InkWell(
height: MediaQuery.of(context).size.height * 0.80, child: Container(
child: GridView.builder( height: MediaQuery.of(context).size.height * 0.80,
//physics: NeverScrollableScrollPhysics(), child: GridView.builder(
gridDelegate: //physics: NeverScrollableScrollPhysics(),
SliverGridDelegateWithFixedCrossAxisCount( gridDelegate:
crossAxisCount: 2, SliverGridDelegateWithFixedCrossAxisCount(
crossAxisSpacing: 0.5, crossAxisCount: 2,
mainAxisSpacing: 2.0, crossAxisSpacing: 0.5,
childAspectRatio: 1.0, mainAxisSpacing: 2.0,
), childAspectRatio: 1.0,
itemCount: model.searchList.length, ),
itemBuilder: (BuildContext context, int index) { itemCount: model.searchList.length,
return Card( itemBuilder: (BuildContext context, int index) {
color: model.searchList[index].discountName != return InkWell(
null child: Card(
? Color(0xffFFFF00) color: model.searchList[index]
: Colors.white, .discountName !=
elevation: 0, null
shape: Border( ? Color(0xffFFFF00)
right: BorderSide( : Colors.white,
color: Colors.grey.shade300, elevation: 0,
width: 1, shape: Border(
), right: BorderSide(
left: BorderSide( color: Colors.grey.shade300,
color: Colors.grey.shade300, width: 1,
width: 1, ),
), left: BorderSide(
bottom: BorderSide( color: Colors.grey.shade300,
color: Colors.grey.shade300, width: 1,
width: 1, ),
), bottom: BorderSide(
top: BorderSide( color: Colors.grey.shade300,
color: Colors.grey.shade300, width: 1,
width: 1, ),
), top: BorderSide(
), color: Colors.grey.shade300,
margin: EdgeInsets.symmetric( width: 1,
horizontal: 8, ),
vertical: 4,
),
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(110.0),
), ),
color: Colors.white, margin: EdgeInsets.symmetric(
), horizontal: 8,
padding: vertical: 4,
EdgeInsets.symmetric(horizontal: 0), ),
width: child: Container(
MediaQuery.of(context).size.width / 3, decoration: BoxDecoration(
child: Column( borderRadius: BorderRadius.only(
crossAxisAlignment: topLeft: Radius.circular(110.0),
CrossAxisAlignment.start, ),
children: [ color: Colors.white,
Stack( ),
padding:
EdgeInsets.symmetric(horizontal: 0),
width:
MediaQuery.of(context).size.width /
3,
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
Container( Stack(
margin: EdgeInsets.fromLTRB( children: [
0, 16, 0, 0), Container(
alignment: Alignment.center, margin: EdgeInsets.fromLTRB(
child: Image.network( 0, 16, 0, 0),
model.searchList[index].images alignment: Alignment.center,
.isNotEmpty child: Image.network(
? model.searchList[index] model.searchList[index]
.images[0].thumb .images.isNotEmpty
: 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png', ? model
fit: BoxFit.cover, .searchList[index]
height: 80, .images[0]
), .thumb
: 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png',
fit: BoxFit.cover,
height: 80,
),
),
Container(
width: model.searchList[index]
.rxMessage !=
null
? MediaQuery.of(context)
.size
.width /
5
: 0,
padding: EdgeInsets.all(4),
decoration: BoxDecoration(
color: Color(0xffb23838),
borderRadius:
BorderRadius.only(
topLeft:
Radius.circular(
6)),
),
child: Texts(
model.searchList[index]
.rxMessage !=
null
? model
.searchList[index]
.rxMessage
: "",
color: Colors.white,
regular: true,
fontSize: 10,
fontWeight: FontWeight.w400,
),
),
],
), ),
Container( Container(
width: model.searchList[index] margin: EdgeInsets.symmetric(
.rxMessage != horizontal: 6,
null vertical: 0,
? MediaQuery.of(context)
.size
.width /
5
: 0,
padding: EdgeInsets.all(4),
decoration: BoxDecoration(
color: Color(0xffb23838),
borderRadius: BorderRadius.only(
topLeft:
Radius.circular(6)),
), ),
child: Texts( child: Column(
model.searchList[index] crossAxisAlignment:
.rxMessage != CrossAxisAlignment.start,
null
? model.searchList[index]
.rxMessage
: "",
color: Colors.white,
regular: true,
fontSize: 10,
fontWeight: FontWeight.w400,
),
),
],
),
Container(
margin: EdgeInsets.symmetric(
horizontal: 6,
vertical: 0,
),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Texts(
model.searchList[index].name,
regular: true,
fontSize: 12,
fontWeight: FontWeight.w400,
),
Padding(
padding: const EdgeInsets.only(
top: 4, bottom: 4),
child: Texts(
"SAR ${model.searchList[index].price}",
bold: true,
fontSize: 14,
),
),
Row(
children: [ children: [
StarRating(
totalAverage: model
.searchList[
index]
.approvedRatingSum >
0
? (model
.searchList[
index]
.approvedRatingSum
.toDouble() /
model
.searchList[
index]
.approvedRatingSum
.toDouble())
.toDouble()
: 0,
forceStars: true),
Texts( Texts(
"(${model.searchList[index].approvedTotalReviews})", model
.searchList[index].name,
regular: true, regular: true,
fontSize: 10, fontSize: 12,
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
) ),
Padding(
padding:
const EdgeInsets.only(
top: 4, bottom: 4),
child: Texts(
"SAR ${model.searchList[index].price}",
bold: true,
fontSize: 14,
),
),
Row(
children: [
StarRating(
totalAverage: model
.searchList[
index]
.approvedRatingSum >
0
? (model
.searchList[
index]
.approvedRatingSum
.toDouble() /
model
.searchList[
index]
.approvedRatingSum
.toDouble())
.toDouble()
: 0,
forceStars: true),
Texts(
"(${model.searchList[index].approvedTotalReviews})",
regular: true,
fontSize: 10,
fontWeight:
FontWeight.w400,
)
],
),
], ],
), ),
], ),
), ],
), ),
], ),
), ),
), onTap: () => {
); Navigator.push(
}, context,
FadePage(
page: ProductDetailPage(
model.searchList[index]),
)),
},
);
},
),
), ),
) )
: Texts(msg), : Texts(msg),

@ -1,10 +1,12 @@
import 'package:diplomaticquarterapp/core/viewModels/pharmacy_categorise_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacy_categorise_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/product_detail.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/StarRating.dart'; import 'package:diplomaticquarterapp/widgets/others/StarRating.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_pharmacy_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_pharmacy_widget.dart';
import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart'; import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -607,168 +609,189 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
return NetworkBaseView( return NetworkBaseView(
baseViewModel: model, baseViewModel: model,
child: Card( child: InkWell(
color: model.subProducts[index] child: Card(
.discountName != color: model.subProducts[index]
null .discountName !=
? Color(0xffFFFF00) null
: Colors.white, ? Color(0xffFFFF00)
elevation: 0, : Colors.white,
shape: Border( elevation: 0,
right: BorderSide( shape: Border(
color: Colors.grey.shade300, right: BorderSide(
width: 1, color: Colors.grey.shade300,
), width: 1,
left: BorderSide( ),
color: Colors.grey.shade300, left: BorderSide(
width: 1, color: Colors.grey.shade300,
), width: 1,
bottom: BorderSide( ),
color: Colors.grey.shade300, bottom: BorderSide(
width: 1, color: Colors.grey.shade300,
width: 1,
),
top: BorderSide(
color: Colors.grey.shade300,
width: 1,
),
), ),
top: BorderSide( margin: EdgeInsets.symmetric(
color: Colors.grey.shade300, horizontal: 8,
width: 1, vertical: 4,
), ),
), child: Container(
margin: EdgeInsets.symmetric( decoration: BoxDecoration(
horizontal: 8, borderRadius: BorderRadius.only(
vertical: 4, topLeft: Radius.circular(110.0),
), ),
child: Container( color: Colors.white,
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(110.0),
), ),
color: Colors.white, padding: EdgeInsets.symmetric(
), horizontal: 0),
padding: EdgeInsets.symmetric( width: MediaQuery.of(context)
horizontal: 0), .size
width: MediaQuery.of(context) .width /
.size 3,
.width / child: Column(
3, crossAxisAlignment:
child: Column( CrossAxisAlignment.start,
crossAxisAlignment: children: [
CrossAxisAlignment.start, Stack(
children: [ children: [
Stack( Container(
children: [ margin:
Container( EdgeInsets.fromLTRB(
margin: EdgeInsets.fromLTRB( 0, 16, 0, 0),
0, 16, 0, 0), alignment:
alignment: Alignment.center, Alignment.center,
child: Image.network( child: Image.network(
model.subProducts[index] model
.images.isNotEmpty
? model
.subProducts[
index]
.images[0]
.thumb
: 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png',
fit: BoxFit.cover,
height: 80,
),
),
Container(
width: model
.subProducts[ .subProducts[
index] index]
.rxMessage != .images
null .isNotEmpty
? MediaQuery.of(context) ? model
.size .subProducts[
.width / index]
5 .images[0]
: 0, .thumb
padding: EdgeInsets.all(4), : 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png',
decoration: BoxDecoration( fit: BoxFit.cover,
color: Color(0xffb23838), height: 80,
borderRadius: ),
BorderRadius.only(
topLeft: Radius
.circular(6)),
), ),
child: Texts( Container(
model.subProducts[index] width: model
.subProducts[
index]
.rxMessage != .rxMessage !=
null null
? model ? MediaQuery.of(
.subProducts[ context)
index] .size
.rxMessage .width /
: "", 5
color: Colors.white, : 0,
regular: true,
fontSize: 10,
fontWeight:
FontWeight.w400,
),
),
],
),
Container(
margin: EdgeInsets.symmetric(
horizontal: 6,
vertical: 0,
),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Texts(
model.subProducts[index]
.name,
regular: true,
fontSize: 12,
fontWeight:
FontWeight.w400,
),
Padding(
padding: padding:
const EdgeInsets.only( EdgeInsets.all(4),
top: 4, decoration: BoxDecoration(
bottom: 4), color:
Color(0xffb23838),
borderRadius:
BorderRadius.only(
topLeft: Radius
.circular(
6)),
),
child: Texts( child: Texts(
"SAR ${model.subProducts[index].price}", model.subProducts[index]
bold: true, .rxMessage !=
fontSize: 14, null
? model
.subProducts[
index]
.rxMessage
: "",
color: Colors.white,
regular: true,
fontSize: 10,
fontWeight:
FontWeight.w400,
), ),
), ),
Row(
children: [
StarRating(
totalAverage: model
.subProducts[
index]
.approvedRatingSum >
0
? (model.subProducts[index].approvedRatingSum
.toDouble() /
model
.subProducts[index]
.approvedRatingSum
.toDouble())
.toDouble()
: 0,
forceStars: true),
Texts(
"(${model.subProducts[index].approvedTotalReviews})",
regular: true,
fontSize: 10,
fontWeight:
FontWeight.w400,
)
],
),
], ],
), ),
), Container(
], margin: EdgeInsets.symmetric(
horizontal: 6,
vertical: 0,
),
child: Column(
crossAxisAlignment:
CrossAxisAlignment
.start,
children: [
Texts(
model.subProducts[index]
.name,
regular: true,
fontSize: 12,
fontWeight:
FontWeight.w400,
),
Padding(
padding:
const EdgeInsets
.only(
top: 4,
bottom: 4),
child: Texts(
"SAR ${model.subProducts[index].price}",
bold: true,
fontSize: 14,
),
),
Row(
children: [
StarRating(
totalAverage: model
.subProducts[
index]
.approvedRatingSum >
0
? (model.subProducts[index].approvedRatingSum
.toDouble() /
model
.subProducts[index]
.approvedRatingSum
.toDouble())
.toDouble()
: 0,
forceStars: true),
Texts(
"(${model.subProducts[index].approvedTotalReviews})",
regular: true,
fontSize: 10,
fontWeight:
FontWeight.w400,
)
],
),
],
),
),
],
),
), ),
), ),
onTap: () => {
Navigator.push(
context,
FadePage(
page: ProductDetailPage(
model.subProducts[index]),
)),
},
)); ));
}, },
), ),
@ -780,158 +803,184 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
itemCount: model.subProducts.length, itemCount: model.subProducts.length,
itemBuilder: itemBuilder:
(BuildContext context, int index) { (BuildContext context, int index) {
return Card( return InkWell(
child: Row( child: Card(
children: [ child: Row(
Stack( children: [
children: [ Stack(
Column( children: [
children: [ Column(
Container( children: [
decoration: BoxDecoration(), Container(
child: Padding( decoration:
padding: EdgeInsets.only( BoxDecoration(),
left: 9.0, child: Padding(
top: 8.0, padding:
right: 10.0, EdgeInsets.only(
left: 9.0,
top: 8.0,
right: 10.0,
),
), ),
), ),
), Container(
Container( margin:
margin: EdgeInsets.fromLTRB( EdgeInsets.fromLTRB(
0, 0, 0, 0), 0, 0, 0, 0),
alignment: Alignment.center, alignment:
child: Image.network( Alignment.center,
model.subProducts[index] child: Image.network(
.images.isNotEmpty model
? model .subProducts[
.subProducts[ index]
index] .images
.images[0] .isNotEmpty
.thumb ? model
: 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png', .subProducts[
fit: BoxFit.contain, index]
height: 80, .images[0]
.thumb
: 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png',
fit: BoxFit.contain,
height: 80,
),
), ),
), ],
], ),
Column(
children: [
Container(
width: model
.subProducts[
index]
.rxMessage !=
null
? MediaQuery.of(
context)
.size
.width /
5
: 0,
padding:
EdgeInsets.all(4),
decoration: BoxDecoration(
color:
Color(0xffb23838),
borderRadius:
BorderRadius.only(
topLeft: Radius
.circular(
6)),
),
child: Texts(
model.subProducts[index]
.rxMessage !=
null
? model
.subProducts[
index]
.rxMessage
: "",
color: Colors.white,
regular: true,
fontSize: 10,
fontWeight:
FontWeight.w400,
),
),
],
),
],
),
Container(
height: 100.0,
margin: EdgeInsets.symmetric(
horizontal: 6,
vertical: 0,
), ),
Column( child: Column(
mainAxisAlignment:
MainAxisAlignment
.spaceAround,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
SizedBox(
height: 4.0,
),
Container( Container(
width: model width:
.subProducts[ MediaQuery.of(context)
index]
.rxMessage !=
null
? MediaQuery.of(context)
.size .size
.width / .width *
5 0.65,
: 0,
padding: EdgeInsets.all(4),
decoration: BoxDecoration(
color: Color(0xffb23838),
borderRadius:
BorderRadius.only(
topLeft: Radius
.circular(6)),
),
child: Texts( child: Texts(
model.subProducts[index] model.subProducts[index]
.rxMessage != .name,
null
? model
.subProducts[
index]
.rxMessage
: "",
color: Colors.white,
regular: true, regular: true,
fontSize: 10, fontSize: 13.2,
fontWeight: fontWeight:
FontWeight.w400, FontWeight.w500,
maxLines: 5,
), ),
), ),
], SizedBox(
), height: 8.0,
],
),
Container(
height: 100.0,
margin: EdgeInsets.symmetric(
horizontal: 6,
vertical: 0,
),
child: Column(
mainAxisAlignment:
MainAxisAlignment.spaceAround,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
SizedBox(
height: 4.0,
),
Container(
height: 35.0,
width: 250.0,
child: Texts(
model.subProducts[index]
.name,
regular: true,
fontSize: 13.2,
fontWeight: FontWeight.w500,
maxLines: 2,
), ),
), Padding(
SizedBox( padding:
height: 8.0, const EdgeInsets.only(
), top: 4, bottom: 4),
Padding( child: Texts(
padding: "SAR ${model.subProducts[index].price}",
const EdgeInsets.only( bold: true,
top: 4, bottom: 4), fontSize: 14,
child: Texts( ),
"SAR ${model.subProducts[index].price}",
bold: true,
fontSize: 14,
), ),
), Row(
Row( children: [
children: [ StarRating(
StarRating( totalAverage: model
totalAverage: model .subProducts[
.subProducts[ index]
index] .approvedRatingSum >
.approvedRatingSum > 0
0 ? (model
? (model .subProducts[
.subProducts[ index]
index] .approvedRatingSum
.approvedRatingSum .toDouble() /
.toDouble() / model
model .parentProducts[
.parentProducts[ index]
index] .approvedRatingSum
.approvedRatingSum .toDouble())
.toDouble()) .toDouble()
.toDouble() : 0,
: 0, forceStars: true),
forceStars: true), Texts(
Texts( "(${model.subProducts[index].approvedTotalReviews})",
"(${model.subProducts[index].approvedTotalReviews})", regular: true,
regular: true, fontSize: 10,
fontSize: 10, fontWeight:
fontWeight: FontWeight.w400,
FontWeight.w400, )
) ],
], ),
), ],
], ),
), ),
), ],
], ),
), ),
onTap: () => {
Navigator.push(
context,
FadePage(
page: ProductDetailPage(
model.subProducts[index]),
)),
},
); );
}), }),
) )

@ -1,6 +1,7 @@
import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/order_detail.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/order_model.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/order_model.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
@ -16,8 +17,8 @@ class CancelOrderService extends BaseService{
AuthenticatedUser authUser = new AuthenticatedUser(); AuthenticatedUser authUser = new AuthenticatedUser();
AuthProvider authProvider = new AuthProvider(); AuthProvider authProvider = new AuthProvider();
List<OrderModel> _cancelOrderList = List(); List<OrderDetailModel> _cancelOrderList = List();
List<OrderModel> get cancelOrderList => _cancelOrderList; List<OrderDetailModel> get cancelOrderList => _cancelOrderList;
String url =""; String url ="";

@ -1,12 +1,13 @@
import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/order_detail.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/order_model.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/order_model.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:flutter/material.dart';
class OrderDetailsService extends BaseService{ class OrderDetailsService extends BaseService{
@ -16,10 +17,8 @@ class OrderDetailsService extends BaseService{
AuthenticatedUser authUser = new AuthenticatedUser(); AuthenticatedUser authUser = new AuthenticatedUser();
AuthProvider authProvider = new AuthProvider(); AuthProvider authProvider = new AuthProvider();
// String url =""; List<OrderDetailModel> _orderList = List();
// List<OrderModel> get orderDetails => ordeDetails; List<OrderDetailModel> get orderList => _orderList;
List<OrderModel> _orderList = List();
List<OrderModel> get orderList => _orderList;
Future getOrderDetails(OrderId) async { Future getOrderDetails(OrderId) async {
@ -28,7 +27,7 @@ class OrderDetailsService extends BaseService{
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
_orderList.clear(); _orderList.clear();
response['orders'].forEach((item) { response['orders'].forEach((item) {
_orderList.add(OrderModel.fromJson(item)); _orderList.add(OrderDetailModel.fromJson(item));
print(response); print(response);
}); });
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
@ -37,7 +36,7 @@ class OrderDetailsService extends BaseService{
}); });
} }
Future makeReview(Product product, double rating, String reviewText) async { Future makeReview(PharmacyProduct product, double rating, String reviewText) async {
hasError = false; hasError = false;
super.error = ""; super.error = "";

@ -1,6 +1,7 @@
import 'dart:convert'; import 'dart:convert';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/order_detail.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
@ -20,13 +21,17 @@ class MyInAppBrowser extends InAppBrowser {
// static String PREAUTH_SERVICE_URL = // static String PREAUTH_SERVICE_URL =
// 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store // 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store
static String PRESCRIPTION_PAYMENT_WITH_ORDERID =
'https://uat.hmgwebservices.com/epharmacy/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID=';
static List<String> successURLS = [ static List<String> successURLS = [
'success', 'success',
'PayFortResponse', 'PayFortResponse',
'PayFortSucess' 'PayFortSucess',
'mobilepaymentcomplete'
]; ];
static List<String> errorURLS = ['PayfortCancel']; static List<String> errorURLS = ['PayfortCancel', 'errorpage', 'Failed'];
final Function onExitCallback; final Function onExitCallback;
final Function onLoadStartCallback; final Function onLoadStartCallback;
@ -146,6 +151,26 @@ class MyInAppBrowser extends InAppBrowser {
}); });
} }
openPharmacyPaymentBrowser(
OrderDetailModel order,
double amount,
String orderDesc,
String transactionID,
String emailId,
String paymentMethod,
String patientName,
dynamic patientID,
AuthenticatedUser authenticatedUser,
InAppBrowser browser) {
this.browser = browser;
getPatientData();
generatePharmacyURL(order, amount, orderDesc, transactionID, emailId,
paymentMethod, patientName, patientID, authenticatedUser)
.then((value) {
this.browser.openUrl(url: value);
});
}
openBrowser(String url) { openBrowser(String url) {
this.browser = browser; this.browser = browser;
this.browser.openUrl(url: url); this.browser.openUrl(url: url);
@ -225,6 +250,25 @@ class MyInAppBrowser extends InAppBrowser {
return 'data:text/html;base64,' + base64Str; return 'data:text/html;base64,' + base64Str;
} }
Future<String> generatePharmacyURL(
OrderDetailModel order,
double amount,
String orderDesc,
String transactionID,
String emailId,
String paymentMethod,
String patientName,
dynamic patientID,
AuthenticatedUser authUser) async {
String pharmacyURL = PRESCRIPTION_PAYMENT_WITH_ORDERID +
order.orderGuid +
'&&CustomerId=' +
"${order.customerId}";
print(pharmacyURL);
return pharmacyURL;
}
String getForm() { String getForm() {
return '<html> ' + return '<html> ' +
'<head></head>' + '<head></head>' +
@ -292,6 +336,36 @@ class MyInAppBrowser extends InAppBrowser {
'</body>' + '</body>' +
'</html>'; '</html>';
} }
String getPharmacyForm() {
return '<html> ' +
'<head></head>' +
'<body>' +
'<form id="paymentForm" action="SERVICE_URL_VALUE" method="post">' +
'<input type="hidden" name="Amount" value="AMOUNT_VALUE">' +
'<input type="hidden" name="Order_Desc" value="ORDER_DESCRIPTION_VALUE">' +
'<input type="hidden" name="OrderID" value="ORDER_ID_VALUE">' +
'<input type="hidden" name="PaymentOption" value="PAYMENT_OPTION_VALUE">' +
'<input type="hidden" name="Email" value="EMAIL_VALUE">' +
'<input type="hidden" name="ServID" value="SERV_ID" >' +
'<input type="hidden" name="ChannelID" value="2" >' +
'<input type="hidden" name="Lang" value="LANG_VALUE" >' +
'<input type="hidden" name="ReturnURL" value="" >' +
'<input type="hidden" name="CustName" value="CUSTNAME_VALUE" >' +
'<input type="hidden" name="PatientOutSA" value="PATIENT_OUT_SA" >' +
'<input type="hidden" name="PatientTypeID" value="PATIENT_TYPE_ID" >' +
'<input type="hidden" name="DeviceToken" value="DEVICE_TOKEN" >' +
'<input type="hidden" name="Longitude" value="LONGITUDE_VALUE" >' +
'<input type="hidden" name="Latitude" value="LATITUDE_VALUE" >' +
'<input type="hidden" name="Live_ServiceID" value="LIVE_SERVICE_ID" >' +
'<input type="hidden" name="CustID" value="CUSTID_VALUE" >' +
'<input type="hidden" name="ResponseContinueURL" value="http://hmg.com/Documents/success.html" >' +
'<input type="hidden" name="BackClickUrl" value="http://hmg.com/Documents/success.html" >' +
'</form>' +
'<script type="text/javascript"> document.getElementById("paymentForm").submit(); </script>' +
'</body>' +
'</html>';
}
} }
class MyChromeSafariBrowser extends ChromeSafariBrowser { class MyChromeSafariBrowser extends ChromeSafariBrowser {

@ -1,10 +1,9 @@
import 'package:diplomaticquarterapp/core/model/pharmacies/order_model.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/product_detail_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/product_detail_view_model.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-order-page.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-order-page.dart';
import 'package:diplomaticquarterapp/pages/pharmacy/order/ProductReview.dart'; import 'package:diplomaticquarterapp/pages/pharmacy/order/ProductReview.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/src/widgets/image.dart' as flutterImage;
import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:rating_bar/rating_bar.dart'; import 'package:rating_bar/rating_bar.dart';
@ -21,7 +20,7 @@ class productTile extends StatelessWidget {
final String img; final String img;
final String imgs; final String imgs;
final int status; final int status;
final Product product; final PharmacyProduct product;
final dynamic productID; final dynamic productID;
productTile( productTile(

Loading…
Cancel
Save