Qr icon added, notify me api added & improvements

merge-update-with-lab-changes
Sikander Saleem 5 years ago
parent 8eda45d637
commit 8f37fbf260

@ -36,40 +36,29 @@ const GET_PRIVILEGE = 'Services/Patients.svc/REST/Service_Privilege';
const WIFI_CREDENTIALS = "Services/Patients.svc/Hmg_SMS_Get_By_ProjectID_And_PatientID"; const WIFI_CREDENTIALS = "Services/Patients.svc/Hmg_SMS_Get_By_ProjectID_And_PatientID";
///Doctor ///Doctor
const GET_MY_DOCTOR = const GET_MY_DOCTOR = 'Services/Doctors.svc/REST/GetPatientDoctorAppointmentResult';
'Services/Doctors.svc/REST/GetPatientDoctorAppointmentResult';
const GET_DOCTOR_PROFILE = 'Services/Doctors.svc/REST/GetDocProfiles'; const GET_DOCTOR_PROFILE = 'Services/Doctors.svc/REST/GetDocProfiles';
const GET_DOCTOR_RATING_NOTES = const GET_DOCTOR_RATING_NOTES = 'Services/Doctors.svc/REST/dr_GetNotesDoctorRating';
'Services/Doctors.svc/REST/dr_GetNotesDoctorRating'; const GET_DOCTOR_RATING_DETAILS = 'Services/Doctors.svc/REST/dr_GetDoctorRatingDetails';
const GET_DOCTOR_RATING_DETAILS =
'Services/Doctors.svc/REST/dr_GetDoctorRatingDetails';
const GET_DOCTOR_RATING = 'Services/Doctors.svc/REST/dr_GetAvgDoctorRating'; const GET_DOCTOR_RATING = 'Services/Doctors.svc/REST/dr_GetAvgDoctorRating';
///Prescriptions ///Prescriptions
const PRESCRIPTIONS = 'Services/Patients.svc/REST/GetPrescriptionApptList'; const PRESCRIPTIONS = 'Services/Patients.svc/REST/GetPrescriptionApptList';
const GET_PRESCRIPTIONS_ALL_ORDERS = const GET_PRESCRIPTIONS_ALL_ORDERS = 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders';
'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders'; const GET_PRESCRIPTION_REPORT = 'Services/Patients.svc/REST/INP_GetPrescriptionReport';
const GET_PRESCRIPTION_REPORT = const SEND_PRESCRIPTION_EMAIL = 'Services/Notifications.svc/REST/SendPrescriptionEmail';
'Services/Patients.svc/REST/INP_GetPrescriptionReport'; const GET_PRESCRIPTION_REPORT_ENH = 'Services/Patients.svc/REST/GetPrescriptionReport_enh';
const SEND_PRESCRIPTION_EMAIL =
'Services/Notifications.svc/REST/SendPrescriptionEmail';
const GET_PRESCRIPTION_REPORT_ENH =
'Services/Patients.svc/REST/GetPrescriptionReport_enh';
///Lab Order ///Lab Order
const GET_Patient_LAB_ORDERS = 'Services/Patients.svc/REST/GetPatientLabOrders'; const GET_Patient_LAB_ORDERS = 'Services/Patients.svc/REST/GetPatientLabOrders';
const GET_Patient_LAB_SPECIAL_RESULT = 'Services/Patients.svc/REST/GetPatientLabSpecialResults'; const GET_Patient_LAB_SPECIAL_RESULT = 'Services/Patients.svc/REST/GetPatientLabSpecialResults';
const SEND_LAB_RESULT_EMAIL = const SEND_LAB_RESULT_EMAIL = 'Services/Notifications.svc/REST/SendLabReportEmail';
'Services/Notifications.svc/REST/SendLabReportEmail'; const GET_Patient_LAB_RESULT = 'Services/Patients.svc/REST/GetPatientLabResults';
const GET_Patient_LAB_RESULT = const GET_Patient_LAB_ORDERS_RESULT = 'Services/Patients.svc/REST/GetPatientLabOrdersResults';
'Services/Patients.svc/REST/GetPatientLabResults';
const GET_Patient_LAB_ORDERS_RESULT =
'Services/Patients.svc/REST/GetPatientLabOrdersResults';
/// ///
const GET_PATIENT_ORDERS = 'Services/Patients.svc/REST/GetPatientRadOrders'; const GET_PATIENT_ORDERS = 'Services/Patients.svc/REST/GetPatientRadOrders';
const GET_PATIENT_LAB_ORDERS_BY_APPOINTMENT = const GET_PATIENT_LAB_ORDERS_BY_APPOINTMENT = 'Services/Patients.svc/REST/GetPatientLabResultsByAppointmentNo';
'Services/Patients.svc/REST/GetPatientLabResultsByAppointmentNo';
const GET_PATIENT_ORDERS_DETAILS = 'Services/Patients.svc/REST/Rad_UpdatePatientRadOrdersToRead'; const GET_PATIENT_ORDERS_DETAILS = 'Services/Patients.svc/REST/Rad_UpdatePatientRadOrdersToRead';
const GET_RAD_IMAGE_URL = 'Services/Patients.svc/Rest/GetRadImageURL'; const GET_RAD_IMAGE_URL = 'Services/Patients.svc/Rest/GetRadImageURL';
@ -134,8 +123,7 @@ const GET_BLOOD_REQUEST = 'services/PatientVarification.svc/REST/BloodDonation_G
///Reports ///Reports
const REPORTS = 'Services/Doctors.svc/REST/GetPatientMedicalReportStatusInfo'; const REPORTS = 'Services/Doctors.svc/REST/GetPatientMedicalReportStatusInfo';
const INSERT_REQUEST_FOR_MEDICAL_REPORT = 'Services/Doctors.svc/REST/InsertRequestForMedicalReport'; const INSERT_REQUEST_FOR_MEDICAL_REPORT = 'Services/Doctors.svc/REST/InsertRequestForMedicalReport';
const SEND_MEDICAL_REPORT_EMAIL = const SEND_MEDICAL_REPORT_EMAIL = 'Services/Notifications.svc/REST/SendMedicalReportEmail';
'Services/Notifications.svc/REST/SendMedicalReportEmail';
///Rate ///Rate
const IS_LAST_APPOITMENT_RATED = 'Services/Doctors.svc/REST/IsLastAppoitmentRated'; const IS_LAST_APPOITMENT_RATED = 'Services/Doctors.svc/REST/IsLastAppoitmentRated';
@ -254,10 +242,8 @@ const GET_PAtIENTS_INSURANCE = "Services/Patients.svc/REST/Get_PatientInsuranceD
const GET_PAtIENTS_INSURANCE_UPDATED = "Services/Patients.svc/REST/PatientER_GetPatientInsuranceCardUpdateHistory"; const GET_PAtIENTS_INSURANCE_UPDATED = "Services/Patients.svc/REST/PatientER_GetPatientInsuranceCardUpdateHistory";
const INSURANCE_DETAILS = "Services/Patients.svc/REST/Get_InsuranceCheckList"; const INSURANCE_DETAILS = "Services/Patients.svc/REST/Get_InsuranceCheckList";
const GET_PATIENT_INSURANCE_DETAILS = const GET_PATIENT_INSURANCE_DETAILS = "Services/Patients.svc/REST/PatientER_GetPatientInsuranceDetails";
"Services/Patients.svc/REST/PatientER_GetPatientInsuranceDetails"; const UPLOAD_INSURANCE_CARD = 'Services/Patients.svc/REST/PatientER_PatientInfoForInsuranceCardUpdate';
const UPLOAD_INSURANCE_CARD =
'Services/Patients.svc/REST/PatientER_PatientInfoForInsuranceCardUpdate';
const GET_VACCINES = "Services/Patients.svc/REST/GetDoneVaccinesByPatientID"; const GET_VACCINES = "Services/Patients.svc/REST/GetDoneVaccinesByPatientID";
const GET_VACCINES_EMAIL = "Services/Notifications.svc/REST/SendVaccinesEmail"; const GET_VACCINES_EMAIL = "Services/Notifications.svc/REST/SendVaccinesEmail";
@ -302,10 +288,10 @@ const SEND_AVERAGE_BLOOD_WEIGHT_REPORT = 'Services/Notifications.svc/REST/SendAv
const SEND_AVERAGE_BLOOD_PRESSURE_REPORT = 'Services/Notifications.svc/REST/SendAverageBloodPressureReport'; const SEND_AVERAGE_BLOOD_PRESSURE_REPORT = 'Services/Notifications.svc/REST/SendAverageBloodPressureReport';
const UPDATE_DIABETIC_RESULT = 'Services/Patients.svc/REST/Patient_UpdateDiabeticResult'; const UPDATE_DIABETIC_RESULT = 'Services/Patients.svc/REST/Patient_UpdateDiabeticResult';
const GET_WEIGHT_PRESSURE_RESULT_AVERAGE = 'Services/Patients.svc/REST/Patient_GetWeightMeasurementResultAverage'; const GET_WEIGHT_PRESSURE_RESULT_AVERAGE = 'Services/Patients.svc/REST/Patient_GetWeightMeasurementResultAverage';
const GET_WEIGHT_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_GetWeightMeasurementResult'; const GET_WEIGHT_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_GetWeightMeasurementResult';
const ADD_WEIGHT_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_AddWeightMeasurementResult'; const ADD_WEIGHT_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_AddWeightMeasurementResult';
const UPDATE_WEIGHT_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_UpdateWeightMeasurementResult'; const UPDATE_WEIGHT_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_UpdateWeightMeasurementResult';
const DEACTIVATE_WEIGHT_PRESSURE_RESULT = 'services/Patients.svc/REST/Patient_DeactivateWeightMeasurementStatus'; const DEACTIVATE_WEIGHT_PRESSURE_RESULT = 'services/Patients.svc/REST/Patient_DeactivateWeightMeasurementStatus';
@ -342,7 +328,9 @@ const GET_PHARMACY_BANNER = "epharmacy/api/promotionbanners";
const GET_PHARMACY_TOP_MANUFACTURER = "epharmacy/api/topmanufacturer"; const GET_PHARMACY_TOP_MANUFACTURER = "epharmacy/api/topmanufacturer";
const GET_PHARMACY_BEST_SELLER_PRODUCT = "epharmacy/api/bestsellerproducts"; const GET_PHARMACY_BEST_SELLER_PRODUCT = "epharmacy/api/bestsellerproducts";
const GET_PHARMACY_PRODUCTs_BY_IDS = "epharmacy/api/productsbyids/"; const GET_PHARMACY_PRODUCTs_BY_IDS = "epharmacy/api/productsbyids/";
const GET_PHARMACY_PRODUCTs_BY_SKU = "epharmacy/api/productbysku/";
const GET_CUSTOMERS_ADDRESSES = "epharmacy/api/Customers/"; const GET_CUSTOMERS_ADDRESSES = "epharmacy/api/Customers/";
const SUBSCRIBE_PRODUCT = "epharmacy/api/subscribe?";
const GET_ORDER = "orders?"; const GET_ORDER = "orders?";
const GET_ORDER_DETAILS = "orders/"; const GET_ORDER_DETAILS = "orders/";
const ADD_CUSTOMER_ADDRESS = "epharmacy/api/addcustomeraddress"; const ADD_CUSTOMER_ADDRESS = "epharmacy/api/addcustomeraddress";
@ -354,23 +342,15 @@ const WRITE_REVIEW = "Content-Type" + "text/plain; charset=utf-8";
const GET_SHOPPING_CART = "epharmacy/api/shopping_cart_items/"; const GET_SHOPPING_CART = "epharmacy/api/shopping_cart_items/";
const GET_SHIPPING_OPTIONS = "epharmacy/api/get_shipping_option/"; const GET_SHIPPING_OPTIONS = "epharmacy/api/get_shipping_option/";
const DELETE_SHOPPING_CART = "epharmacy/api/delete_shopping_cart_items/"; const DELETE_SHOPPING_CART = "epharmacy/api/delete_shopping_cart_items/";
const DELETE_SHOPPING_CART_ALL = const DELETE_SHOPPING_CART_ALL = "epharmacy/api/delete_shopping_cart_item_by_customer/";
"epharmacy/api/delete_shopping_cart_item_by_customer/";
const ORDER_SHOPPING_CART = "epharmacy/api/orders"; const ORDER_SHOPPING_CART = "epharmacy/api/orders";
const GET_LACUM_ACCOUNT_INFORMATION = const GET_LACUM_ACCOUNT_INFORMATION = "Services/Patients.svc/REST/GetLakumAccountInformation";
"Services/Patients.svc/REST/GetLakumAccountInformation"; const GET_LACUM_GROUP_INFORMATION = "Services/Patients.svc/REST/GetlakumInQueryInfoGrouping";
const GET_LACUM_GROUP_INFORMATION = const LACUM_ACCOUNT_ACTIVATE = "Services/Patients.svc/REST/LakumAccountActivation";
"Services/Patients.svc/REST/GetlakumInQueryInfoGrouping"; const LACUM_ACCOUNT_DEACTIVATE = "Services/Patients.svc/REST/LakumAccountDeactivation";
const LACUM_ACCOUNT_ACTIVATE = const CREATE_LAKUM_ACCOUNT = "Services/Patients.svc/REST/PHR_CreateLakumAccount";
"Services/Patients.svc/REST/LakumAccountActivation"; const TRANSFER_YAHALA_LOYALITY_POINTS = "Services/Patients.svc/REST/TransferYaHalaLoyaltyPoints";
const LACUM_ACCOUNT_DEACTIVATE = const LAKUM_GET_USER_TERMS_AND_CONDITIONS = "Services/ERP.svc/REST/GetUserTermsAndConditionsForEPharmcy";
"Services/Patients.svc/REST/LakumAccountDeactivation";
const CREATE_LAKUM_ACCOUNT =
"Services/Patients.svc/REST/PHR_CreateLakumAccount";
const TRANSFER_YAHALA_LOYALITY_POINTS =
"Services/Patients.svc/REST/TransferYaHalaLoyaltyPoints";
const LAKUM_GET_USER_TERMS_AND_CONDITIONS =
"Services/ERP.svc/REST/GetUserTermsAndConditionsForEPharmcy";
const PRESCRIPTION = 'Services/Patients.svc/REST/GetPrescriptionApptList'; const PRESCRIPTION = 'Services/Patients.svc/REST/GetPrescriptionApptList';
// Home Health Care // Home Health Care
@ -380,14 +360,10 @@ const PATIENT_ER_UPDATE_PRES_ORDER = "Services/Patients.svc/REST/PatientER_Updat
const GET_ORDER_DETAIL_BY_ID = "Services/Patients.svc/REST/PatientER_HHC_GetTransactionsForOrder"; const GET_ORDER_DETAIL_BY_ID = "Services/Patients.svc/REST/PatientER_HHC_GetTransactionsForOrder";
const GET_CMC_ORDER_DETAIL_BY_ID = "Services/Patients.svc/REST/PatientER_CMC_GetTransactionsForOrder"; const GET_CMC_ORDER_DETAIL_BY_ID = "Services/Patients.svc/REST/PatientER_CMC_GetTransactionsForOrder";
const GET_CHECK_UP_ITEMS = "Services/Patients.svc/REST/GetCheckUpItems"; const GET_CHECK_UP_ITEMS = "Services/Patients.svc/REST/GetCheckUpItems";
const PUSH_NOTIFICATION_GET_ALL_NOTIFICATIONS = const PUSH_NOTIFICATION_GET_ALL_NOTIFICATIONS = 'Services/MobileNotifications.svc/REST/PushNotification_GetAllNotifications';
'Services/MobileNotifications.svc/REST/PushNotification_GetAllNotifications'; const PUSH_NOTIFICATION_SET_MESSAGES_FROM_POOL_AS_READ = 'Services/MobileNotifications.svc/REST/PushNotification_SetMessagesFromPoolAsRead';
const PUSH_NOTIFICATION_SET_MESSAGES_FROM_POOL_AS_READ = const GET_PATIENT_ALL_PRES_ORD = 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders';
'Services/MobileNotifications.svc/REST/PushNotification_SetMessagesFromPoolAsRead'; const PATIENT_ER_INSERT_PRES_ORDER = 'Services/Patients.svc/REST/PatientER_InsertPresOrder';
const GET_PATIENT_ALL_PRES_ORD =
'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders';
const PATIENT_ER_INSERT_PRES_ORDER =
'Services/Patients.svc/REST/PatientER_InsertPresOrder';
const PHARMACY_MAKE_REVIEW = 'epharmacy/api/insertreviews'; const PHARMACY_MAKE_REVIEW = 'epharmacy/api/insertreviews';
const BLOOD_DONATION_REGISTER_BLOOD_TYPE = 'Services/PatientVarification.svc/REST/BloodDonation_RegisterBloodType'; const BLOOD_DONATION_REGISTER_BLOOD_TYPE = 'Services/PatientVarification.svc/REST/BloodDonation_RegisterBloodType';
const ADD_USER_AGREEMENT_FOR_BLOOD_DONATION = 'Services/PatientVarification.svc/REST/AddUserAgreementForBloodDonation'; const ADD_USER_AGREEMENT_FOR_BLOOD_DONATION = 'Services/PatientVarification.svc/REST/AddUserAgreementForBloodDonation';
@ -404,29 +380,22 @@ const GET_SPECIFICATION = "productspecification/";
const GET_BRAND_ITEMS = "products?ManufacturerId="; const GET_BRAND_ITEMS = "products?ManufacturerId=";
// External API // External API
const ADD_ADDRESS_INFO = const ADD_ADDRESS_INFO = "https://mdlaboratories.com/exacartapi/api/addcustomeraddress";
"https://mdlaboratories.com/exacartapi/api/addcustomeraddress"; const GET_CUSTOMER_ADDRESSES = "https://mdlaboratories.com/exacartapi/api/Customers/";
const GET_CUSTOMER_ADDRESSES = const GET_CUSTOMER_INFO = "https://mdlaboratories.com/exacartapi/api/VerifyCustomer";
"https://mdlaboratories.com/exacartapi/api/Customers/";
const GET_CUSTOMER_INFO =
"https://mdlaboratories.com/exacartapi/api/VerifyCustomer";
//Pharmacy //Pharmacy
const GET_PHARMACY_CATEGORISE = const GET_PHARMACY_CATEGORISE = 'epharmacy/api/categories?fields=id,name,namen,description,image,localized_names,display_order,parent_category_id,is_leaf&parent_id=0';
'epharmacy/api/categories?fields=id,name,namen,description,image,localized_names,display_order,parent_category_id,is_leaf&parent_id=0';
const GET_OFFERS_CATEGORISE = 'epharmacy/api/discountcategories'; const GET_OFFERS_CATEGORISE = 'epharmacy/api/discountcategories';
const GET_OFFERS_PRODUCTS = 'epharmacy/api/offerproducts/'; const GET_OFFERS_PRODUCTS = 'epharmacy/api/offerproducts/';
const GET_CATEGORISE_PARENT = const GET_CATEGORISE_PARENT = 'epharmacy/api/categories?fields=id,name,namen,description,image,localized_names,display_order,parent_category_id,is_leaf&parent_id=';
'epharmacy/api/categories?fields=id,name,namen,description,image,localized_names,display_order,parent_category_id,is_leaf&parent_id=';
const GET_PARENT_PRODUCTS = 'epharmacy/api/products?categoryid='; const GET_PARENT_PRODUCTS = 'epharmacy/api/products?categoryid=';
const GET_SUB_CATEGORISE = const GET_SUB_CATEGORISE = 'epharmacy/api/categories?fields=id,name,namen,description,image,localized_names,display_order,parent_category_id,is_leaf&parent_id=';
'epharmacy/api/categories?fields=id,name,namen,description,image,localized_names,display_order,parent_category_id,is_leaf&parent_id=';
const GET_SUB_PRODUCTS = 'epharmacy/api/products?categoryid='; const GET_SUB_PRODUCTS = 'epharmacy/api/products?categoryid=';
const GET_FINAL_PRODUCTS = const GET_FINAL_PRODUCTS =
'epharmacy/api/products?fields=id,reviews,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&CategoryId='; 'epharmacy/api/products?fields=id,reviews,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&CategoryId=';
const TIMER_MIN = 10; const TIMER_MIN = 10;
const GOOGLE_API_KEY = "AIzaSyCmevVlr2Bh-c8W1VUzo8gt8JRY7n5PANw"; const GOOGLE_API_KEY = "AIzaSyCmevVlr2Bh-c8W1VUzo8gt8JRY7n5PANw";

