Qr icon added, notify me api added & improvements

merge-requests/256/head
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";
///Doctor
const GET_MY_DOCTOR =
'Services/Doctors.svc/REST/GetPatientDoctorAppointmentResult';
const GET_MY_DOCTOR = 'Services/Doctors.svc/REST/GetPatientDoctorAppointmentResult';
const GET_DOCTOR_PROFILE = 'Services/Doctors.svc/REST/GetDocProfiles';
const GET_DOCTOR_RATING_NOTES =
'Services/Doctors.svc/REST/dr_GetNotesDoctorRating';
const GET_DOCTOR_RATING_DETAILS =
'Services/Doctors.svc/REST/dr_GetDoctorRatingDetails';
const GET_DOCTOR_RATING_NOTES = 'Services/Doctors.svc/REST/dr_GetNotesDoctorRating';
const GET_DOCTOR_RATING_DETAILS = 'Services/Doctors.svc/REST/dr_GetDoctorRatingDetails';
const GET_DOCTOR_RATING = 'Services/Doctors.svc/REST/dr_GetAvgDoctorRating';
///Prescriptions
const PRESCRIPTIONS = 'Services/Patients.svc/REST/GetPrescriptionApptList';
const GET_PRESCRIPTIONS_ALL_ORDERS =
'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders';
const GET_PRESCRIPTION_REPORT =
'Services/Patients.svc/REST/INP_GetPrescriptionReport';
const SEND_PRESCRIPTION_EMAIL =
'Services/Notifications.svc/REST/SendPrescriptionEmail';
const GET_PRESCRIPTION_REPORT_ENH =
'Services/Patients.svc/REST/GetPrescriptionReport_enh';
const GET_PRESCRIPTIONS_ALL_ORDERS = 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders';
const GET_PRESCRIPTION_REPORT = 'Services/Patients.svc/REST/INP_GetPrescriptionReport';
const SEND_PRESCRIPTION_EMAIL = 'Services/Notifications.svc/REST/SendPrescriptionEmail';
const GET_PRESCRIPTION_REPORT_ENH = 'Services/Patients.svc/REST/GetPrescriptionReport_enh';
///Lab Order
const GET_Patient_LAB_ORDERS = 'Services/Patients.svc/REST/GetPatientLabOrders';
const GET_Patient_LAB_SPECIAL_RESULT = 'Services/Patients.svc/REST/GetPatientLabSpecialResults';
const SEND_LAB_RESULT_EMAIL =
'Services/Notifications.svc/REST/SendLabReportEmail';
const GET_Patient_LAB_RESULT =
'Services/Patients.svc/REST/GetPatientLabResults';
const GET_Patient_LAB_ORDERS_RESULT =
'Services/Patients.svc/REST/GetPatientLabOrdersResults';
const SEND_LAB_RESULT_EMAIL = 'Services/Notifications.svc/REST/SendLabReportEmail';
const GET_Patient_LAB_RESULT = '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_LAB_ORDERS_BY_APPOINTMENT =
'Services/Patients.svc/REST/GetPatientLabResultsByAppointmentNo';
const GET_PATIENT_LAB_ORDERS_BY_APPOINTMENT = 'Services/Patients.svc/REST/GetPatientLabResultsByAppointmentNo';
const GET_PATIENT_ORDERS_DETAILS = 'Services/Patients.svc/REST/Rad_UpdatePatientRadOrdersToRead';
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
const REPORTS = 'Services/Doctors.svc/REST/GetPatientMedicalReportStatusInfo';
const INSERT_REQUEST_FOR_MEDICAL_REPORT = 'Services/Doctors.svc/REST/InsertRequestForMedicalReport';
const SEND_MEDICAL_REPORT_EMAIL =
'Services/Notifications.svc/REST/SendMedicalReportEmail';
const SEND_MEDICAL_REPORT_EMAIL = 'Services/Notifications.svc/REST/SendMedicalReportEmail';
///Rate
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 INSURANCE_DETAILS = "Services/Patients.svc/REST/Get_InsuranceCheckList";
const GET_PATIENT_INSURANCE_DETAILS =
"Services/Patients.svc/REST/PatientER_GetPatientInsuranceDetails";
const UPLOAD_INSURANCE_CARD =
'Services/Patients.svc/REST/PatientER_PatientInfoForInsuranceCardUpdate';
const GET_PATIENT_INSURANCE_DETAILS = "Services/Patients.svc/REST/PatientER_GetPatientInsuranceDetails";
const UPLOAD_INSURANCE_CARD = 'Services/Patients.svc/REST/PatientER_PatientInfoForInsuranceCardUpdate';
const GET_VACCINES = "Services/Patients.svc/REST/GetDoneVaccinesByPatientID";
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 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 = 'Services/Patients.svc/REST/Patient_GetWeightMeasurementResult';
const ADD_WEIGHT_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_AddWeightMeasurementResult';
const UPDATE_WEIGHT_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_UpdateWeightMeasurementResult';
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_BEST_SELLER_PRODUCT = "epharmacy/api/bestsellerproducts";
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 SUBSCRIBE_PRODUCT = "epharmacy/api/subscribe?";
const GET_ORDER = "orders?";
const GET_ORDER_DETAILS = "orders/";
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_SHIPPING_OPTIONS = "epharmacy/api/get_shipping_option/";
const DELETE_SHOPPING_CART = "epharmacy/api/delete_shopping_cart_items/";
const DELETE_SHOPPING_CART_ALL =
"epharmacy/api/delete_shopping_cart_item_by_customer/";
const DELETE_SHOPPING_CART_ALL = "epharmacy/api/delete_shopping_cart_item_by_customer/";
const ORDER_SHOPPING_CART = "epharmacy/api/orders";
const GET_LACUM_ACCOUNT_INFORMATION =
"Services/Patients.svc/REST/GetLakumAccountInformation";
const GET_LACUM_GROUP_INFORMATION =
"Services/Patients.svc/REST/GetlakumInQueryInfoGrouping";
const LACUM_ACCOUNT_ACTIVATE =
"Services/Patients.svc/REST/LakumAccountActivation";
const LACUM_ACCOUNT_DEACTIVATE =
"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 GET_LACUM_ACCOUNT_INFORMATION = "Services/Patients.svc/REST/GetLakumAccountInformation";
const GET_LACUM_GROUP_INFORMATION = "Services/Patients.svc/REST/GetlakumInQueryInfoGrouping";
const LACUM_ACCOUNT_ACTIVATE = "Services/Patients.svc/REST/LakumAccountActivation";
const LACUM_ACCOUNT_DEACTIVATE = "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';
// 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_CMC_ORDER_DETAIL_BY_ID = "Services/Patients.svc/REST/PatientER_CMC_GetTransactionsForOrder";
const GET_CHECK_UP_ITEMS = "Services/Patients.svc/REST/GetCheckUpItems";
const PUSH_NOTIFICATION_GET_ALL_NOTIFICATIONS =
'Services/MobileNotifications.svc/REST/PushNotification_GetAllNotifications';
const PUSH_NOTIFICATION_SET_MESSAGES_FROM_POOL_AS_READ =
'Services/MobileNotifications.svc/REST/PushNotification_SetMessagesFromPoolAsRead';
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 PUSH_NOTIFICATION_GET_ALL_NOTIFICATIONS = 'Services/MobileNotifications.svc/REST/PushNotification_GetAllNotifications';
const PUSH_NOTIFICATION_SET_MESSAGES_FROM_POOL_AS_READ = 'Services/MobileNotifications.svc/REST/PushNotification_SetMessagesFromPoolAsRead';
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 BLOOD_DONATION_REGISTER_BLOOD_TYPE = 'Services/PatientVarification.svc/REST/BloodDonation_RegisterBloodType';
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=";
// External API
const ADD_ADDRESS_INFO =
"https://mdlaboratories.com/exacartapi/api/addcustomeraddress";
const GET_CUSTOMER_ADDRESSES =
"https://mdlaboratories.com/exacartapi/api/Customers/";
const GET_CUSTOMER_INFO =
"https://mdlaboratories.com/exacartapi/api/VerifyCustomer";
const ADD_ADDRESS_INFO = "https://mdlaboratories.com/exacartapi/api/addcustomeraddress";
const GET_CUSTOMER_ADDRESSES = "https://mdlaboratories.com/exacartapi/api/Customers/";
const GET_CUSTOMER_INFO = "https://mdlaboratories.com/exacartapi/api/VerifyCustomer";
//Pharmacy
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';
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';
const GET_OFFERS_CATEGORISE = 'epharmacy/api/discountcategories';
const GET_OFFERS_PRODUCTS = 'epharmacy/api/offerproducts/';
const GET_CATEGORISE_PARENT =
'epharmacy/api/categories?fields=id,name,namen,description,image,localized_names,display_order,parent_category_id,is_leaf&parent_id=';
const GET_CATEGORISE_PARENT = '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_SUB_CATEGORISE =
'epharmacy/api/categories?fields=id,name,namen,description,image,localized_names,display_order,parent_category_id,is_leaf&parent_id=';
const GET_SUB_CATEGORISE = '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_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=';
const TIMER_MIN = 10;
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/uitl/app_shared_preferences.dart';
class PharmacyModuleService extends BaseService {
final AppSharedPreferences sharedPref = AppSharedPreferences();
bool isFinished = true;
bool hasError = false;
String errorMsg = '';
String url ="";
String url = "";
List<PharmacyImageObject> bannerItems = List();
List<Manufacturer> manufacturerList = List();
List<PharmacyProduct> bestSellerProducts = List();
List<PharmacyProduct> lastVisitedProducts = List();
Future makeVerifyCustomer(dynamic data) async {
Map<String, String> queryParams = {'FileNumber': data['PatientID'].toString()};
hasError = false;
try {
await baseAppClient.get(PHARMACY_VERIFY_CUSTOMER,
onSuccess: (dynamic response, int statusCode) {
await baseAppClient.get(PHARMACY_VERIFY_CUSTOMER, onSuccess: (dynamic response, int statusCode) {
if (response['UserName'] != null) {
sharedPref.setString(PHARMACY_CUSTOMER_ID, response['CustomerId'].toString());
print(response);
@ -58,8 +54,7 @@ class PharmacyModuleService extends BaseService {
};
hasError = false;
try {
await baseAppClient.get(PHARMACY_CREATE_CUSTOMER,
onSuccess: (dynamic response, int statusCode) {
await baseAppClient.get(PHARMACY_CREATE_CUSTOMER, onSuccess: (dynamic response, int statusCode) {
if (!response['IsRegistered']) {}
}, onFailure: (String error, int statusCode) {
hasError = true;
@ -73,8 +68,7 @@ class PharmacyModuleService extends BaseService {
Future getBannerListList() async {
hasError = false;
try {
await baseAppClient.get(GET_PHARMACY_BANNER,
onSuccess: (dynamic response, int statusCode) {
await baseAppClient.get(GET_PHARMACY_BANNER, onSuccess: (dynamic response, int statusCode) {
bannerItems.clear();
response['images'].forEach((item) {
bannerItems.add(PharmacyImageObject.fromJson(item));
@ -91,12 +85,11 @@ class PharmacyModuleService extends BaseService {
Future getTopManufacturerList() async {
Map<String, String> queryParams = {'page': '1', 'limit': '8'};
try {
await baseAppClient.get(GET_PHARMACY_TOP_MANUFACTURER,
onSuccess: (dynamic response, int statusCode) {
await baseAppClient.get(GET_PHARMACY_TOP_MANUFACTURER, onSuccess: (dynamic response, int statusCode) {
manufacturerList.clear();
response['manufacturer'].forEach((item) {
Manufacturer manufacturer = Manufacturer.fromJson(item);
if(manufacturer.image != null){
if (manufacturer.image != null) {
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',
};
try {
await baseAppClient.get(GET_PHARMACY_BEST_SELLER_PRODUCT,
onSuccess: (dynamic response, int statusCode) {
await baseAppClient.get(GET_PHARMACY_BEST_SELLER_PRODUCT, onSuccess: (dynamic response, int statusCode) {
bestSellerProducts.clear();
response['products'].forEach((item) {
bestSellerProducts.add(PharmacyProduct.fromJson(item));
@ -132,13 +124,10 @@ class PharmacyModuleService extends BaseService {
Future getLastVisitedProducts() async {
String lastVisited = "";
if (await this.sharedPref.getString(PHARMACY_LAST_VISITED_PRODUCTS) !=
null) {
lastVisited =
await this.sharedPref.getString(PHARMACY_LAST_VISITED_PRODUCTS);
if (await this.sharedPref.getString(PHARMACY_LAST_VISITED_PRODUCTS) != null) {
lastVisited = await this.sharedPref.getString(PHARMACY_LAST_VISITED_PRODUCTS);
try {
await baseAppClient.get("$GET_PHARMACY_PRODUCTs_BY_IDS$lastVisited",
onSuccess: (dynamic response, int statusCode) {
await baseAppClient.get("$GET_PHARMACY_PRODUCTs_BY_IDS$lastVisited", onSuccess: (dynamic response, int statusCode) {
lastVisitedProducts.clear();
response['products'].forEach((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);
}
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 {
hasError = false;
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/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/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_categorise.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/utils.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/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/wishlist.dart';
import '../offers_categorise_page.dart';
class LandingPagePharmacy extends StatefulWidget {
@override
_LandingPagePharmacyState createState() => _LandingPagePharmacyState();
@ -39,105 +49,107 @@ class _LandingPagePharmacyState extends State<LandingPagePharmacy> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: currentTab == 0 || currentTab == 1
? AppBar(
backgroundColor: Color(0xff5AB145),
elevation: 0,
title: Container(
height: MediaQuery.of(context).size.height * 0.056,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(5.0),
color: Colors.white,
),
child: InkWell(
child: Padding(
padding: EdgeInsets.all(8.0),
child: Row(
//crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Icon(Icons.search, size: 25.0),
SizedBox(
width: 15.0,
),
Texts(
TranslationBase.of(context).searchProductHere,
fontSize: 13,
)
],
),
appBar:
// currentTab == 0 || currentTab == 1 || currentTab == 2
// ?
AppBar(
backgroundColor: Color(0xff5AB145),
elevation: 0,
title: Container(
height: MediaQuery.of(context).size.height * 0.056,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(5.0),
color: Colors.white,
),
child: InkWell(
child: Padding(
padding: EdgeInsets.all(8.0),
child: Row(
//crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Icon(Icons.search, size: 25.0),
SizedBox(
width: 15.0,
),
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => SearchProductsPage()),
);
},
Texts(
TranslationBase.of(context).searchProductHere,
fontSize: 13,
)
],
),
),
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: (){
setState(() {
currentTab = 0;
pageController.jumpToPage(0);
});
},
child: Container(
height: 2.0,
width: 10.0,
child: Image.asset(
'assets/images/pharmacy_logo.png',
),
),
);
},
);
},
),
actions: [
IconButton(
// iconSize: 70,
icon: Image.asset(
'assets/images/new-design/qr-code.png',
),
actions: [
// IconButton(
// iconSize: 70,
// icon: SvgPicture.asset('assets/images/svg/robort_svg.svg',
// height: 100, width: 100, fit: BoxFit.cover),
// onPressed: () {
// triggerRobot();
// } //do something,
// )
],
centerTitle: true,
)
: currentTab == 4
? null
: AppBar(
backgroundColor: Color(0xff5AB145),
elevation: 0,
textTheme: TextTheme(
headline6: TextStyle(
color: Colors.white, fontWeight: FontWeight.bold),
),
title: Text(getText(currentTab).toUpperCase()),
leading: Builder(
builder: (BuildContext context) {
return IconButton(
icon: Icon(Icons.arrow_back),
color: Colors.white,
onPressed: () => Scaffold.of(context).openDrawer(),
);
},
),
actions: [
// IconButton(
// iconSize: 70,
// icon: SvgPicture.asset('assets/images/svg/robort_svg.svg',
// height: 100, width: 100, fit: BoxFit.cover),
// onPressed: () {
// triggerRobot();
// } //do something,
// )
],
centerTitle: true,
),
onPressed: _scanQrAndGetProduct //do something,
)
],
centerTitle: true,
),
// : currentTab == 4
// ? null:null,
// : AppBar(
// backgroundColor: Color(0xff5AB145),
// elevation: 0,
// textTheme: TextTheme(
// headline6: TextStyle(
// color: Colors.white, fontWeight: FontWeight.bold),
// ),
// title: Text(getText(currentTab).toUpperCase()),
// leading: Builder(
// builder: (BuildContext context) {
// return IconButton(
// icon: Icon(Icons.arrow_back),
// color: Colors.white,
// onPressed: () => Scaffold.of(context).openDrawer(),
// );
// },
// ),
// actions: [
// // IconButton(
// // iconSize: 70,
// // icon: SvgPicture.asset('assets/images/svg/robort_svg.svg',
// // height: 100, width: 100, fit: BoxFit.cover),
// // onPressed: () {
// // triggerRobot();
// // } //do something,
// // )
// ],
// centerTitle: true,
// ),
extendBody: false,
body: PageView(
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) {
switch (currentTab) {
case 2:

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

File diff suppressed because it is too large Load Diff

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

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

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

@ -102,20 +102,24 @@ class ProductDetailService extends BaseService {
}, 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 {
var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID);
hasError = false;
Map<String, dynamic> request;
request = {
"shopping_cart_item":
{
"quantity": 1,
"shopping_cart_type": "Wishlist",
"product_id": itemID,
"customer_id": customerId,
"language_id": 1
}
"shopping_cart_item": {"quantity": 1, "shopping_cart_type": "Wishlist", "product_id": itemID, "customer_id": customerId, "language_id": 1}
};
await baseAppClient.post(GET_SHOPPING_CART,
onSuccess: (dynamic response, int statusCode) {

Loading…
Cancel
Save