Merge branch 'pharmacy-Fatima' into 'development'

Pharmacy fatima

See merge request Cloud_Solution/diplomatic-quarter!249
merge-requests/250/merge
Mohammad Aljammal 4 years ago
commit 405f67be1e

@ -334,7 +334,7 @@ const GET_PHARMACY_BEST_SELLER_PRODUCT = "epharmacy/api/bestsellerproducts";
const GET_PHARMACY_PRODUCTs_BY_IDS = "epharmacy/api/productsbyids/";
const GET_CUSTOMERS_ADDRESSES = "epharmacy/api/Customers/";
const GET_ORDER = "orders?";
const GET_ORDER_DETAILS = "epharmacy/api/orders/";
const GET_ORDER_DETAILS = "orders/";
const ADD_CUSTOMER_ADDRESS = "epharmacy/api/addcustomeraddress";
const EDIT_CUSTOMER_ADDRESS = "epharmacy/api/editcustomeraddress";
const DELETE_CUSTOMER_ADDRESS = "epharmacy/api/deletecustomeraddress";
@ -361,6 +361,7 @@ 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
const HHC_GET_ALL_SERVICES = "Services/Patients.svc/REST/PatientER_HHC_GetAllServices";

@ -177,6 +177,7 @@ const Map localizedValues = {
'ar': 'ابحث عن الدواء هنا'
},
'description': {'en': 'Description', 'ar': 'الوصف'},
'howToUse': {'en': 'How to Use', 'ar': 'طريقة الأستخدام'},
'price': {'en': 'Price', 'ar': 'السعر'},
'youCanFindItIn': {'en': 'You can find it in', 'ar': 'يمكنكة ان تجده في'},
'pleaseEnterMedicineName': {
@ -618,6 +619,7 @@ const Map localizedValues = {
"cancelledOrder": {"en": " CANCELLED", "ar": "ملغي"},
"compare": {"en": " Compare", "ar": "مقارنه"},
"medicationsRefill": {"en": " Medication Refill", "ar": "طلب أعادة صرف"},
"recommended": {"en": " Recommended For You", "ar": "موصى لك"},
"myPrescription": {"en": " My Prescriptions", "ar": "وصفاتي"},
"quantity": {"en": " QTY ", "ar": "الكمية"},
"backMyAccount": {

@ -0,0 +1,157 @@
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
class Prescriptions {
String setupID;
int projectID;
int patientID;
int appointmentNo;
String appointmentDate;
String doctorName;
String clinicDescription;
String name;
int episodeID;
int actualDoctorRate;
int admission;
int clinicID;
String companyName;
String despensedStatus;
DateTime dischargeDate;
int dischargeNo;
int doctorID;
String doctorImageURL;
int doctorRate;
String doctorTitle;
int gender;
String genderDescription;
bool isActiveDoctorProfile;
bool isDoctorAllowVedioCall;
bool isExecludeDoctor;
bool isInOutPatient;
String isInOutPatientDescription;
String isInOutPatientDescriptionN;
bool isInsurancePatient;
String nationalityFlagURL;
int noOfPatientsRate;
String qR;
List<String> speciality;
Prescriptions(
{this.setupID,
this.projectID,
this.patientID,
this.appointmentNo,
this.appointmentDate,
this.doctorName,
this.clinicDescription,
this.name,
this.episodeID,
this.actualDoctorRate,
this.admission,
this.clinicID,
this.companyName,
this.despensedStatus,
this.dischargeDate,
this.dischargeNo,
this.doctorID,
this.doctorImageURL,
this.doctorRate,
this.doctorTitle,
this.gender,
this.genderDescription,
this.isActiveDoctorProfile,
this.isDoctorAllowVedioCall,
this.isExecludeDoctor,
this.isInOutPatient,
this.isInOutPatientDescription,
this.isInOutPatientDescriptionN,
this.isInsurancePatient,
this.nationalityFlagURL,
this.noOfPatientsRate,
this.qR,
this.speciality});
Prescriptions.fromJson(Map<String, dynamic> json) {
setupID = json['SetupID'];
projectID = json['ProjectID'];
patientID = json['PatientID'];
appointmentNo = json['AppointmentNo'];
appointmentDate = json['AppointmentDate'];
doctorName = json['DoctorName'];
clinicDescription = json['ClinicDescription'];
name = json['Name'];
episodeID = json['EpisodeID'];
actualDoctorRate = json['ActualDoctorRate'];
admission = json['Admission'];
clinicID = json['ClinicID'];
companyName = json['CompanyName'];
despensedStatus = json['Despensed_Status'];
dischargeDate = DateUtil.convertStringToDate(json['DischargeDate']);
dischargeNo = json['DischargeNo'];
doctorID = json['DoctorID'];
doctorImageURL = json['DoctorImageURL'];
doctorRate = json['DoctorRate'];
doctorTitle = json['DoctorTitle'];
gender = json['Gender'];
genderDescription = json['GenderDescription'];
isActiveDoctorProfile = json['IsActiveDoctorProfile'];
isDoctorAllowVedioCall = json['IsDoctorAllowVedioCall'];
isExecludeDoctor = json['IsExecludeDoctor'];
isInOutPatient = json['IsInOutPatient'];
isInOutPatientDescription = json['IsInOutPatientDescription'];
isInOutPatientDescriptionN = json['IsInOutPatientDescriptionN'];
isInsurancePatient = json['IsInsurancePatient'];
nationalityFlagURL = json['NationalityFlagURL'];
noOfPatientsRate = json['NoOfPatientsRate'];
qR = json['QR'];
// speciality = json['Speciality'].cast<String>();
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['SetupID'] = this.setupID;
data['ProjectID'] = this.projectID;
data['PatientID'] = this.patientID;
data['AppointmentNo'] = this.appointmentNo;
data['AppointmentDate'] = this.appointmentDate;
data['DoctorName'] = this.doctorName;
data['ClinicDescription'] = this.clinicDescription;
data['Name'] = this.name;
data['EpisodeID'] = this.episodeID;
data['ActualDoctorRate'] = this.actualDoctorRate;
data['Admission'] = this.admission;
data['ClinicID'] = this.clinicID;
data['CompanyName'] = this.companyName;
data['Despensed_Status'] = this.despensedStatus;
data['DischargeDate'] = this.dischargeDate;
data['DischargeNo'] = this.dischargeNo;
data['DoctorID'] = this.doctorID;
data['DoctorImageURL'] = this.doctorImageURL;
data['DoctorRate'] = this.doctorRate;
data['DoctorTitle'] = this.doctorTitle;
data['Gender'] = this.gender;
data['GenderDescription'] = this.genderDescription;
data['IsActiveDoctorProfile'] = this.isActiveDoctorProfile;
data['IsDoctorAllowVedioCall'] = this.isDoctorAllowVedioCall;
data['IsExecludeDoctor'] = this.isExecludeDoctor;
data['IsInOutPatient'] = this.isInOutPatient;
data['IsInOutPatientDescription'] = this.isInOutPatientDescription;
data['IsInOutPatientDescriptionN'] = this.isInOutPatientDescriptionN;
data['IsInsurancePatient'] = this.isInsurancePatient;
data['NationalityFlagURL'] = this.nationalityFlagURL;
data['NoOfPatientsRate'] = this.noOfPatientsRate;
data['QR'] = this.qR;
data['Speciality'] = this.speciality;
return data;
}
}
//class PrescriptionsList {
// String filterName = "";
// List<Prescriptions> prescriptionsList = List();
//
// PrescriptionsList({this.filterName, Prescriptions prescriptions}) {
// prescriptionsList.add(prescriptions);
// }
//}

@ -32,6 +32,7 @@ class OrderModel {
this.taxRates,
this.orderTax,
this.orderDiscount,
this.productCount,
this.orderTotal,
this.refundedAmount,
this.rewardPointsWereAdded,
@ -96,6 +97,7 @@ class OrderModel {
String taxRates;
double orderTax;
dynamic orderDiscount;
dynamic productCount;
double orderTotal;
dynamic refundedAmount;
dynamic rewardPointsWereAdded;
@ -160,6 +162,7 @@ class OrderModel {
taxRates: json["tax_rates"],
orderTax: json["order_tax"].toDouble(),
orderDiscount: json["order_discount"],
productCount: json["product_count"],
orderTotal: json["order_total"].toDouble(),
refundedAmount: json["refunded_amount"],
rewardPointsWereAdded: json["reward_points_were_added"],

@ -0,0 +1,77 @@
class OrdersModel {
List<Orders> orders;
OrdersModel({this.orders});
OrdersModel.fromJson(Map<String, dynamic> json) {
if (json['orders'] != null) {
orders = new List<Orders>();
json['orders'].forEach((v) {
orders.add(new Orders.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.orders != null) {
data['orders'] = this.orders.map((v) => v.toJson()).toList();
}
return data;
}
}
class Orders {
String id;
int productCount;
double orderTotal;
String createdOnUtc;
int orderStatusId;
String orderStatus;
String orderStatusn;
bool canCancel;
bool canRefund;
dynamic customerId;
Orders(
{this.id,
this.productCount,
this.orderTotal,
this.createdOnUtc,
this.orderStatusId,
this.orderStatus,
this.orderStatusn,
this.canCancel,
this.canRefund,
this.customerId,});
Orders.fromJson(Map<String, dynamic> json) {
try {
id = json['id'];
productCount = json['product_count'];
orderTotal = json['order_total'];
createdOnUtc = json['created_on_utc'];
orderStatusId = json['order_status_id'];
orderStatus = json['order_status'];
orderStatusn = json['order_statusn'];
canCancel = json['can_cancel'];
canRefund = json['can_refund'];
customerId = json['customer_id'];
}catch(e){
print(e);
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['product_count'] = this.productCount;
data['order_total'] = this.orderTotal;
data['created_on_utc'] = this.createdOnUtc;
data['order_status_id'] = this.orderStatusId;
data['order_status'] = this.orderStatus;
data['order_statusn'] = this.orderStatusn;
return data;
}
}

@ -6,17 +6,21 @@ 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 ="";
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;
@ -148,4 +152,5 @@ class PharmacyModuleService extends BaseService {
}
}
}
}

@ -0,0 +1,53 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/Prescriptions.dart';
class PrescriptionService extends BaseService {
final AppSharedPreferences sharedPref = AppSharedPreferences();
bool isFinished = true;
bool hasError = false;
String errorMsg = '';
String url = "";
List<Prescriptions> _prescriptionsList = List();
List<Prescriptions> get prescriptionsList => _prescriptionsList;
Future getPrescription() async {
hasError = false;
url = PRESCRIPTION;
print("Print PRESCRIPTION url" + url);
await baseAppClient.get(url,
onSuccess: (dynamic response, int statusCode) {
_prescriptionsList.clear();
response['PatientPrescriptionList'].forEach((item) {
_prescriptionsList.add(Prescriptions.fromJson(item));
});
print(_prescriptionsList.length);
print(response);
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
});
}
// Future getPrescription() async {
// hasError = false;
// Map<String, dynamic> body = Map();
// body['isDentalAllowedBackend'] = false;
// await baseAppClient.post(PRESCRIPTION,
// onSuccess: (dynamic response, int statusCode) {
// prescriptionsList.clear();
// response['PatientPrescriptionList'].forEach((prescriptions) {
// prescriptionsList.add(Prescriptions.fromJson(prescriptions));
// });
// }, onFailure: (String error, int statusCode) {
// hasError = true;
// super.error = error;
// }, body: body);
// }
}

@ -10,6 +10,7 @@ import 'package:diplomaticquarterapp/services/pharmacy_services/cancelOrder_serv
import 'package:diplomaticquarterapp/services/pharmacy_services/orderDetails_service.dart';
import 'package:diplomaticquarterapp/services/pharmacy_services/order_service.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/order_model.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/orders_model.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:flutter/material.dart';
import '../../../locator.dart';
@ -17,15 +18,12 @@ import '../base_view_model.dart';
class OrderModelViewModel extends BaseViewModel {
OrderService _orderService = locator<OrderService>();
List<OrderModel> get order => _orderService.orderList;
List<Orders> get orders => _orderService.orderList;
OrderDetailsService _orderDetailsService = locator<OrderDetailsService>();
List<OrderModel> get orderDetails => _orderDetailsService.orderDetails;
List<OrderModel> get orderListModel => _orderDetailsService.orderList;
CancelOrderService _cancelOrderService = locator<CancelOrderService>();
List<OrderModel> get cancelOrder => _cancelOrderService.cancelOrderList;
@ -52,9 +50,9 @@ class OrderModelViewModel extends BaseViewModel {
}
}
Future getOrderDetails(orderId) async {
Future getOrderDetails(OrderId) async {
setState(ViewState.Busy);
await _orderDetailsService.getOrderDetails(orderId);
await _orderDetailsService.getOrderDetails(OrderId);
if (_orderDetailsService.hasError) {
error = _orderDetailsService.error;
setState(ViewState.Error);

@ -3,7 +3,11 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/Manufacturer.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyImageObject.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/Prescriptions.dart';
//import 'package:diplomaticquarterapp/core/model/prescriptions/perscription_pharmacy.dart';
//import 'package:diplomaticquarterapp/core/service/medical/prescriptions_service.dart';
import 'package:diplomaticquarterapp/core/service/parmacyModule/parmacy_module_service.dart';
import 'package:diplomaticquarterapp/core/service/parmacyModule/prescription_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
import '../../../locator.dart';
@ -11,6 +15,8 @@ import '../../../locator.dart';
class PharmacyModuleViewModel extends BaseViewModel {
PharmacyModuleService _pharmacyService = locator<PharmacyModuleService>();
PrescriptionService _prescriptionService = locator<PrescriptionService>();
List<PharmacyImageObject> get bannerList => _pharmacyService.bannerItems;
List<Manufacturer> get manufacturerList => _pharmacyService.manufacturerList;
@ -21,6 +27,11 @@ class PharmacyModuleViewModel extends BaseViewModel {
List<PharmacyProduct> get lastVisitedProducts =>
_pharmacyService.lastVisitedProducts;
List<Prescriptions> get prescriptionsList =>
_prescriptionService.prescriptionsList;
// List<PharmacyProduct> get pharmacyPrescriptionsList => PharmacyProduct.pharmacyPrescriptionsList ;
Future getPharmacyHomeData() async {
setState(ViewState.Busy);
var data = await sharedPref.getObject(USER_PROFILE);
@ -92,6 +103,17 @@ class PharmacyModuleViewModel extends BaseViewModel {
}
}
/////////////RecommendedProducts
// _getRecommendedProducts() async {
// await _pharmacyService.getRecommendedProducts();
// if (_pharmacyService.hasError) {
// error = _pharmacyService.error;
// setState(ViewState.Error);
// } else {
// setState(ViewState.Idle);
// }
// }
Future<bool> checkUserIsActivated() async {
if (authenticatedUserObject.isLogin) {
var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID);
@ -105,4 +127,17 @@ class PharmacyModuleViewModel extends BaseViewModel {
return false;
}
}
getPrescription() async {
print("Print PRESCRIPTION url");
setState(ViewState.Busy);
await _prescriptionService.getPrescription();
if (_prescriptionService.hasError) {
error = _prescriptionService.error;
setState(ViewState.Error);
} else {
setState(ViewState.Idle);
}
}
}

@ -1,4 +1,5 @@
import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/H2O_service.dart';
import 'package:diplomaticquarterapp/core/service/parmacyModule/prescription_service.dart';
import 'package:diplomaticquarterapp/core/service/qr_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/user_information_view_model.dart';
@ -202,6 +203,8 @@ void setupLocator() {
locator.registerLazySingleton(() => CustomerAddressesService());
locator.registerLazySingleton(() => TermsConditionService());
locator.registerLazySingleton(() => CancelOrderService());
locator.registerLazySingleton(() => PrescriptionService());
locator.registerLazySingleton(() => PrivilegeService());
locator.registerLazySingleton(() => WeatherService());
@ -259,7 +262,6 @@ void setupLocator() {
locator.registerFactory(() => ProductDetailViewModel());
locator.registerFactory(() => WeatherViewModel());
locator.registerFactory(() => OrderPreviewViewModel());
locator.registerFactory(() => LacumViewModel());
locator.registerFactory(() => LacumTranferViewModel());
@ -271,11 +273,15 @@ void setupLocator() {
// Offer And Packages
//----------------------
locator.registerLazySingleton(() => OffersAndPackagesServices()); // offerPackagesServices Service
locator.registerFactory(() => OfferCategoriesViewModel()); // Categories View Model
locator.registerFactory(() => OfferProductsViewModel()); // Products View Model
locator.registerLazySingleton(
() => OffersAndPackagesServices()); // offerPackagesServices Service
locator.registerFactory(
() => OfferCategoriesViewModel()); // Categories View Model
locator
.registerFactory(() => OfferProductsViewModel()); // Products View Model
// Geofencing
// ---------------------
locator.registerLazySingleton(() => GeofencingServices()); // Geofencing Services
locator.registerLazySingleton(
() => GeofencingServices()); // Geofencing Services
}

@ -279,6 +279,31 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
SizedBox(
height: 10,
),
Container(
child: Text(
languageID == 'ar'
? widget.product.shortDescriptionn
: widget.product.shortDescription,
style: TextStyle(
fontSize: 16,
fontFamily: 'WorkSans-Regular'),
),
),
SizedBox(
height: 10,
),
Container(
child: Text(
TranslationBase.of(context).howToUse,
style: TextStyle(
fontSize: 17,
color: Colors.grey,
fontWeight: FontWeight.w600),
),
),
SizedBox(
height: 10,
),
Container(
child: Text(
languageID == 'ar'

@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/landing/home_page.dart';
import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_home_page.dart';
import 'package:diplomaticquarterapp/pages/offers_categorise_page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-order-page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/lakum-main-page.dart';
@ -15,11 +16,21 @@ import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:rating_bar/rating_bar.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/product-brands.dart';
import 'lacum-activitaion-vida-page.dart';
import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart';
class PharmacyPage extends StatelessWidget {
@override
void initState() {
// print("model prescription " + model.prescriptionsList.length);
// cancelOrderDetail(order)
}
@override
Widget build(BuildContext context) {
return BaseView<PharmacyModuleViewModel>(
@ -37,8 +48,242 @@ class PharmacyPage extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
BannerPager(model),
GridViewButtons(model),
BannerPager(model),
// GridViewButtons(model),
Container(
margin: EdgeInsets.fromLTRB(10, 10, 10, 10),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(
TranslationBase.of(context).myPrescription,
bold: true,
),
BorderedButton(
TranslationBase.of(context).viewAll,
hasBorder: true,
borderColor: Colors.green,
textColor: Colors.green,
vPadding: 6,
hPadding: 4,
handler: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
HomePrescriptionsPage()));
},
),
],
),
),
Container(
padding: EdgeInsets.symmetric(horizontal: 16.0, vertical: 24.0),
height: MediaQuery.of(context).size.height * 0.30,
// width: 200.0,
// height: MediaQuery.of(context).size.height / 4 + 20,
margin: EdgeInsets.only(left: 10),
child: BaseView<PharmacyModuleViewModel>(
onModelReady: (model) => model.getPrescription(),
builder: (_, model, wi) => model.prescriptionsList.length != 0
// model.getPrescription();
? ListView.builder(
scrollDirection: Axis.horizontal,
shrinkWrap: true,
physics: ScrollPhysics(),
// physics: NeverScrollableScrollPhysics(),
// itemCount: 4,
itemCount: model.prescriptionsList.length,
itemBuilder: (context, index) {
return Container(
// width: 160.0,
height: MediaQuery.of(context).size.height * 0.6,
padding: EdgeInsets.only(bottom: 5.0, left: 5.0),
margin: EdgeInsets.only(right: 10.0),
decoration: BoxDecoration(
border: Border.all(
color: Colors.grey,
style: BorderStyle.solid,
width: 1.0,
),
color: Colors.white,
borderRadius: BorderRadius.circular(10.0)),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Row(
children: <Widget>[
Column(children: [
Container(
padding: EdgeInsets.only(
top: 10.0,
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(
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,
),
)
]),
],
),
],
),
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:
CrossAxisAlignment.start,
children: <Widget>[
Container(
margin: EdgeInsets.only(left: 5),
child: Align(
alignment: Alignment.topLeft,
child: RatingBar.readOnly(
// initialRating: productRate,
size: 15.0,
filledColor: Colors.yellow[700],
emptyColor: Colors.grey[500],
isHalfAllowed: true,
halfFilledIcon: Icons.star_half,
filledIcon: Icons.star,
emptyIcon: Icons.star,
),
),
)
]),
]),
);
})
: Container(),
),
),
Container(
margin: EdgeInsets.fromLTRB(10, 10, 10, 10),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(
TranslationBase.of(context).recommended,
bold: true,
),
BorderedButton(
TranslationBase.of(context).viewAll,
hasBorder: true,
borderColor: Colors.green,
textColor: Colors.green,
vPadding: 6,
hPadding: 4,
handler: () {},
),
],
),
),
Container(
height: MediaQuery.of(context).size.height / 4 + 20,
child: ListView.builder(
itemBuilder: (ctx, i) =>
ProductTileItem(model.bestSellerProduct[i]),
scrollDirection: Axis.horizontal,
itemCount: model.bestSellerProduct.length,
),
),
Container(
margin: EdgeInsets.fromLTRB(10, 0, 10, 0),
child: Row(
@ -55,8 +300,9 @@ class PharmacyPage extends StatelessWidget {
hPadding: 4,
borderColor: Colors.green,
textColor: Colors.green,
handler: () =>{
Navigator.push(context,FadePage(page: ProductBrandsPage())),
handler: () => {
Navigator.push(
context, FadePage(page: ProductBrandsPage())),
},
),
],
@ -119,8 +365,9 @@ class PharmacyPage extends StatelessWidget {
textColor: Colors.green,
vPadding: 6,
hPadding: 4,
handler: () =>{
Navigator.push(context,FadePage(page: ProductBrandsPage())),
handler: () => {
Navigator.push(
context, FadePage(page: ProductBrandsPage())),
},
),
],
@ -180,15 +427,15 @@ class GridViewButtons extends StatelessWidget {
hasColorFilter: false,
child: GridViewCard(TranslationBase.of(context).medicationRefill,
'assets/images/pharmacy_module/medication_icon.png', () {
model.checkUserIsActivated().then((isActivated) {
if (isActivated) {
Navigator.push(context, FadePage(page: LakumMainPage()));
} else {
Navigator.push(
context, FadePage(page: LakumActivationVidaPage()));
}
});
}),
model.checkUserIsActivated().then((isActivated) {
if (isActivated) {
Navigator.push(context, FadePage(page: LakumMainPage()));
} else {
Navigator.push(
context, FadePage(page: LakumActivationVidaPage()));
}
});
}),
),
DashboardItem(
imageName: 'pharmacy_module/bg_3.png',
@ -196,8 +443,9 @@ class GridViewButtons extends StatelessWidget {
hasColorFilter: false,
child: GridViewCard(TranslationBase.of(context).myPrescriptions,
'assets/images/pharmacy_module/prescription_icon.png', () {
Navigator.push(context, FadePage(page: PharmacyAddressesPage()));
}),
Navigator.push(
context, FadePage(page: PharmacyAddressesPage()));
}),
),
DashboardItem(
imageName: 'pharmacy_module/bg_4.png',
@ -206,7 +454,7 @@ class GridViewButtons extends StatelessWidget {
child: GridViewCard(
TranslationBase.of(context).searchAndScanMedication,
'assets/images/pharmacy_module/search_scan_icon.png',
() {}),
() {}),
),
],
),

@ -9,6 +9,7 @@ import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/services/pharmacy_services/order_service.dart';
import 'package:diplomaticquarterapp/pages/pharmacy/order/OrderDetails.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/order_model.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/orders_model.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
@ -31,11 +32,11 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
String customerId = "";
String order ="";
List <OrderModel> orderList = [] ;
List <OrderModel> deliveredOrderList = [] ;
List <OrderModel> processingOrderList = [];
List <OrderModel> cancelledOrderList = [];
List <OrderModel> pendingOrderList = [];
List <Orders> orderList = [] ;
List <Orders> deliveredOrderList = [] ;
List <Orders> processingOrderList = [];
List <Orders> cancelledOrderList = [];
List <Orders> pendingOrderList = [];
TabController _tabController;
// AppSharedPreferences sharedPref = AppSharedPreferences();
@ -66,6 +67,8 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
child: Column(
children: [
TabBar(
labelPadding:
EdgeInsets.only(left: 3.0, right: 3.0),
tabs: [
Tab(text: TranslationBase.of(context).delivered),
Tab(text: TranslationBase.of(context).processing),
@ -103,16 +106,16 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
Widget getDeliveredOrder(OrderModelViewModel model){
for(int i=0 ; i< model.order.length; i++){
if( model.order[i].orderStatusId == 30 || model.order[i].orderStatusId == 997
|| model.order[i].orderStatusId == 994
for(int i=0 ; i< model.orders.length; i++){
if( model.orders[i].orderStatusId == 30 || model.orders[i].orderStatusId == 997
|| model.orders[i].orderStatusId == 994
){
deliveredOrderList.add(model.order[i]);
deliveredOrderList.add(model.orders[i]);
}
}
return Container(
width: MediaQuery.of(context).size.width,
child: model.order.length != 0
child: model.orders.length != 0
? SingleChildScrollView(
child: Column(
children:<Widget> [
@ -162,7 +165,7 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
),
),
Container(
child: Text(deliveredOrderList[index].createdOnUtc.toString().substring(0,11),
child: Text(deliveredOrderList[index].createdOnUtc.toString().substring(0,10),
style: TextStyle(fontSize: 14.0,
),
),
@ -177,7 +180,7 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
child: InkWell(
onTap: () {
Navigator.push(context,
MaterialPageRoute(builder: (context) => OrderDetailsPage(orderModel:deliveredOrderList[index])));
MaterialPageRoute(builder: (context) => OrderDetailsPage(orderModel: deliveredOrderList[index]),));
},
child: SvgPicture.asset(
languageID == "ar"
@ -260,7 +263,7 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
Row(
children: [
Container(
child: Text(deliveredOrderList[index].orderItems.length.toString(),
child: Text(deliveredOrderList[index].productCount.toString(),
style: TextStyle(fontSize: 14.0,
),
),
@ -317,15 +320,15 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
}
Widget getProcessingOrder(OrderModelViewModel model){
for(int i=0 ; i< model.order.length; i++){
if( model.order[i].orderStatusId == 20 || model.order[i].orderStatusId == 995 ||
model.order[i].orderStatusId == 998 || model.order[i].orderStatusId == 999){
processingOrderList.add(model.order[i]);
for(int i=0 ; i< model.orders.length; i++){
if( model.orders[i].orderStatusId == 20 || model.orders[i].orderStatusId == 995 ||
model.orders[i].orderStatusId == 998 || model.orders[i].orderStatusId == 999){
processingOrderList.add(model.orders[i]);
}
}
return Container(
width: MediaQuery.of(context).size.width,
child: model.order.length != 0
child: model.orders.length != 0
? SingleChildScrollView(
child: Column(
children:<Widget> [
@ -375,7 +378,7 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
),
),
Container(
child: Text(processingOrderList[index].createdOnUtc.toString().substring(0,11),
child: Text(processingOrderList[index].createdOnUtc.toString().substring(0,10),
style: TextStyle(fontSize: 14.0,
),
),
@ -390,8 +393,9 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
child: InkWell(
onTap: () {
Navigator.push(context,
MaterialPageRoute(builder: (context) => OrderDetailsPage(orderModel:processingOrderList[index])));
},
MaterialPageRoute(builder: (context) => OrderDetailsPage(orderModel :processingOrderList[index])));
},
child: SvgPicture.asset(
languageID == "ar"
? 'assets/images/pharmacy/arrow_left.svg'
@ -473,7 +477,7 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
Row(
children: [
Container(
child: Text(processingOrderList[index].orderItems.length.toString(),
child: Text(processingOrderList[index].productCount.toString(),
style: TextStyle(fontSize: 14.0,
),
),
@ -709,13 +713,13 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
}
Widget getPendingOrder(OrderModelViewModel model){
for(int i=0 ; i< model.order.length; i++){
if( model.order[i].orderStatusId == 10){
pendingOrderList.add(model.order[i]);
for(int i=0 ; i< model.orders.length; i++){
if( model.orders[i].orderStatusId == 10){
pendingOrderList.add(model.orders[i]);
}
}
return Container(
child: model.order.length != 0
child: model.orders.length != 0
? SingleChildScrollView(
child: Column(
children:<Widget> [
@ -766,7 +770,7 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
),
),
Container(
child: Text(pendingOrderList[index].createdOnUtc.toString().substring(0,11),
child: Text(pendingOrderList[index].createdOnUtc.toString().substring(0,10),
style: TextStyle(fontSize: 14.0,
),
),
@ -782,7 +786,8 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
onTap: () {
Navigator.push(context,
MaterialPageRoute(builder: (context) => OrderDetailsPage(orderModel:pendingOrderList[index])));
},
},
child: SvgPicture.asset(
languageID == "ar"
? 'assets/images/pharmacy/arrow_left.svg'
@ -864,7 +869,7 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
Row(
children: [
Container(
child: Text(pendingOrderList[index].orderItems.length.toString(),
child: Text(pendingOrderList[index].productCount.toString(),
style: TextStyle(fontSize: 14.0,
),
),
@ -924,15 +929,14 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
}
Widget getCancelledOrder(OrderModelViewModel model){
for(int i=0 ; i< model.order.length; i++){
if( model.order[i].orderStatusId == 40 || model.order[i].orderStatusId == 996
|| model.order[i].orderStatusId == 200){
cancelledOrderList.add(model.order[i]);
for(int i=0 ; i< model.orders.length; i++){
if( model.orders[i].orderStatusId == 40 || model.orders[i].orderStatus == 996
|| model.orders[i].orderStatusId == 200){
cancelledOrderList.add(model.orders[i]);
}
}
return Container(
child: model.order.length != 0
child: model.orders.length != 0
? SingleChildScrollView(
child: Column(
children:<Widget> [
@ -983,7 +987,7 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
),
),
Container(
child: Text(cancelledOrderList[index].createdOnUtc.toString().substring(0,11),
child: Text(cancelledOrderList[index].createdOnUtc.toString().substring(0,10),
style: TextStyle(fontSize: 14.0,
),
),
@ -998,7 +1002,8 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
child: InkWell(
onTap: () {
Navigator.push(context,
MaterialPageRoute(builder: (context) => OrderDetailsPage(orderModel:cancelledOrderList[index])));
MaterialPageRoute(builder: (context) => OrderDetailsPage(orderModel: cancelledOrderList[index])));
},
child: SvgPicture.asset(
languageID == "ar"
@ -1081,7 +1086,7 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
Row(
children: [
Container(
child: Text(cancelledOrderList[index].orderItems.length.toString(),
child: Text(cancelledOrderList[index].productCount.toString(),
style: TextStyle(fontSize: 14.0,
),
),

@ -1,3 +1,4 @@
import 'package:diplomaticquarterapp/core/model/pharmacies/orders_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/pharmacy/order/Order.dart';
@ -18,15 +19,16 @@ import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:provider/provider.dart';
dynamic languageID;
class OrderDetailsPage extends StatefulWidget {
OrderModel orderModel;
class OrderDetailsPage extends StatefulWidget {
Orders orderModel;
OrderDetailsPage({@required this.orderModel});
// Orders orderModel;
// OrderModel orderModelDetails;
// OrderDetailsPage({@required this.orderModel, this.orderModelDetails});
@override
_OrderDetailsPageState createState() => _OrderDetailsPageState();
}
@ -37,9 +39,8 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
}
// AppSharedPreferences sharedPref = AppSharedPreferences();
String orderId = "";
String customerId;
List<OrderModel> orderList = [];
List<OrderModel> ordersList = [];
List<OrderModel> cancelledOrderList = [];
@ -55,8 +56,10 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
void initState() {
getLanguageID();
super.initState();
print(widget.orderModel.orderItems.length);
// print(widget.orderModel.orderItems.length);
getCancelOrder(widget.orderModel.id);
print("ID is" + widget.orderModel.id);
// cancelOrderDetail(order)
}
@ -108,8 +111,10 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
borderRadius: BorderRadius.circular(30.0)),
child: Text(
languageID == "ar"
? widget.orderModel.orderStatusn.toString():
widget.orderModel.orderStatus.toString().substring(12) ,
? model.orderListModel[0].orderStatusn.toString()
: model.orderListModel[0].orderStatus
.toString()
.substring(12),
// TranslationBase.of(context).delivered,
style: TextStyle(
color: Colors.white,
@ -126,11 +131,11 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
widget.orderModel.shippingAddress.firstName
.toString()
.substring(10) +
model.orderListModel[0].shippingAddress.firstName
.toString()
.substring(10) +
' ' +
widget.orderModel.shippingAddress.lastName
model.orderListModel[0].shippingAddress.lastName
.toString()
.substring(9),
style: TextStyle(
@ -146,7 +151,7 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
widget.orderModel.shippingAddress.address1
model.orderListModel[0].shippingAddress.address1
.toString()
.substring(9),
style: TextStyle(
@ -154,8 +159,8 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
fontWeight: FontWeight.bold,
color: Colors.grey,
),
),]
),
),
]),
),
Container(
margin: EdgeInsets.fromLTRB(10.0, 5.0, 1.0, 5.0),
@ -163,14 +168,15 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
widget.orderModel.shippingAddress.address2
.toString()
.substring(9) +
model.orderListModel[0].shippingAddress.address2
.toString()
.substring(9) +
' ' +
widget.orderModel.shippingAddress.country
model.orderListModel[0].shippingAddress.country
.toString() +
' ' +
widget.orderModel.shippingAddress.zipPostalCode
model.orderListModel[0].shippingAddress
.zipPostalCode
.toString(),
style: TextStyle(
fontSize: 10.0,
@ -193,7 +199,7 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
Container(
margin: EdgeInsets.only(top: 5.0, bottom: 5.0),
child: Text(
widget.orderModel.shippingAddress.phoneNumber
model.orderListModel[0].shippingAddress.phoneNumber
.toString(),
style: TextStyle(
fontSize: 15.0,
@ -232,8 +238,9 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
),
Container(
child: flutterImage.Image.asset(
widget.orderModel.shippingRateComputationMethodSystemName !=
"Shipping.Aramex"
model.orderListModel[0]
.shippingRateComputationMethodSystemName !=
"Shipping.Aramex"
? "assets/images/pharmacy_module/payment/LogoParmacyGreen.png"
: "assets/images/pharmacy_module/payment/aramex_shipping_logo.png",
fit: BoxFit.contain,
@ -284,7 +291,9 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
Container(
margin: EdgeInsets.only(bottom: 10.0, top: 10.0),
child: Text(
widget.orderModel.paymentName.toString().substring(12),
model.orderListModel[0].paymentName
.toString()
.substring(12),
style: TextStyle(
fontSize: 13.0,
fontWeight: FontWeight.bold,
@ -320,23 +329,40 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: ScrollPhysics(),
itemCount:widget.orderModel.orderItems.length,
itemBuilder: (context, index){
itemCount: model.orderListModel[0].orderItems.length,
itemBuilder: (context, index) {
return Container(
child: productTile(productName: widget.orderModel.orderItems[index].product.name.toString(),
productPrice: widget.orderModel.orderItems[index].product.price.toString(),
productRate: widget.orderModel.orderItems[index].product.approvedRatingSum.toDouble(),
productReviews:widget.orderModel.orderItems[index].product.approvedTotalReviews,
totalPrice: "${(widget.orderModel.orderItems[index].product.price
* widget.orderModel.orderItems[index].quantity).toStringAsFixed(2)}",
qyt: widget.orderModel.orderItems[index].quantity.toString(),
isOrderDetails:true,
imgs: widget.orderModel.orderItems[index].product.images != null &&
widget.orderModel.orderItems[index].product.images.length != 0
? widget.orderModel.orderItems[index].product.images [0].src.toString()
child: productTile(
productName: model
.orderListModel[0].orderItems[index].product.name
.toString(),
productPrice: model
.orderListModel[0].orderItems[index].product.price
.toString(),
productRate: model.orderListModel[0].orderItems[index]
.product.approvedRatingSum
.toDouble(),
productReviews: model.orderListModel[0]
.orderItems[index].product.approvedTotalReviews,
totalPrice:
"${(model.orderListModel[0].orderItems[index].product.price * model.orderListModel[0].orderItems[index].quantity).toStringAsFixed(2)}",
qyt: model
.orderListModel[0].orderItems[index].quantity
.toString(),
isOrderDetails: true,
imgs: model.orderListModel[0].orderItems[index]
.product.images !=
null &&
model.orderListModel[0].orderItems[index]
.product.images.length !=
0
? model.orderListModel[0].orderItems[index]
.product.images[0].src
.toString()
: null,
status: widget.orderModel.orderStatusId,
product: widget.orderModel.orderItems[index].product,
status: model.orderListModel[0].orderStatusId,
product:
model.orderListModel[0].orderItems[index].product,
),
);
}),
@ -385,7 +411,8 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
),
),
Text(
widget.orderModel.orderSubtotalExclTax.toString(),
model.orderListModel[0].orderSubtotalExclTax
.toString(),
style: TextStyle(
fontSize: 13.0,
),
@ -423,7 +450,8 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
),
),
Text(
widget.orderModel.orderShippingExclTax.toString(),
model.orderListModel[0].orderShippingExclTax
.toString(),
style: TextStyle(
fontSize: 13.0,
),
@ -461,7 +489,7 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
),
),
Text(
widget.orderModel.orderTax.toString(),
model.orderListModel[0].orderTax.toString(),
style: TextStyle(
fontSize: 13.0,
),
@ -499,7 +527,7 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
),
),
Text(
widget.orderModel.orderTotal.toString(),
model.orderListModel[0].orderTotal.toString(),
style: TextStyle(
fontSize: 15.0,
fontWeight: FontWeight.bold,
@ -510,83 +538,83 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
),
],
),
widget.orderModel.orderStatusId == 10
model.orderListModel[0].orderStatusId == 10
? InkWell(
onTap: () {
model.makeOrder();
},
child: Container(
onTap: () {
model.makeOrder();
},
child: Container(
// margin: EdgeInsets.only(top: 20.0),
height: 50.0,
color: Colors.transparent,
child: Container(
padding: EdgeInsets.only(left: 130.0, right: 130.0),
decoration: BoxDecoration(
border: Border.all(
color: Colors.green,
style: BorderStyle.solid,
width: 4.0),
color: Colors.green,
borderRadius: BorderRadius.circular(5.0)),
child: Center(
child: Text(
TranslationBase.of(context).payOnline,
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
height: 50.0,
color: Colors.transparent,
child: Container(
padding: EdgeInsets.only(left: 130.0, right: 130.0),
decoration: BoxDecoration(
border: Border.all(
color: Colors.green,
style: BorderStyle.solid,
width: 4.0),
color: Colors.green,
borderRadius: BorderRadius.circular(5.0)),
child: Center(
child: Text(
TranslationBase.of(context).payOnline,
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
),
),
),
),
),
),
),
),
)
)
: Container(),
// getCancelOrder(canCancel, canRefund),
isCancel
? InkWell(
onTap: () {
presentConfirmDialog(model,
widget.orderModel.id); //(widget.orderModel.id));
onTap: () {
presentConfirmDialog(model, widget.orderModel.id);
// model.orderListModel[0].id//(widget.orderModel.id));
//
},
child: Container(
},
child: Container(
// padding: EdgeInsets.only(left: 13.0, right: 13.0, top: 5.0),
height: 50.0,
color: Colors.transparent,
child: Center(
child: Text(
TranslationBase.of(context).cancelOrder,
style: TextStyle(
color: Colors.red[900],
fontWeight: FontWeight.bold,
decoration: TextDecoration.underline),
),
),
),
)
height: 50.0,
color: Colors.transparent,
child: Center(
child: Text(
TranslationBase.of(context).cancelOrder,
style: TextStyle(
color: Colors.red[900],
fontWeight: FontWeight.bold,
decoration: TextDecoration.underline),
),
),
),
)
: Container(),
isActiveDelivery
? InkWell(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => TrackDriver(order: widget.orderModel),
));
},
child: Container(
height: 50.0,
color: Colors.transparent,
child: Center(
child: Text(
TranslationBase.of(context).trackDeliveryDriver,
style: TextStyle(
color: Colors.green[900],
fontWeight: FontWeight.normal,
decoration: TextDecoration.none),
),
),
),
)
onTap: () {
// Navigator.push(
// context,
// MaterialPageRoute(builder: (context) => TrackDriver(order: widget.orderModel),
// ));
},
child: Container(
height: 50.0,
color: Colors.transparent,
child: Center(
child: Text(
TranslationBase.of(context).trackDeliveryDriver,
style: TextStyle(
color: Colors.green[900],
fontWeight: FontWeight.normal,
decoration: TextDecoration.none),
),
),
),
)
: Container(),
],
),
@ -655,6 +683,7 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
context,
MaterialPageRoute(
builder: (context) => OrderPage(
// customerID: model.ordersList[0].customerId.toString()
customerID: widget.orderModel.customerId.toString())),
);
}),

File diff suppressed because it is too large Load Diff

@ -16,20 +16,20 @@ class OrderDetailsService extends BaseService{
AuthenticatedUser authUser = new AuthenticatedUser();
AuthProvider authProvider = new AuthProvider();
List<OrderModel> get orderDetails => orderDetails;
// String url ="";
// List<OrderModel> get orderDetails => ordeDetails;
List<OrderModel> _orderList = List();
List<OrderModel> get orderList => _orderList;
Future getOrderDetails(orderId) async {
print("step 2" + orderId);
Future getOrderDetails(OrderId) async {
hasError = false;
await baseAppClient.getPharmacy(GET_ORDER_DETAILS+orderId,
await baseAppClient.getPharmacy(GET_ORDER_DETAILS+OrderId,
onSuccess: (dynamic response, int statusCode) {
_orderList.clear();
response['orders'].forEach((item) {
_orderList.add(OrderModel.fromJson(item));
print(response);
});
}, onFailure: (String error, int statusCode) {
hasError = true;

@ -5,7 +5,7 @@ import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.da
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/order_model.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/orders_model.dart';
class OrderService extends BaseService{
@ -14,21 +14,23 @@ class OrderService extends BaseService{
AuthenticatedUser authUser = new AuthenticatedUser();
AuthProvider authProvider = new AuthProvider();
List<OrderModel> _orderList = List();
List<OrderModel> get orderList => _orderList;
List<Orders> _orderList = List();
List<Orders> get orderList => _orderList;
String url ="";
Future getOrder(customerId, pageId) async {
hasError = false;
// url =GET_ORDER+"customer=1,fields=id,order_total,order_status,order_statusn,order_status_id,created_on_utc&page=1&limit=200&customer_id=1367368";
url =GET_ORDER+"customer=1,fields=id,order_total,order_status,order_statusn,order_status_id,created_on_utc&page=$pageId&limit=200&customer_id=$customerId";
// url =GET_ORDER+"customer=1,fields=id,order_total,order_status,order_statusn,order_status_id,created_on_utc&page=$pageId&limit=200&customer_id=$customerId";
url =GET_ORDER+"customer=1&fields=id,order_total,order_status,order_statusn,order_status_id,created_on_utc,product_count,can_cancel,can_refund&page=$pageId&limit=200&customer_id=$customerId";
print(url);
await baseAppClient.getPharmacy(url,
onSuccess: (dynamic response, int statusCode) {
_orderList.clear();
response['orders'].forEach((item) {
_orderList.add(OrderModel.fromJson(item));
_orderList.add(Orders.fromJson(item));
});
print(_orderList.length);
print(response);
@ -39,25 +41,27 @@ class OrderService extends BaseService{
}
Future getProductReview(orderId) async {
print("step 1");
hasError = false;
url =GET_ORDER+"customer=1,fields=id,order_total,order_status,order_statusn,order_status_id,created_on_utc&page=1&limit=200&customer_id=1367368";
// url =GET_ORDER+"customer=1,fields=id,order_total,order_status,order_statusn,order_status_id,created_on_utc&page=$page_id&limit=200&customer_id=$custmerId";
print(url);
await baseAppClient.getPharmacy(url,
onSuccess: (dynamic response, int statusCode) {
_orderList.clear();
response['orders'].forEach((item) {
_orderList.add(OrderModel.fromJson(item));
});
print(_orderList.length);
print(response);
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
});
}
// Future getProductReview(orderId) async {
// print("step 1");
// hasError = false;
// url =GET_ORDER+"customer=1,fields=id,order_total,order_status,order_statusn,order_status_id,created_on_utc&page=1&limit=200&customer_id=1367368";
//// url =GET_ORDER+"customer=1,fields=id,order_total,order_status,order_statusn,order_status_id,created_on_utc&page=$page_id&limit=200&customer_id=$custmerId";
// print(url);
// await baseAppClient.getPharmacy(url,
// onSuccess: (dynamic response, int statusCode) {
// _orderList.clear();
// response['orders'].forEach((item) {
// _orderList.add(OrderModel.fromJson(item));
// });
// print(_orderList.length);
// print(response);
// }, onFailure: (String error, int statusCode) {
// hasError = true;
// super.error = error;
// });
// }
// Future<Map> getOrder(BuildContext context ) async {
//
// if (await this.sharedPref.getObject(USER_PROFILE) != null) {

@ -264,6 +264,7 @@ class TranslationBase {
localizedValues['pharmaciesList'][locale.languageCode];
String get description => localizedValues['description'][locale.languageCode];
String get howToUse => localizedValues['howToUse'][locale.languageCode];
String get price => localizedValues['price'][locale.languageCode];
@ -783,6 +784,7 @@ class TranslationBase {
String get recentlyViewed =>
localizedValues['recentlyViewed'][locale.languageCode];
String get bestSellers => localizedValues['bestSellers'][locale.languageCode];
String get recommended => localizedValues['recommended'][locale.languageCode];
String get deleteAllItems =>
localizedValues['deleteAllItems'][locale.languageCode];
String get selectAddress =>

Loading…
Cancel
Save