@ -6,27 +6,23 @@ import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart'
import 'package:diplomaticquarterapp/core/service/base_service.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
class PharmacyModuleService extends BaseService { class PharmacyModuleService extends BaseService {
final AppSharedPreferences sharedPref = AppSharedPreferences(); final AppSharedPreferences sharedPref = AppSharedPreferences();
bool isFinished = true; bool isFinished = true;
bool hasError = false; bool hasError = false;
String errorMsg = ''; String errorMsg = '';
String url =""; String url = "";
List<PharmacyImageObject> bannerItems = List(); List<PharmacyImageObject> bannerItems = List();
List<Manufacturer> manufacturerList = List(); List<Manufacturer> manufacturerList = List();
List<PharmacyProduct> bestSellerProducts = List(); List<PharmacyProduct> bestSellerProducts = List();
List<PharmacyProduct> lastVisitedProducts = List(); List<PharmacyProduct> lastVisitedProducts = List();
Future makeVerifyCustomer(dynamic data) async { Future makeVerifyCustomer(dynamic data) async {
Map<String, String> queryParams = {'FileNumber': data['PatientID'].toString()}; Map<String, String> queryParams = {'FileNumber': data['PatientID'].toString()};
hasError = false; hasError = false;
try { try {
await baseAppClient.get(PHARMACY_VERIFY_CUSTOMER, await baseAppClient.get(PHARMACY_VERIFY_CUSTOMER, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
if (response['UserName'] != null) { if (response['UserName'] != null) {
sharedPref.setString(PHARMACY_CUSTOMER_ID, response['CustomerId'].toString()); sharedPref.setString(PHARMACY_CUSTOMER_ID, response['CustomerId'].toString());
print(response); print(response);
@ -58,8 +54,7 @@ class PharmacyModuleService extends BaseService {
}; };
hasError = false; hasError = false;
try { try {
await baseAppClient.get(PHARMACY_CREATE_CUSTOMER, await baseAppClient.get(PHARMACY_CREATE_CUSTOMER, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
if (!response['IsRegistered']) {} if (!response['IsRegistered']) {}
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
@ -73,8 +68,7 @@ class PharmacyModuleService extends BaseService {
Future getBannerListList() async { Future getBannerListList() async {
hasError = false; hasError = false;
try { try {
await baseAppClient.get(GET_PHARMACY_BANNER, await baseAppClient.get(GET_PHARMACY_BANNER, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
bannerItems.clear(); bannerItems.clear();
response['images'].forEach((item) { response['images'].forEach((item) {
bannerItems.add(PharmacyImageObject.fromJson(item)); bannerItems.add(PharmacyImageObject.fromJson(item));
@ -91,12 +85,11 @@ class PharmacyModuleService extends BaseService {
Future getTopManufacturerList() async { Future getTopManufacturerList() async {
Map<String, String> queryParams = {'page': '1', 'limit': '8'}; Map<String, String> queryParams = {'page': '1', 'limit': '8'};
try { try {
await baseAppClient.get(GET_PHARMACY_TOP_MANUFACTURER, await baseAppClient.get(GET_PHARMACY_TOP_MANUFACTURER, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
manufacturerList.clear(); manufacturerList.clear();
response['manufacturer'].forEach((item) { response['manufacturer'].forEach((item) {
Manufacturer manufacturer = Manufacturer.fromJson(item); Manufacturer manufacturer = Manufacturer.fromJson(item);
if(manufacturer.image != null){ if (manufacturer.image != null) {
manufacturerList.add(Manufacturer.fromJson(item)); manufacturerList.add(Manufacturer.fromJson(item));
} }
}); });
@ -115,8 +108,7 @@ class PharmacyModuleService extends BaseService {
'id,discount_ids,name,namen,localized_names,display_order,short_description,full_description,full_descriptionn,sku,order_minimum_quantity,order_maximum_quantity,price,old_price,images,is_rx,rx_message,rx_messagen,discount_name,discount_namen,approved_rating_sum,approved_total_reviews,allow_back_in_stock_subscriptions,stock_quantity,stock_availability,stock_availabilityn,discount_percentage,reviews', 'id,discount_ids,name,namen,localized_names,display_order,short_description,full_description,full_descriptionn,sku,order_minimum_quantity,order_maximum_quantity,price,old_price,images,is_rx,rx_message,rx_messagen,discount_name,discount_namen,approved_rating_sum,approved_total_reviews,allow_back_in_stock_subscriptions,stock_quantity,stock_availability,stock_availabilityn,discount_percentage,reviews',
}; };
try { try {
await baseAppClient.get(GET_PHARMACY_BEST_SELLER_PRODUCT, await baseAppClient.get(GET_PHARMACY_BEST_SELLER_PRODUCT, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
bestSellerProducts.clear(); bestSellerProducts.clear();
response['products'].forEach((item) { response['products'].forEach((item) {
bestSellerProducts.add(PharmacyProduct.fromJson(item)); bestSellerProducts.add(PharmacyProduct.fromJson(item));
@ -132,13 +124,10 @@ class PharmacyModuleService extends BaseService {
Future getLastVisitedProducts() async { Future getLastVisitedProducts() async {
String lastVisited = ""; String lastVisited = "";
if (await this.sharedPref.getString(PHARMACY_LAST_VISITED_PRODUCTS) != if (await this.sharedPref.getString(PHARMACY_LAST_VISITED_PRODUCTS) != null) {
null) { lastVisited = await this.sharedPref.getString(PHARMACY_LAST_VISITED_PRODUCTS);
lastVisited =
await this.sharedPref.getString(PHARMACY_LAST_VISITED_PRODUCTS);
try { try {
await baseAppClient.get("$GET_PHARMACY_PRODUCTs_BY_IDS$lastVisited", await baseAppClient.get("$GET_PHARMACY_PRODUCTs_BY_IDS$lastVisited", onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
lastVisitedProducts.clear(); lastVisitedProducts.clear();
response['products'].forEach((item) { response['products'].forEach((item) {
lastVisitedProducts.add(PharmacyProduct.fromJson(item)); lastVisitedProducts.add(PharmacyProduct.fromJson(item));
@ -152,5 +141,4 @@ class PharmacyModuleService extends BaseService {
} }
} }
} }
} }

@ -50,6 +50,17 @@ class ProductDetailViewModel extends BaseViewModel{
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future notifyMe(customerId, itemID) async {
hasError = false;
setState(ViewState.Busy);
await _productLocationService.notifyMe(customerId, itemID);
if (_productLocationService.hasError) {
error = _productLocationService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
}
Future addToCartData(quantity, itemID) async { Future addToCartData(quantity, itemID) async {
hasError = false; hasError = false;
setState(ViewState.Busy); setState(ViewState.Busy);

@ -1,19 +1,29 @@
import 'dart:convert';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:barcode_scan_fix/barcode_scan.dart';
import 'package:diplomaticquarterapp/core/service/client/base_app_client.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/parent_categorise_page.dart'; import 'package:diplomaticquarterapp/pages/parent_categorise_page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/product_detail.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/pharmacies/screens/pharmacy_module_page.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/pharmacy_module_page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/medicine_search_screen.dart';
import 'package:diplomaticquarterapp/pages/pharmacy/profile/profile.dart'; import 'package:diplomaticquarterapp/pages/pharmacy/profile/profile.dart';
import 'package:diplomaticquarterapp/pages/pharmacy_categorise.dart'; import 'package:diplomaticquarterapp/pages/pharmacy_categorise.dart';
import 'package:diplomaticquarterapp/pages/search_products_page.dart'; import 'package:diplomaticquarterapp/pages/search_products_page.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/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/drawer/app_drawer_widget.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart';
import 'package:diplomaticquarterapp/widgets/pharmacy/bottom_nav_pharmacy_bar.dart'; import 'package:diplomaticquarterapp/widgets/pharmacy/bottom_nav_pharmacy_bar.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/wishlist.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/wishlist.dart';
import '../offers_categorise_page.dart';
class LandingPagePharmacy extends StatefulWidget { class LandingPagePharmacy extends StatefulWidget {
@override @override
_LandingPagePharmacyState createState() => _LandingPagePharmacyState(); _LandingPagePharmacyState createState() => _LandingPagePharmacyState();
@ -39,105 +49,107 @@ class _LandingPagePharmacyState extends State<LandingPagePharmacy> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: currentTab == 0 || currentTab == 1 appBar:
? AppBar(
backgroundColor: Color(0xff5AB145), // currentTab == 0 || currentTab == 1 || currentTab == 2
elevation: 0, // ?
title: Container(
height: MediaQuery.of(context).size.height * 0.056, AppBar(
decoration: BoxDecoration( backgroundColor: Color(0xff5AB145),
borderRadius: BorderRadius.circular(5.0), elevation: 0,
color: Colors.white, title: Container(
), height: MediaQuery.of(context).size.height * 0.056,
child: InkWell( decoration: BoxDecoration(
child: Padding( borderRadius: BorderRadius.circular(5.0),
padding: EdgeInsets.all(8.0), color: Colors.white,
child: Row( ),
//crossAxisAlignment: CrossAxisAlignment.center, child: InkWell(
mainAxisAlignment: MainAxisAlignment.start, child: Padding(
children: [ padding: EdgeInsets.all(8.0),
Icon(Icons.search, size: 25.0), child: Row(
SizedBox( //crossAxisAlignment: CrossAxisAlignment.center,
width: 15.0, mainAxisAlignment: MainAxisAlignment.start,
), children: [
Texts( Icon(Icons.search, size: 25.0),
TranslationBase.of(context).searchProductHere, SizedBox(
fontSize: 13, width: 15.0,
)
],
),
), ),
onTap: () { Texts(
Navigator.push( TranslationBase.of(context).searchProductHere,
context, fontSize: 13,
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( ),
onTap: (){ actions: [
setState(() { IconButton(
currentTab = 0; // iconSize: 70,
pageController.jumpToPage(0); icon: Image.asset(
}); 'assets/images/new-design/qr-code.png',
},
child: Container(
height: 2.0,
width: 10.0,
child: Image.asset(
'assets/images/pharmacy_logo.png',
),
),
);
},
), ),
actions: [ onPressed: _scanQrAndGetProduct //do something,
// IconButton( )
// iconSize: 70, ],
// icon: SvgPicture.asset('assets/images/svg/robort_svg.svg', centerTitle: true,
// height: 100, width: 100, fit: BoxFit.cover), ),
// onPressed: () { // : currentTab == 4
// triggerRobot(); // ? null:null,
// } //do something, // : AppBar(
// ) // backgroundColor: Color(0xff5AB145),
], // elevation: 0,
centerTitle: true, // textTheme: TextTheme(
) // headline6: TextStyle(
: currentTab == 4 // color: Colors.white, fontWeight: FontWeight.bold),
? null // ),
: AppBar( // title: Text(getText(currentTab).toUpperCase()),
backgroundColor: Color(0xff5AB145), // leading: Builder(
elevation: 0, // builder: (BuildContext context) {
textTheme: TextTheme( // return IconButton(
headline6: TextStyle( // icon: Icon(Icons.arrow_back),
color: Colors.white, fontWeight: FontWeight.bold), // color: Colors.white,
), // onPressed: () => Scaffold.of(context).openDrawer(),
title: Text(getText(currentTab).toUpperCase()), // );
leading: Builder( // },
builder: (BuildContext context) { // ),
return IconButton( // actions: [
icon: Icon(Icons.arrow_back), // // IconButton(
color: Colors.white, // // iconSize: 70,
onPressed: () => Scaffold.of(context).openDrawer(), // // icon: SvgPicture.asset('assets/images/svg/robort_svg.svg',
); // // height: 100, width: 100, fit: BoxFit.cover),
}, // // onPressed: () {
), // // triggerRobot();
actions: [ // // } //do something,
// IconButton( // // )
// iconSize: 70, // ],
// icon: SvgPicture.asset('assets/images/svg/robort_svg.svg', // centerTitle: true,
// height: 100, width: 100, fit: BoxFit.cover), // ),
// onPressed: () {
// triggerRobot();
// } //do something,
// )
],
centerTitle: true,
),
extendBody: false, extendBody: false,
body: PageView( body: PageView(
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
@ -162,6 +174,29 @@ class _LandingPagePharmacyState extends State<LandingPagePharmacy> {
); );
} }
void _scanQrAndGetProduct() async {
try {
String result = await BarcodeScanner.scan();
try {
String barcode = result;
GifLoaderDialogUtils.showMyDialog(context);
await BaseAppClient().get("$GET_PHARMACY_PRODUCTs_BY_SKU$barcode",
onSuccess: (dynamic response, int statusCode) {
print(response);
var product = PharmacyProduct.fromJson(response["products"][0]);
GifLoaderDialogUtils.hideDialog(context);
Navigator.push(context, FadePage(page: ProductDetailPage(product)));
}, onFailure: (String error, int statusCode) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: "Product not found");
});
} catch (apiEx) {
AppToast.showErrorToast(
message: "Something went wrong, please try again");
}
} catch (barcodeEx) {}
}
getText(currentTab) { getText(currentTab) {
switch (currentTab) { switch (currentTab) {
case 2: case 2:

@ -44,11 +44,9 @@ class _Login extends State<Login> {
final authService = new AuthProvider(); final authService = new AuthProvider();
var sharedPref = new AppSharedPreferences(); var sharedPref = new AppSharedPreferences();
bool isLoading = false; bool isLoading = false;
AppointmentRateViewModel appointmentRateViewModel = AppointmentRateViewModel appointmentRateViewModel = locator<AppointmentRateViewModel>();
locator<AppointmentRateViewModel>();
AuthenticatedUserObject authenticatedUserObject = AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
locator<AuthenticatedUserObject>();
ProjectViewModel projectViewModel; ProjectViewModel projectViewModel;
ToDoCountProviderModel toDoProvider; ToDoCountProviderModel toDoProvider;
@ -101,16 +99,9 @@ class _Login extends State<Login> {
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
controller: nationalIDorFile, controller: nationalIDorFile,
onChanged: (value) => {validateForm()}, onChanged: (value) => {validateForm()},
prefixIcon: Icon( prefixIcon: Icon(loginType == 1 ? Icons.chrome_reader_mode : Icons.receipt, color: Color(0xFF40ACC9)),
loginType == 1 padding: EdgeInsets.only(top: 20, bottom: 20, left: 10, right: 10),
? Icons.chrome_reader_mode hintText: loginType == 1 ? TranslationBase.of(context).nationalID : TranslationBase.of(context).fileNo,
: Icons.receipt,
color: Color(0xFF40ACC9)),
padding: EdgeInsets.only(
top: 20, bottom: 20, left: 10, right: 10),
hintText: loginType == 1
? TranslationBase.of(context).nationalID
: TranslationBase.of(context).fileNo,
))) )))
], ],
), ),
@ -133,9 +124,7 @@ class _Login extends State<Login> {
child: DefaultButton( child: DefaultButton(
TranslationBase.of(context).login, TranslationBase.of(context).login,
() => {this.startLogin()}, () => {this.startLogin()},
color: isButtonDisabled == true color: isButtonDisabled == true ? Colors.grey : Colors.grey[900],
? Colors.grey
: Colors.grey[900],
textColor: Colors.white, textColor: Colors.white,
)) ))
], ],
@ -156,8 +145,7 @@ class _Login extends State<Login> {
} }
void validateForm() { void validateForm() {
if (util.validateIDBox(nationalIDorFile.text, loginType) == true && if (util.validateIDBox(nationalIDorFile.text, loginType) == true && util.isSAUDIIDValid(nationalIDorFile.text, loginType) == true) {
util.isSAUDIIDValid(nationalIDorFile.text, loginType) == true) {
setState(() { setState(() {
isButtonDisabled = false; isButtonDisabled = false;
}); });
@ -242,50 +230,49 @@ class _Login extends State<Login> {
this.authService.checkActivationCode(request, code).then((result) async { this.authService.checkActivationCode(request, code).then((result) async {
sharedPref.remove(FAMILY_FILE); sharedPref.remove(FAMILY_FILE);
// Register GeoZones after login // Register GeoZones after login
registerGeoZones(); registerGeoZones();
projectViewModel.setPrivilege(privilegeList: result); projectViewModel.setPrivilege(privilegeList: result);
result = CheckActivationCode.fromJson(result); result = CheckActivationCode.fromJson(result);
result.list.isFamily = false; result.list.isFamily = false;
// this.sharedPref.setString(BLOOD_TYPE, result['PatientBloodType']), // this.sharedPref.setString(BLOOD_TYPE, result['PatientBloodType']),
this.sharedPref.setObject(USER_PROFILE, result.list); this.sharedPref.setObject(USER_PROFILE, result.list);
this.sharedPref.setObject(MAIN_USER, result.list); this.sharedPref.setObject(MAIN_USER, result.list);
this.sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID); this.sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID);
this.sharedPref.setString(TOKEN, result.authenticationTokenID); this.sharedPref.setString(TOKEN, result.authenticationTokenID);
await authenticatedUserObject.getUser(getUser: true); await authenticatedUserObject.getUser(getUser: true);
authenticatedUserObject.isLogin = true; authenticatedUserObject.isLogin = true;
appointmentRateViewModel.isLogin = true; appointmentRateViewModel.isLogin = true;
projectViewModel.isLogin = true; projectViewModel.isLogin = true;
projectViewModel.user = authenticatedUserObject.user; projectViewModel.user = authenticatedUserObject.user;
appointmentRateViewModel appointmentRateViewModel
.getIsLastAppointmentRatedList() .getIsLastAppointmentRatedList()
.then((value) => { .then((value) => {
getToDoCount(), getToDoCount(),
GifLoaderDialogUtils.hideDialog(context), GifLoaderDialogUtils.hideDialog(context),
if (appointmentRateViewModel.isHaveAppointmentNotRate) if (appointmentRateViewModel.isHaveAppointmentNotRate)
{ {
Navigator.pushAndRemoveUntil( Navigator.pushAndRemoveUntil(
context, context,
FadePage( FadePage(
page: RateAppointmentDoctor(), page: RateAppointmentDoctor(),
), ),
(r) => false) (r) => false)
} }
else else
{ {
Navigator.pushAndRemoveUntil( Navigator.pushAndRemoveUntil(
context, context,
FadePage( FadePage(
page: LandingPage(), page: LandingPage(),
), ),
(r) => false) (r) => false)
} }
}) })
.catchError((err) { .catchError((err) {
print(err); print(err);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
}); });
});
});
} }
getToDoCount() { getToDoCount() {

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: true, isShowAppBar: false,
isPharmacy: true, isPharmacy: true,
baseViewModel: model, baseViewModel: model,
backgroundColor: Colors.white, backgroundColor: Colors.white,

@ -1,5 +1,7 @@
import 'package:carousel_slider/carousel_slider.dart'; import 'package:carousel_slider/carousel_slider.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart';
import 'package:diplomaticquarterapp/pages/offers_categorise_page.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart';
@ -39,20 +41,25 @@ class _BannerPagerState extends State<BannerPager> {
items: widget._model items: widget._model
.getBannerImagesUrl() .getBannerImagesUrl()
.mapIndexed( .mapIndexed(
(item, index) => Container( (item, index) => InkWell(
margin: EdgeInsets.symmetric(horizontal: 1.0), onTap: () {
child: ClipRRect( Navigator.push(context, FadePage(page: OffersCategorisePage()));
borderRadius: BorderRadius.all(Radius.circular(5.0)), },
child: Center( child: Container(
child: index == 0 margin: EdgeInsets.symmetric(horizontal: 1.0),
? Image.asset( child: ClipRRect(
item, borderRadius: BorderRadius.all(Radius.circular(5.0)),
fit: BoxFit.cover, child: Center(
) child: index == 0
: Image.network( ? Image.asset(
item, item,
fit: BoxFit.cover, fit: BoxFit.cover,
), )
: Image.network(
item,
fit: BoxFit.cover,
),
),
), ),
), ),
), ),

@ -29,9 +29,7 @@ class _PharmacyCategorisePageState extends State<PharmacyCategorisePage> {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<PharmacyCategoriseViewModel>( return BaseView<PharmacyCategoriseViewModel>(
onModelReady: (model) => model.getCategorise(), onModelReady: (model) => model.getCategorise(),
builder: (BuildContext context, PharmacyCategoriseViewModel model, builder: (BuildContext context, PharmacyCategoriseViewModel model, Widget child) => AppScaffold(
Widget child) =>
AppScaffold(
isShowDecPage: false, isShowDecPage: false,
baseViewModel: model, baseViewModel: model,
body: Column( body: Column(
@ -59,9 +57,7 @@ class _PharmacyCategorisePageState extends State<PharmacyCategorisePage> {
child: Padding( child: Padding(
padding: EdgeInsets.symmetric(horizontal: 10.0), padding: EdgeInsets.symmetric(horizontal: 10.0),
child: Texts( child: Texts(
projectViewModel.isArabic projectViewModel.isArabic ? model.categorise[index].namen : model.categorise[index].name,
? model.categorise[index].namen
: model.categorise[index].name,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), ),
), ),
@ -70,15 +66,14 @@ class _PharmacyCategorisePageState extends State<PharmacyCategorisePage> {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => builder: (context) => model.categorise[index].id != '12'
model.categorise[index].id != '12' ? ParentCategorisePage(
? ParentCategorisePage( id: model.categorise[index].id,
id: model.categorise[index].id, titleName: model.categorise[index].name,
titleName: model.categorise[index].name, )
) : FinalProductsPage(
: FinalProductsPage( id: model.categorise[index].id,
id: model.categorise[index].id, ),
),
), ),
), ),
}, },
@ -91,10 +86,7 @@ class _PharmacyCategorisePageState extends State<PharmacyCategorisePage> {
height: 140, height: 140,
child: Column( child: Column(
children: [ children: [
Divider( Divider(height: 2.0, thickness: 1.0, color: Colors.black12.withOpacity(0.14)),
height: 2.0,
thickness: 1.0,
color: Colors.black12.withOpacity(0.14)),
SizedBox( SizedBox(
height: 10.0, height: 10.0,
), ),
@ -103,20 +95,21 @@ class _PharmacyCategorisePageState extends State<PharmacyCategorisePage> {
Expanded( Expanded(
child: Padding( child: Padding(
padding: EdgeInsets.all(4.0), padding: EdgeInsets.all(4.0),
child: Container( child: InkWell(
height: 50.0, onTap: () {},
width: 55.0, child: Container(
decoration: BoxDecoration( height: 50.0,
borderRadius: BorderRadius.circular(5.0), width: 55.0,
color: Colors.green.shade300.withOpacity(0.34), decoration: BoxDecoration(
), borderRadius: BorderRadius.circular(5.0),
child: Padding( color: Colors.green.shade300.withOpacity(0.34),
padding: EdgeInsets.symmetric(horizontal: 10.0), ),
child: Texts( child: Padding(
projectViewModel.isArabic padding: EdgeInsets.symmetric(horizontal: 10.0),
? 'الاكثر مبيعا' child: Texts(
: 'Best Sellers', projectViewModel.isArabic ? 'الاكثر مبيعا' : 'Best Sellers',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
),
), ),
), ),
), ),
@ -129,16 +122,13 @@ class _PharmacyCategorisePageState extends State<PharmacyCategorisePage> {
height: 50.0, height: 50.0,
width: 55.0, width: 55.0,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.orangeAccent.shade200 color: Colors.orangeAccent.shade200.withOpacity(0.34),
.withOpacity(0.34),
borderRadius: BorderRadius.circular(5.0), borderRadius: BorderRadius.circular(5.0),
), ),
child: Padding( child: Padding(
padding: EdgeInsets.symmetric(horizontal: 10.0), padding: EdgeInsets.symmetric(horizontal: 10.0),
child: Texts( child: Texts(
projectViewModel.isArabic projectViewModel.isArabic ? 'الاكثر مشاهدة' : 'Most Viewed',
? 'الاكثر مشاهدة'
: 'Most Viewed',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), ),
), ),
@ -162,9 +152,7 @@ class _PharmacyCategorisePageState extends State<PharmacyCategorisePage> {
child: Padding( child: Padding(
padding: EdgeInsets.symmetric(horizontal: 10.0), padding: EdgeInsets.symmetric(horizontal: 10.0),
child: Texts( child: Texts(
projectViewModel.isArabic projectViewModel.isArabic ? 'منتجات جديدة' : 'New Products',
? 'منتجات جديدة'
: 'New Products',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), ),
), ),
@ -182,17 +170,13 @@ class _PharmacyCategorisePageState extends State<PharmacyCategorisePage> {
height: 50.0, height: 50.0,
width: 55.0, width: 55.0,
decoration: BoxDecoration( decoration: BoxDecoration(
color: color: Colors.purple.shade200.withOpacity(0.34),
Colors.purple.shade200.withOpacity(0.34),
borderRadius: BorderRadius.circular(5.0), borderRadius: BorderRadius.circular(5.0),
), ),
child: Padding( child: Padding(
padding: padding: EdgeInsets.symmetric(horizontal: 10.0),
EdgeInsets.symmetric(horizontal: 10.0),
child: Texts( child: Texts(
projectViewModel.isArabic projectViewModel.isArabic ? 'شوهد مؤخرا' : 'Recently Viewed',
? 'شوهد مؤخرا'
: 'Recently Viewed',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), ),
), ),
@ -220,7 +204,7 @@ class _PharmacyCategorisePageState extends State<PharmacyCategorisePage> {
/// int patientID = get from qr result /// int patientID = get from qr result
String result = await BarcodeScanner.scan(); String result = await BarcodeScanner.scan();
var data = json.decode(result); var data = json.decode(result);
if (data!=null) { if (data != null) {
var qRParkingID = data['QRParkingID']; var qRParkingID = data['QRParkingID'];
await model.scanQr(); await model.scanQr();
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {

@ -102,20 +102,24 @@ class ProductDetailService extends BaseService {
}, body: request); }, body: request);
} }
Future notifyMe(customerId, itemID) async {
hasError = false;
await baseAppClient.get(SUBSCRIBE_PRODUCT + "SinceId=$customerId&ProductId=$itemID", onSuccess: (dynamic response, int statusCode) {
AppToast.showSuccessToast(message: 'You will be notified when product available');
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
AppToast.showErrorToast(message: 'something went wrong please try again');
});
}
Future addToWishlist(itemID) async { Future addToWishlist(itemID) async {
var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID); var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID);
hasError = false; hasError = false;
Map<String, dynamic> request; Map<String, dynamic> request;
request = { request = {
"shopping_cart_item": "shopping_cart_item": {"quantity": 1, "shopping_cart_type": "Wishlist", "product_id": itemID, "customer_id": customerId, "language_id": 1}
{
"quantity": 1,
"shopping_cart_type": "Wishlist",
"product_id": itemID,
"customer_id": customerId,
"language_id": 1
}
}; };
await baseAppClient.post(GET_SHOPPING_CART, await baseAppClient.post(GET_SHOPPING_CART,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {

Loading…
Cancel
Save