fixed order details

merge-update-with-lab-changes
Fatimah Alshammari 5 years ago
parent ed68eed9df
commit 4a84483698

@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48">
<path id="user_icon" d="M24,.563a24,24,0,1,0,24,24A24,24,0,0,0,24,.563Zm0,9.29a8.516,8.516,0,1,1-8.516,8.516A8.516,8.516,0,0,1,24,9.853Zm0,33.29a18.545,18.545,0,0,1-14.177-6.6,10.79,10.79,0,0,1,9.532-5.787,2.368,2.368,0,0,1,.687.106A12.813,12.813,0,0,0,24,31.53a12.764,12.764,0,0,0,3.958-.668,2.368,2.368,0,0,1,.687-.106,10.79,10.79,0,0,1,9.532,5.787A18.545,18.545,0,0,1,24,43.143Z" transform="translate(0 -0.563)" fill="#ccc"/>
</svg>

After

Width:  |  Height:  |  Size: 522 B

@ -368,6 +368,7 @@ const GET_ORDER = "orders?";
const GET_ORDER_DETAILS = "epharmacy/api/orders/"; const GET_ORDER_DETAILS = "epharmacy/api/orders/";
const GET_ADDRESS = "Customers/"; const GET_ADDRESS = "Customers/";
const GET_Cancel_ORDER = "cancelorder/"; const GET_Cancel_ORDER = "cancelorder/";
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/";

@ -658,6 +658,7 @@ const Map localizedValues = {
"compare": {"en": " Compare", "ar": "مقارنه"}, "compare": {"en": " Compare", "ar": "مقارنه"},
"medicationsRefill": {"en": " Medication Refill", "ar": "اعادة تعبئة الدواء"}, "medicationsRefill": {"en": " Medication Refill", "ar": "اعادة تعبئة الدواء"},
"myPrescription": {"en": " My Prescriptions", "ar": "وصفاتي"}, "myPrescription": {"en": " My Prescriptions", "ar": "وصفاتي"},
"quantity": {"en": " QTY ", "ar": "الكمية"},
"backMyAccount": { "backMyAccount": {
"en": "BACK TO MY ACCOUNT ", "en": "BACK TO MY ACCOUNT ",
"ar": " الرجوع لحسابي الشخصي" "ar": " الرجوع لحسابي الشخصي"
@ -672,7 +673,7 @@ const Map localizedValues = {
"ar": " تقييمك سوف يساعد الأخرين في اختيار المنتج الأفضل" "ar": " تقييمك سوف يساعد الأخرين في اختيار المنتج الأفضل"
}, },
"shippedMethod": {"en": "SHIP BY:", "ar": " الشحن بواسطة:"}, "shippedMethod": {"en": "SHIP BY:", "ar": " الشحن بواسطة:"},
"orderDetail": {"en": "Order Detail", "ar": " تفاصيل الطلب"}, "orderDetail": {"en": "Order Details", "ar": " تفاصيل الطلب"},
"orderSummary": {"en": "Order Summary", "ar": " تفاصيل المنتج"}, "orderSummary": {"en": "Order Summary", "ar": " تفاصيل المنتج"},
"subtotal": {"en": "Subtotal", "ar": " المجموع"}, "subtotal": {"en": "Subtotal", "ar": " المجموع"},
"shipping": {"en": "Shipping", "ar": " الشحن"}, "shipping": {"en": "Shipping", "ar": " الشحن"},

@ -1,9 +1,13 @@
//import 'dart:html';
import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/pages/pharmacy/order/Order.dart';
import 'package:diplomaticquarterapp/pages/pharmacy/order/OrderDetails.dart';
import 'package:diplomaticquarterapp/services/pharmacy_services/cancelOrder_service.dart';
import 'package:diplomaticquarterapp/services/pharmacy_services/orderDetails_service.dart'; import 'package:diplomaticquarterapp/services/pharmacy_services/orderDetails_service.dart';
import 'package:diplomaticquarterapp/services/pharmacy_services/order_service.dart'; import 'package:diplomaticquarterapp/services/pharmacy_services/order_service.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/order_model.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/order_model.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:flutter/material.dart';
import '../../../locator.dart'; import '../../../locator.dart';
import '../base_view_model.dart'; import '../base_view_model.dart';
@ -15,20 +19,24 @@ class OrderModelViewModel extends BaseViewModel {
OrderDetailsService _orderDetailsService = locator<OrderDetailsService>(); OrderDetailsService _orderDetailsService = locator<OrderDetailsService>();
List<OrderModel> get orderDetails => _orderDetailsService.orderDetails; List<OrderModel> get orderDetails => _orderDetailsService.orderDetails;
CancelOrderService _cancelOrderService = locator<CancelOrderService>();
List<OrderModel> get cancelOrder => _cancelOrderService.cancelOrderList;
Future getOrder(id, pageId) async {
Future getOrder(customerId, pageID) async {
print("this is customer id"+ customerId);
setState(ViewState.Busy); setState(ViewState.Busy);
await _orderService.getOrder(id,pageId); await _orderService.getOrder(customerId, pageID);
if (_orderService.hasError) { if (_orderService.hasError) {
error = _orderService.error; error = _orderService.error;
setState(ViewState.Error); setState(ViewState.Error);
} else { } else {
//order = _orderService.orderList; //order = _orderService.orderList;
print(order.length);
setState(ViewState.Idle); setState(ViewState.Idle);
} }
} }
Future getOrderDetails(orderId) async { Future getOrderDetails(orderId) async {
@ -38,23 +46,47 @@ class OrderModelViewModel extends BaseViewModel {
error = _orderDetailsService.error; error = _orderDetailsService.error;
setState(ViewState.Error); setState(ViewState.Error);
} else { } else {
setState(ViewState.Idle);
} }
} }
Future getProductReview(orderId) async { Future getProductReview() async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _orderService.getProductReview(orderId); await _orderService.getProductReview();
if (_orderService.hasError) { if (_orderService.hasError) {
error = _orderService.error; error = _orderService.error;
setState(ViewState.Error); setState(ViewState.Error);
} else { } else {
//order = _orderService.orderList; //order = _orderService.orderList;
print(order.length);
setState(ViewState.Idle); setState(ViewState.Idle);
} }
} }
Future getCanceledOrder(order, context) async {
print("this is order id"+ order);
setState(ViewState.Busy);
dynamic res;
await _cancelOrderService.getCanceledOrder(order).then((value) {
res = value['success']['SuccessEndUserMsg'];
print(value['success']['SuccessEndUserMsg']);
AppToast.showSuccessToast(message: "Request Sent Successfully");
// Navigator.pop(context);
});
if (_cancelOrderService.hasError) {
error = _cancelOrderService.error;
setState(ViewState.Error);
AppToast.showErrorToast(message: error);
} else {
setState(ViewState.Idle);
// AppToast.showSuccessToast(message: "Request Sent Successfully");
// Navigator.push(context,
// MaterialPageRoute(builder: (context) => OrderPage()));
}
return res;
}
} }

@ -6,6 +6,7 @@ import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_
import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/PharmacyAddressesViewModel.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/PharmacyAddressesViewModel.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/order_model_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/order_model_view_model.dart';
import 'package:diplomaticquarterapp/services/pharmacy_services/cancelOrder_service.dart';
import 'package:diplomaticquarterapp/services/pharmacy_services/order_service.dart'; import 'package:diplomaticquarterapp/services/pharmacy_services/order_service.dart';
import 'package:diplomaticquarterapp/uitl/navigation_service.dart'; import 'package:diplomaticquarterapp/uitl/navigation_service.dart';
import 'package:get_it/get_it.dart'; import 'package:get_it/get_it.dart';
@ -173,6 +174,7 @@ void setupLocator() {
locator.registerLazySingleton(() => OrderDetailsService()); locator.registerLazySingleton(() => OrderDetailsService());
locator.registerLazySingleton(() => CustomerAddressesService()); locator.registerLazySingleton(() => CustomerAddressesService());
locator.registerLazySingleton(() => TermsConditionService()); locator.registerLazySingleton(() => TermsConditionService());
locator.registerLazySingleton(() => CancelOrderService());
/// View Model /// View Model
locator.registerFactory(() => HospitalViewModel()); locator.registerFactory(() => HospitalViewModel());

@ -1,4 +1,5 @@
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/order_model_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/order_model_view_model.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -11,17 +12,24 @@ import 'package:diplomaticquarterapp/pages/pharmacy/order/OrderDetails.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/order_model.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/order_model.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
class OrderPage extends StatefulWidget { class OrderPage extends StatefulWidget {
// orderList({this.customerId, this.pageId}); // orderList({this.customerId, this.pageId});
var languageID ; var languageID ;
String customerID;
OrderPage({@required this.customerID});
@override @override
_OrderPageState createState() => _OrderPageState(); _OrderPageState createState() => _OrderPageState();
} }
class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMixin{ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMixin{
String customerId="";
String page_id=""; String pageID= "1";
String customerId = "";
String order ="";
List <OrderModel> orderList = [] ; List <OrderModel> orderList = [] ;
List <OrderModel> deliveredOrderList = [] ; List <OrderModel> deliveredOrderList = [] ;
@ -31,19 +39,23 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
TabController _tabController; TabController _tabController;
AppSharedPreferences sharedPref = AppSharedPreferences(); AppSharedPreferences sharedPref = AppSharedPreferences();
getLanguageID() async {
return await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
}
@override @override
void initState() { void initState() {
// WidgetsBinding.instance.addPostFrameCallback((_) => getOrder());
getLanguageID(); getLanguageID();
super.initState(); super.initState();
_tabController = new TabController(length: 4, vsync: this,); _tabController = new TabController(length: 4, vsync: this,);
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
print( "customerID" + widget.customerID);
return BaseView<OrderModelViewModel>( return BaseView<OrderModelViewModel>(
onModelReady: (model) => model.getOrder(customerId, page_id), onModelReady: (model) => model.getOrder(widget.customerID, pageID),
builder: (_,model, wi )=> AppScaffold( builder: (_,model, wi )=> AppScaffold(
appBarTitle:TranslationBase.of(context).order, appBarTitle:TranslationBase.of(context).order,
baseViewModel: model, baseViewModel: model,
@ -181,7 +193,7 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
indent: 0, indent: 0,
endIndent: 0, endIndent: 0,
), ),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[ children: <Widget>[
Container( Container(
@ -196,7 +208,8 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
color: Colors.blue[700], color: Colors.blue[700],
borderRadius: BorderRadius.circular(30.0) borderRadius: BorderRadius.circular(30.0)
), ),
child: Text( child: deliveredOrderList[index].orderStatusId == 30
? Text(
// deliveredOrderList[0].orderStatus.toString().substring(12), // deliveredOrderList[0].orderStatus.toString().substring(12),
TranslationBase.of(context).deliveredOrder, TranslationBase.of(context).deliveredOrder,
style: TextStyle( style: TextStyle(
@ -204,7 +217,15 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
fontSize: 15.0, fontSize: 15.0,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
), )
: Text(
deliveredOrderList[index].orderStatus.toString().substring(12),
style: TextStyle(
color: Colors.white,
fontSize: 15.0,
fontWeight: FontWeight.bold,
),
)
), ),
Container( Container(
margin: EdgeInsets.only(left: 8, right: 8, top: 1, bottom: 8), margin: EdgeInsets.only(left: 8, right: 8, top: 1, bottom: 8),
@ -1073,12 +1094,7 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
); );
} }
getLanguageID() async {
var languageID = await sharedPref.getString(APP_LANGUAGE);
setState(() {
widget.languageID = languageID;
});
}
} }

@ -6,6 +6,7 @@ import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
import 'package:diplomaticquarterapp/widgets//pharmacy/product_tile.dart'; import 'package:diplomaticquarterapp/widgets//pharmacy/product_tile.dart';
import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/config.dart';
@ -19,11 +20,11 @@ import 'package:diplomaticquarterapp/uitl/app_toast.dart';
class OrderDetailsPage extends StatefulWidget { class OrderDetailsPage extends StatefulWidget {
var languageID ; var languageID ;
OrderModel orderModel; OrderModel orderModel;
OrderDetailsPage({ OrderDetailsPage({
@required this.orderModel @required this.orderModel
@ -34,10 +35,18 @@ class OrderDetailsPage extends StatefulWidget {
} }
class _OrderDetailsPageState extends State<OrderDetailsPage> { class _OrderDetailsPageState extends State<OrderDetailsPage> {
getLanguageID() async {
return await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
}
AppSharedPreferences sharedPref = AppSharedPreferences(); AppSharedPreferences sharedPref = AppSharedPreferences();
String customerId=""; String orderId="";
String page_id="";
String orderId="3516"; String customerId;
List <OrderModel> orderList = [] ;
List <OrderModel> cancelledOrderList = [];
// String orderId="3516";
var model; var model;
var isCancel = false; var isCancel = false;
var isRefund = false; var isRefund = false;
@ -48,10 +57,10 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
@override @override
void initState() { void initState() {
super.initState(); super.initState();
print(widget.orderModel.orderItems.length);
getLanguageID(); getLanguageID();
getCancelOrder(widget.orderModel.id); getCancelOrder(widget.orderModel.id);
// cancelOrderDetail(widget.orderModel.id); // cancelOrderDetail(order)
} }
@override @override
@ -98,10 +107,11 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
color: getStatusBackgroundColor(), color: getStatusBackgroundColor(),
borderRadius: BorderRadius.circular(30.0) borderRadius: BorderRadius.circular(30.0)
), ),
child: Text(widget.orderModel.orderStatus.toString().substring(12), child: Text(
// widget.languageID == "ar" // widget.orderModel.orderStatus.toString().substring(12),
// ? widget.orderModel.orderStatusn.toString() widget.languageID == "ar"
// : widget.orderModel.orderStatus.toString().substring(12) , ? widget.orderModel.orderStatusn.toString()
: widget.orderModel.orderStatus.toString().substring(12) ,
// TranslationBase.of(context).delivered, // TranslationBase.of(context).delivered,
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.white,
@ -117,7 +127,7 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children:<Widget> [ children:<Widget> [
Text(model.order[0].shippingAddress.firstName.toString().substring(10) + ' ' +model.order[0].shippingAddress.lastName.toString().substring(9), Text(widget.orderModel.shippingAddress.firstName.toString().substring(10) + ' ' +model.order[0].shippingAddress.lastName.toString().substring(9),
style: TextStyle(fontSize: 15.0, fontWeight: FontWeight.bold, style: TextStyle(fontSize: 15.0, fontWeight: FontWeight.bold,
), ),
), ),
@ -125,12 +135,12 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
), ),
), ),
Container( Container(
margin: EdgeInsets.fromLTRB(10.0, 5.0, 1.0, 5.0), margin: EdgeInsets.fromLTRB(11.0, 5.0, 1.0, 5.0),
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children:<Widget> [ children:<Widget> [
Text(model.order[0].shippingAddress.address1.toString().substring(9), Text(widget.orderModel.shippingAddress.address1.toString().substring(9),
style: TextStyle(fontSize: 15.0, fontWeight: FontWeight.bold, style: TextStyle(fontSize: 11.0, fontWeight: FontWeight.bold,
color: Colors.grey, color: Colors.grey,
), ),
), ),
@ -142,8 +152,10 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children:<Widget> [ children:<Widget> [
Text(model.order[0].shippingAddress.address2.toString().substring(9), Text(widget.orderModel.shippingAddress.address2.toString().substring(9)
style: TextStyle(fontSize: 15.0, fontWeight: FontWeight.bold, + ' ' + widget.orderModel.shippingAddress.country.toString()
+ ' ' + widget.orderModel.shippingAddress.zipPostalCode.toString(),
style: TextStyle(fontSize: 10.0, fontWeight: FontWeight.bold,
color: Colors.grey, color: Colors.grey,
), ),
), ),
@ -161,7 +173,7 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
), ),
Container( Container(
margin: EdgeInsets.only(top: 5.0, bottom: 5.0), margin: EdgeInsets.only(top: 5.0, bottom: 5.0),
child: Text(model.order[0].shippingAddress.phoneNumber.toString(), child: Text(widget.orderModel.shippingAddress.phoneNumber.toString(),
style: TextStyle(fontSize: 15.0, style: TextStyle(fontSize: 15.0,
), ),
), ),
@ -193,7 +205,7 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
), ),
), ),
Container( Container(
child: model.order[0].shippingRateComputationMethodSystemName == "Shipping.FixedOrByWeight" child: widget.orderModel.shippingRateComputationMethodSystemName == "Shipping.FixedOrByWeight"
? Container( ? Container(
margin: EdgeInsets.only(bottom: 10.0, top: 10.0), margin: EdgeInsets.only(bottom: 10.0, top: 10.0),
child: SvgPicture.asset( child: SvgPicture.asset(
@ -236,7 +248,7 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
), ),
Container( Container(
margin: EdgeInsets.only(bottom: 10.0, top: 10.0), margin: EdgeInsets.only(bottom: 10.0, top: 10.0),
child:Text(model.order[0].paymentName.toString().substring(12), child:Text(widget.orderModel.paymentName.toString().substring(12),
style: TextStyle(fontSize: 13.0, fontWeight: FontWeight.bold, style: TextStyle(fontSize: 13.0, fontWeight: FontWeight.bold,
), ),
), ),
@ -274,8 +286,11 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
productPrice: widget.orderModel.orderItems[index].product.price.toString(), productPrice: widget.orderModel.orderItems[index].product.price.toString(),
productRate: widget.orderModel.orderItems[index].product.approvedRatingSum.toDouble(), productRate: widget.orderModel.orderItems[index].product.approvedRatingSum.toDouble(),
productReviews:widget.orderModel.orderItems[index].product.approvedTotalReviews, productReviews:widget.orderModel.orderItems[index].product.approvedTotalReviews,
totalPrice: widget.orderModel.orderItems[index].priceExclTax.toString(), totalPrice: "${(widget.orderModel.orderItems[index].product.price
qyt: widget.orderModel.orderItems[index].quantity.toString(),), * widget.orderModel.orderItems[index].quantity).toStringAsFixed(2)}",
qyt: widget.orderModel.orderItems[index].quantity.toString(),
img:widget.orderModel.orderItems[index].product.images[0].src.toString(),
status: widget.orderModel.orderStatusId,),
); );
} }
), ),
@ -318,7 +333,7 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
), ),
), ),
), ),
Text(model.order[0].orderSubtotalExclTax.toString(), Text(widget.orderModel.orderSubtotalExclTax.toString(),
style: TextStyle(fontSize: 13.0, style: TextStyle(fontSize: 13.0,
), ),
), ),
@ -352,7 +367,7 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
), ),
), ),
), ),
Text(model.order[0].orderShippingExclTax.toString(), Text(widget.orderModel.orderShippingExclTax.toString(),
style: TextStyle(fontSize: 13.0, style: TextStyle(fontSize: 13.0,
), ),
), ),
@ -418,7 +433,7 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
), ),
), ),
), ),
Text(model.order[0].orderTotal.toString(), Text(widget.orderModel.orderTotal.toString(),
style: TextStyle(fontSize: 15.0, fontWeight: FontWeight.bold, style: TextStyle(fontSize: 15.0, fontWeight: FontWeight.bold,
), ),
), ),
@ -428,8 +443,9 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
], ],
), ),
widget.orderModel.orderStatusId == 10 ? InkWell( widget.orderModel.orderStatusId == 10 ? InkWell(
onTap: (){ onTap: () {
// payOnline link // Navigator.push(context,
// MaterialPageRoute(builder: (context) => InAppBrowser()));
}, },
child: Container( child: Container(
// margin: EdgeInsets.only(top: 20.0), // margin: EdgeInsets.only(top: 20.0),
@ -458,12 +474,11 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
), ),
), ),
) : Container(), ) : Container(),
// getCancelOrder(canCancel, canRefund), // getCancelOrder(canCancel, canRefund),
isCancel ? InkWell( isCancel ? InkWell(
onTap: () { onTap: () {
Navigator.push(context, presentConfirmDialog(model,widget.orderModel.id);//(widget.orderModel.id));
MaterialPageRoute(builder: (context) => presentConfirmDialog())); //
}, },
child: Container( child: Container(
// padding: EdgeInsets.only(left: 13.0, right: 13.0, top: 5.0), // padding: EdgeInsets.only(left: 13.0, right: 13.0, top: 5.0),
@ -537,37 +552,40 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
} }
} }
presentConfirmDialog(){ // .getCanceledOrder
presentConfirmDialog(cancelFunction, id){
ConfirmDialog dialog = new ConfirmDialog( ConfirmDialog dialog = new ConfirmDialog(
context: context, context: context,
confirmMessage: TranslationBase.of(context).confirmCancellation, confirmMessage: TranslationBase.of(context).confirmCancellation,
okText: TranslationBase.of(context).confirm, okText: TranslationBase.of(context).confirm,
cancelText: TranslationBase.of(context).cancel_nocaps, cancelText: TranslationBase.of(context).cancel_nocaps,
okFunction: () => { okFunction: () => cancelFunction.getCanceledOrder(id, context).then((value){
// cancelOrderDetail(widget.orderModel.id), print(":D");
ConfirmDialog.closeAlertDialog(context) print(value);
}, // Navigator.pop(context);
cancelFunction: () => {}); Navigator.push(context,
MaterialPageRoute(builder: (context) =>
OrderPage(customerID: widget.orderModel.customerId.toString())),
);}),
cancelFunction: () => {}
);
dialog.showAlertDialog(context); dialog.showAlertDialog(context);
} }
// cancelOrderDetail(order){ getCanceledOrder(order){
// if(widget.orderModel.canCancel && widget.orderModel.canRefund == false){ Navigator.pop(context);
//// setState(() { if(widget.orderModel.canCancel && widget.orderModel.canRefund == false){
// cancelOrderDetail(order); // getCanceledOrder(order);
// AppToast.showSuccessToast(message: "Request Sent Successfully"); // AppToast.showSuccessToast(message: "Request Sent Successfully");
//// }); // Navigator.push(context,
//// return OrderPage(); // MaterialPageRoute(builder: (context) => OrderPage()));
// }
// else{} }
// }
getLanguageID() async {
var languageID = await sharedPref.getString(APP_LANGUAGE);
setState(() {
widget.languageID = languageID;
});
} }
} }

@ -1,19 +1,21 @@
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/order_model_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/order_model_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/pharmacy/profile/profile.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/services/pharmacy_services/order_service.dart';
import 'package:diplomaticquarterapp/pages/pharmacy/profile/profile.dart';
import 'package:rating_bar/rating_bar.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/order_model.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/order_model.dart';
import 'package:diplomaticquarterapp/widgets//pharmacy/product_tile.dart'; import 'package:flutter_svg/svg.dart';
import 'package:rating_bar/rating_bar.dart';
class ProductReviewPage extends StatefulWidget { class ProductReviewPage extends StatefulWidget {
OrderModel orderModel;
ProductReviewPage({
@required this.orderModel
});
@override @override
_ProductReviewPageState createState() => _ProductReviewPageState(); _ProductReviewPageState createState() => _ProductReviewPageState();
} }
@ -26,193 +28,212 @@ class _ProductReviewPageState extends State<ProductReviewPage> {
String submitTxt =""; String submitTxt ="";
var doctorRating= ""; var doctorRating= "";
var reviewObj = {}; var reviewObj = {};
AppSharedPreferences sharedPref = AppSharedPreferences(); AppSharedPreferences sharedPref = AppSharedPreferences();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<OrderModelViewModel>( return BaseView<OrderModelViewModel>(
onModelReady: (model)=>model.getProductReview(orderId), onModelReady: (model)=>model.getOrderDetails(widget.orderModel.id),
builder: (_,model, wi )=> AppScaffold( builder: (_,model, wi )=> AppScaffold(
appBarTitle: TranslationBase.of(context).writeReview, appBarTitle: TranslationBase.of(context).writeReview,
isShowAppBar: true, isShowAppBar: true,
isPharmacy:true , isPharmacy:true ,
body: Container( body: Container(
color: Colors.white, color: Colors.white,
child: SingleChildScrollView( child: SingleChildScrollView(
child: Column( child: Column(
children: <Widget> [ children: <Widget> [
// Container( Row(
// child: productTile(productName: 'Panadol Extra 500 MG', productPrice: '10.00', productRate: 3.00, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
// productReviews:4, ), children: [
// ), ListView.builder(
Row( scrollDirection: Axis.vertical,
mainAxisAlignment: MainAxisAlignment.spaceEvenly, shrinkWrap: true,
children: [ physics: ScrollPhysics(),
Container( itemCount:widget.orderModel.orderItems.length,
margin: EdgeInsets.only(left: 10), itemBuilder: (context, index){
child: SvgPicture.asset( return Container(
// model.order[0].orderItems[0].product.images[0].src.toString(), margin: EdgeInsets.only(top :15.0, bottom: 15.0),
child: Row(
children:[
Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Container(
margin: EdgeInsets.only(left: 10),
child: SvgPicture.asset(
// widget.orderModel.orderItems[index].product.images[index].src.toString(),
'assets/images/al-habib_onlne_pharmacy_bg.png', 'assets/images/al-habib_onlne_pharmacy_bg.png',
fit: BoxFit.cover, fit: BoxFit.cover,
width: 80, width: 80,
height: 80, height: 80,
), ),
),] ),
), ]
Container(
margin: EdgeInsets.only(top :15.0, bottom: 15.0),
child: Column(
children: <Widget>[
Row(
children: <Widget>[
Text(model.order[0].orderItems[0].product.name.toString(),
style: TextStyle(fontSize: 16.0,
), ),
), ],
], ),
), Column(
Row( children: <Widget>[
children: [ Row(
Container( children: <Widget>[
margin: EdgeInsets.only(left: 5), Text(widget.orderModel.orderItems[index].product.name.toString(),
child: Text(model.order[0].orderItems[0].product.price.toString(), style: TextStyle(fontSize: 16.0,
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, ),
), ),
), ],
), ),
Container( Row(
margin: EdgeInsets.only(left: 5), children: [
child: Text(TranslationBase.of(context).sar, Container(
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, margin: EdgeInsets.only(left: 5),
child: Text(widget.orderModel.orderItems[index].product.price.toString(),
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold,
),
),
), ),
), Container(
), margin: EdgeInsets.only(left: 5),
], child: Text(TranslationBase.of(context).sar,
), style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold,
Row( ),
children: [ ),
Container(
margin: EdgeInsets.all(5),
child: Align(
alignment: Alignment.topLeft,
child: RatingBar.readOnly(
initialRating: 3,
size: 15.0,
filledColor: Colors.yellow[700],
emptyColor: Colors.grey[500],
isHalfAllowed: true,
halfFilledIcon: Icons.star_half,
filledIcon: Icons.star,
emptyIcon: Icons.star,
), ),
), ],
), ),
Container( Row(
child: Text(model.order[0].orderItems[0].product.approvedRatingSum.toString(), children: [
style: TextStyle(fontSize: 14.0, fontWeight: FontWeight.bold, Container(
margin: EdgeInsets.all(5),
child: Align(
alignment: Alignment.topLeft,
child: RatingBar.readOnly(
initialRating: 3,
size: 15.0,
filledColor: Colors.yellow[700],
emptyColor: Colors.grey[500],
isHalfAllowed: true,
halfFilledIcon: Icons.star_half,
filledIcon: Icons.star,
emptyIcon: Icons.star,
),
),
), ),
), Container(
), child: Text(widget.orderModel.orderItems[index].product.approvedRatingSum.toString(),
Container( style: TextStyle(fontSize: 14.0, fontWeight: FontWeight.bold,
margin: EdgeInsets.only(left: 5), ),
child: Text("(" + model.order[0].orderItems[0].product.approvedTotalReviews.toString() ),
+ ' ' + TranslationBase.of(context).review +")",
style: TextStyle(fontSize: 12.0,
), ),
), Container(
margin: EdgeInsets.only(left: 5),
child: Text("(" + widget.orderModel.orderItems[index].product.approvedTotalReviews.toString()
+ ' ' + TranslationBase.of(context).review +")",
style: TextStyle(fontSize: 12.0,
),
),
),
],
), ),
], ],
), ),
], ]
), ),
), );
Divider( }
color: Colors.grey[350],
height: 20,
thickness: 8,
indent: 0,
endIndent: 0,
), ),
Container( ]),
margin: EdgeInsets.only( top: 12.0),
child: Column( Divider(
crossAxisAlignment: CrossAxisAlignment.center, color: Colors.grey[350],
mainAxisAlignment: MainAxisAlignment.spaceBetween, height: 20,
mainAxisSize: MainAxisSize.max, thickness: 8,
children: <Widget>[ indent: 0,
RatingBar( endIndent: 0,
// initialRating: ),
// this.doctor.actualDoctorRate.toDouble(), Container(
size: 40.0, margin: EdgeInsets.only( top: 12.0),
filledColor: Colors.yellow[700], child: Column(
emptyColor: Colors.grey[500], crossAxisAlignment: CrossAxisAlignment.center,
isHalfAllowed: true, mainAxisAlignment: MainAxisAlignment.spaceBetween,
halfFilledIcon: Icons.star_half, mainAxisSize: MainAxisSize.max,
filledIcon: Icons.star, children: <Widget>[
emptyIcon: Icons.star, RatingBar(
), // initialRating:
], // this.doctor.actualDoctorRate.toDouble(),
size: 40.0,
filledColor: Colors.yellow[700],
emptyColor: Colors.grey[500],
isHalfAllowed: true,
halfFilledIcon: Icons.star_half,
filledIcon: Icons.star,
emptyIcon: Icons.star,
), ),
), ],
Container( ),
padding: EdgeInsets.fromLTRB(8.0, 20.0, 8.0,20.0), ),
child: Column( Container(
children:<Widget> [ padding: EdgeInsets.fromLTRB(8.0, 20.0, 8.0,20.0),
TextFormField ( child: Column(
decoration: InputDecoration( children:<Widget> [
contentPadding: const EdgeInsets.symmetric(vertical: 60.0), TextFormField (
border: InputBorder.none, decoration: InputDecoration(
hintText: 'Tell us more about product!', contentPadding: const EdgeInsets.symmetric(vertical: 60.0),
focusedBorder: OutlineInputBorder( border: InputBorder.none,
borderRadius: BorderRadius.circular(5.0), hintText: 'Tell us more about product!',
borderSide: BorderSide(width: 1, color: Colors.grey[400]), focusedBorder: OutlineInputBorder(
), borderRadius: BorderRadius.circular(5.0),
enabledBorder: OutlineInputBorder( borderSide: BorderSide(width: 1, color: Colors.grey[400]),
borderRadius: BorderRadius.all(Radius.circular(5.0)), ),
borderSide: BorderSide(color: Colors.grey[400], width: 1), enabledBorder: OutlineInputBorder(
), borderRadius: BorderRadius.all(Radius.circular(5.0)),
), borderSide: BorderSide(color: Colors.grey[400], width: 1),
), ),
], ),
), ),
), ],
InkWell( ),
onTap: () { ),
InkWell(
onTap: () {
// Navigator.push(context, // Navigator.push(context,
// MaterialPageRoute(builder: (context) => )); // MaterialPageRoute(builder: (context) => ));
}, },
child: Container( child: Container(
height: 50.0, height: 50.0,
width: 400.0, width: 400.0,
color: Colors.transparent, color: Colors.transparent,
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border.all( border: Border.all(
color: Colors.yellow[700],
style: BorderStyle.solid,
width: 1.0
),
color: Colors.yellow[700], color: Colors.yellow[700],
borderRadius: BorderRadius.circular(5.0) style: BorderStyle.solid,
width: 1.0
), ),
child: Center( color: Colors.yellow[700],
child: Text( borderRadius: BorderRadius.circular(5.0)
TranslationBase.of(context).shareReview, ),
style: TextStyle( child: Center(
color: Colors.white, child: Text(
fontSize: 16.0, TranslationBase.of(context).shareReview,
fontWeight: FontWeight.bold, style: TextStyle(
), color: Colors.white,
), fontSize: 16.0,
fontWeight: FontWeight.bold,
), ),
), ),
), ),
), ),
], ),
),
), ),
),), ],
); ),
),
),),
);
} }

@ -1,21 +1,18 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/pages/ContactUs/LiveChat/livechat_page.dart'; import 'package:diplomaticquarterapp/pages/ContactUs/LiveChat/livechat_page.dart';
import 'package:diplomaticquarterapp/pages/ContactUs/findus/findus_page.dart'; import 'package:diplomaticquarterapp/pages/ContactUs/findus/findus_page.dart';
import 'package:diplomaticquarterapp/pages/DrawerPages/family/my-family.dart'; import 'package:diplomaticquarterapp/pages/DrawerPages/family/my-family.dart';
import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_home_page.dart'; import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_home_page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/lakum-main-page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/wishlist.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/wishlist.dart';
import 'package:diplomaticquarterapp/pages/pharmacy/order/Order.dart'; import 'package:diplomaticquarterapp/pages/pharmacy/order/Order.dart';
import 'package:diplomaticquarterapp/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart'; import 'package:diplomaticquarterapp/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart';
import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/order_model_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/config/config.dart'; import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/order_model.dart'; import 'package:flutter_svg/flutter_svg.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
class PharmacyProfilePage extends StatefulWidget { class PharmacyProfilePage extends StatefulWidget {
@override @override
@ -24,416 +21,501 @@ class PharmacyProfilePage extends StatefulWidget {
class _ProfilePageState extends State<PharmacyProfilePage> { class _ProfilePageState extends State<PharmacyProfilePage> {
AppSharedPreferences sharedPref = AppSharedPreferences(); AppSharedPreferences sharedPref = AppSharedPreferences();
String customerId="";
String page_id=""; AuthenticatedUser user;
bool isLogin = false;
String firstName;
String customerId;
_ProfilePageState({this.customerId});
getCustomer() async {
String custID;
custID = await sharedPref.getString(PHARMACY_CUSTOMER_ID);
setState(() {
customerId = custID;
});
print("customer Id is"+ customerId);
return customerId;
}
getUser() async {
var userData = await sharedPref.getObject(USER_PROFILE);
if (userData != null) user = AuthenticatedUser.fromJson(userData);
setState(() {
firstName = user.firstName.toString();
print("this is user" + user.firstName.toString());
});
// this.isLogin = user != null;
}
void initState() {
getCustomer();
super.initState();
getUser();
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<OrderModelViewModel>( return AppScaffold(
onModelReady: (model) => model.getOrder(customerId, page_id), appBarTitle: TranslationBase.of(context).myAccount,
builder: (_,model, wi )=> AppScaffold( isShowAppBar: true,
appBarTitle: TranslationBase.of(context).myAccount, isPharmacy: true,
isShowAppBar: true, body: Container(
isPharmacy:true , child: SingleChildScrollView(
body: Container( child: Column(
child:SingleChildScrollView( children: <Widget>[
child: Column( Container(
children:<Widget>[ child: Row(
Container( children: <Widget>[
child:Row( // Container(
children:<Widget> [ // padding:EdgeInsets.only(top:20.0, left:10.0, right:10.0, bottom:10.0,),
Container( // child: LargeAvatar(
padding:EdgeInsets.only(top:20.0, left:10.0, right:10.0, bottom:10.0,), // name: "",
child: LargeAvatar(name: "profile", url:'' ,), // url: "" ,),
), // ),
Container( Row(
child: Column( children: [
Column(
children: [
Container(
padding:EdgeInsets.only(top:10.0, left:10.0, right:10.0, bottom:15.0,),
child: SvgPicture.asset(
'assets/images/pharmacy/user.svg',
width: 60,
height: 60,
),
),]
),
Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Text( Text(
TranslationBase.of(context).welcome, TranslationBase.of(context).welcome,
style: TextStyle(fontSize: 14.0, style: TextStyle(
fontSize: 14.0,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color:Colors.grey color: Colors.grey),
),
), ),
Text("Name", Text(
// model.order[0].customer.firstName.toString(), user.firstName.toString()+ " " + user.lastName.toString(),
style: TextStyle( style: TextStyle(
fontSize: 16.0, fontSize: 14.0, fontWeight: FontWeight.bold),
fontWeight: FontWeight.bold
),
), ),
], ],
), ),
) ],
], )
), ],
),
Divider(
color: Colors.grey[350],
height: 20,
thickness: 5,
indent: 0,
endIndent: 0,
),
SizedBox(
height: 15,
), ),
Container( ),
child:Row( Divider(
children:<Widget> [ color: Colors.grey[350],
Expanded( height: 20,
child: InkWell( thickness: 5,
onTap: () { indent: 0,
Navigator.push(context, endIndent: 0,
MaterialPageRoute(builder: (context) => OrderPage())); ),
}, SizedBox(
child: Column( height: 15,
children:<Widget> [ ),
SvgPicture.asset( Container(
'assets/images/pharmacy/orders_icon.svg', child: Row(
width: 50, children: <Widget>[
height: 50,), Expanded(
SizedBox( child: InkWell(
height: 5, onTap: () {
), Navigator.push(
Text( context,
TranslationBase.of(context).orders, MaterialPageRoute(
style: TextStyle(fontSize: 13.0, builder: (context) => OrderPage(customerID: customerId)));
fontWeight: FontWeight.bold,), },
), child: Column(
], children: <Widget>[
), // Image(image: AssetImage('assets/images/pharmacy/orders_icon.svg')),
SvgPicture.asset(
'assets/images/pharmacy/orders_icon.svg',
width: 50,
height: 50,
), ),
), SizedBox(
Expanded( height: 5,
child: InkWell(
child: Column(
children:<Widget> [
SvgPicture.asset(
'assets/images/pharmacy/lakum_icon.svg',
width: 50,
height: 50,),
SizedBox(
height: 5,
),
Text(
TranslationBase.of(context).lakum,
style: TextStyle(fontSize: 13.0,
fontWeight: FontWeight.bold
),
),
],
),
),
),
Expanded(
child: InkWell(
onTap: () {
Navigator.push(context,
MaterialPageRoute(builder: (context) => WishlistPage()));
},
child: Column(
children:<Widget> [
SvgPicture.asset(
'assets/images/pharmacy/wishlist_icon.svg',
width: 50,
height: 50,),
SizedBox(
height: 5,
),
Text(
TranslationBase.of(context).wishlist,
style: TextStyle(fontSize: 13.0,
fontWeight: FontWeight.bold,),
),
],
),
), ),
), Text(
Expanded( TranslationBase.of(context).orders,
child: InkWell( style: TextStyle(
child: Column( fontSize: 13.0,
children:<Widget> [ fontWeight: FontWeight.bold,
SvgPicture.asset(
'assets/images/pharmacy/review_icon.svg',
width: 50,
height: 50,),
SizedBox(
height: 5,
),
Text(
TranslationBase.of(context).reviews,
style: TextStyle(fontSize: 13.0,
fontWeight: FontWeight.bold,),
),
],
), ),
), ),
), ],
],
)
),
SizedBox(
height: 15,
),
Divider(
color: Colors.grey[350],
height: 20,
thickness: 5,
indent: 0,
endIndent: 0,
),
SizedBox(
height: 10,
),
Container(
padding: EdgeInsets.only(left: 10.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children:<Widget> [
Text(
TranslationBase.of(context).myAccount,
style: TextStyle(
fontSize: 16.0,
fontWeight: FontWeight.bold
),
),
SizedBox(
height: 10,
), ),
Divider( ),
color: Colors.grey, ),
height: 20, Expanded(
), child: InkWell(
InkWell( onTap: () {
onTap: () { Navigator.push(
Navigator.push(context, context,
MaterialPageRoute(builder: (context) => HomePrescriptionsPage())); MaterialPageRoute(
builder: (context) => LakumMainPage()));
}, },
child: Row( child: Column(
children:<Widget> [ children: <Widget>[
SvgPicture.asset( SvgPicture.asset(
'assets/images/pharmacy/my_prescription_icon.svg', 'assets/images/pharmacy/lakum_icon.svg',
width: 28, width: 50,
height: 28,), height: 50,
SizedBox( ),
width: 15, SizedBox(
), height: 5,
Text(TranslationBase.of(context).myPrescription, ),
style: TextStyle(fontSize: 13.0, Text(
), TranslationBase.of(context).lakum,
), style: TextStyle(
], fontSize: 13.0, fontWeight: FontWeight.bold),
), ),
), ],
SizedBox(
height: 5,
),
Divider(
color: Colors.grey,
height: 20,
), ),
InkWell( ),
onTap: () { ),
Navigator.push(context, Expanded(
MaterialPageRoute(builder: (context) => MyFamily())); child: InkWell(
}, onTap: () {
child: Row( Navigator.push(
children:<Widget> [ context,
SvgPicture.asset( MaterialPageRoute(
'assets/images/pharmacy/compare.png', builder: (context) => WishlistPage()));
width: 28, },
height: 28,), child: Column(
SizedBox( children: <Widget>[
width: 15, SvgPicture.asset(
), 'assets/images/pharmacy/wishlist_icon.svg',
Text(TranslationBase.of(context).compare, width: 50,
style: TextStyle(fontSize: 13.0, height: 50,
), ),
SizedBox(
height: 5,
),
Text(
TranslationBase.of(context).wishlist,
style: TextStyle(
fontSize: 13.0,
fontWeight: FontWeight.bold,
), ),
], ),
), ],
),
SizedBox(
height: 5,
),
Divider(
color: Colors.grey,
height: 20,
), ),
InkWell( ),
onTap: () { ),
Navigator.push(context, Expanded(
MaterialPageRoute(builder: (context) => HomePrescriptionsPage())); child: InkWell(
}, child: Column(
child: Row( children: <Widget>[
children:<Widget> [ SvgPicture.asset(
SvgPicture.asset( 'assets/images/pharmacy/review_icon.svg',
'assets/images/pharmacy/medication_refill_icon.svg', width: 50,
width: 30, height: 50,
height: 30,), ),
SizedBox( SizedBox(
width: 20, height: 5,
), ),
Text(TranslationBase.of(context).medicationsRefill, Text(
style: TextStyle(fontSize: 13.0, TranslationBase.of(context).reviews,
), style: TextStyle(
fontSize: 13.0,
fontWeight: FontWeight.bold,
), ),
], ),
), ],
),
SizedBox(
height: 5,
),
Divider(
color: Colors.grey,
height: 20,
), ),
InkWell( ),
onTap: () { ),
Navigator.push(context, ],
MaterialPageRoute(builder: (context) => MyFamily())); )),
}, SizedBox(
child: Row( height: 15,
children:<Widget> [ ),
SvgPicture.asset( Divider(
'assets/images/pharmacy/my_family_icon.svg', color: Colors.grey[350],
width: 20, height: 20,
height: 20,), thickness: 5,
SizedBox( indent: 0,
width: 20, endIndent: 0,
), ),
Text(TranslationBase.of(context).family, SizedBox(
style: TextStyle(fontSize: 13.0, height: 10,
), ),
Container(
padding: EdgeInsets.only(left: 10.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
TranslationBase.of(context).myAccount,
style: TextStyle(
fontSize: 16.0, fontWeight: FontWeight.bold),
),
SizedBox(
height: 10,
),
Divider(
color: Colors.grey,
height: 20,
),
InkWell(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => HomePrescriptionsPage()));
},
child: Row(
children: <Widget>[
SvgPicture.asset(
'assets/images/pharmacy/my_prescription_icon.svg',
width: 28,
height: 28,
),
SizedBox(
width: 15,
),
Text(
TranslationBase.of(context).myPrescription,
style: TextStyle(
fontSize: 13.0,
), ),
], ),
), ],
), ),
SizedBox( ),
height: 5, SizedBox(
height: 5,
),
Divider(
color: Colors.grey,
height: 20,
),
InkWell(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => MyFamily()));
},
child: Row(
children: <Widget>[
Image.asset('assets/images/pharmacy/compare.png',
width: 35, height: 35),
SizedBox(
width: 15,
),
Text(
TranslationBase.of(context).compare,
style: TextStyle(
fontSize: 13.0,
),
),
],
), ),
Divider( ),
color: Colors.grey, SizedBox(
height: 20, height: 5,
),
Divider(
color: Colors.grey,
height: 20,
),
InkWell(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => HomePrescriptionsPage()));
},
child: Row(
children: <Widget>[
SvgPicture.asset(
'assets/images/pharmacy/medication_refill_icon.svg',
width: 30,
height: 30,
),
SizedBox(
width: 20,
),
Text(
TranslationBase.of(context).medicationsRefill,
style: TextStyle(
fontSize: 13.0,
),
),
],
), ),
InkWell( ),
onTap: () { SizedBox(
Navigator.push(context, height: 5,
MaterialPageRoute(builder: (context) => PharmacyAddressesPage())); ),
}, Divider(
child: Row( color: Colors.grey,
children:<Widget> [ height: 20,
SvgPicture.asset( ),
'assets/images/pharmacy/shipping_addresses_icon.svg', InkWell(
width: 30, onTap: () {
height: 30,), Navigator.push(
SizedBox( context,
width: 20, MaterialPageRoute(
builder: (context) => MyFamily()));
},
child: Row(
children: <Widget>[
SvgPicture.asset(
'assets/images/pharmacy/my_family_icon.svg',
width: 20,
height: 20,
),
SizedBox(
width: 20,
),
Text(
TranslationBase.of(context).family,
style: TextStyle(
fontSize: 13.0,
), ),
Text(TranslationBase.of(context).shippingAddresses, ),
style: TextStyle(fontSize: 13.0, ],
), ),
),
SizedBox(
height: 5,
),
Divider(
color: Colors.grey,
height: 20,
),
InkWell(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => PharmacyAddressesPage()));
},
child: Row(
children: <Widget>[
SvgPicture.asset(
'assets/images/pharmacy/shipping_addresses_icon.svg',
width: 30,
height: 30,
),
SizedBox(
width: 20,
),
Text(
TranslationBase.of(context).shippingAddresses,
style: TextStyle(
fontSize: 13.0,
), ),
], ),
), ],
), ),
], ),
), ],
),
SizedBox(
height: 10,
),
Divider(
color: Colors.grey[350],
height: 20,
thickness: 5,
indent: 0,
endIndent: 0,
),
SizedBox(
height: 10,
), ),
Container( ),
padding: EdgeInsets.only(left: 10.0), SizedBox(
child: Column( height: 10,
crossAxisAlignment: CrossAxisAlignment.start, ),
children:<Widget> [ Divider(
Text( color: Colors.grey[350],
TranslationBase.of(context).reachUs, height: 20,
style: TextStyle( thickness: 5,
fontSize: 16.0, indent: 0,
fontWeight: FontWeight.bold endIndent: 0,
), ),
), SizedBox(
SizedBox( height: 10,
height: 5, ),
), Container(
Divider( padding: EdgeInsets.only(left: 10.0),
color: Colors.grey, child: Column(
height: 20, crossAxisAlignment: CrossAxisAlignment.start,
), children: <Widget>[
InkWell( Text(
onTap: () { TranslationBase.of(context).reachUs,
Navigator.push(context, style: TextStyle(
MaterialPageRoute(builder: (context) => LiveChatPage())); fontSize: 16.0, fontWeight: FontWeight.bold),
}, ),
child: Row( SizedBox(
children:<Widget> [ height: 5,
SvgPicture.asset( ),
'assets/images/pharmacy/contact_us_icon.svg', Divider(
width: 20, color: Colors.grey,
height: 20,), height: 20,
SizedBox( ),
width: 20, InkWell(
), onTap: () {
Text( Navigator.push(
TranslationBase.of(context).contactUs, context,
style: TextStyle(fontSize: 13.0), MaterialPageRoute(
), builder: (context) => LiveChatPage()));
], },
), child: Row(
), children: <Widget>[
SizedBox( SvgPicture.asset(
height: 5, 'assets/images/pharmacy/contact_us_icon.svg',
width: 20,
height: 20,
),
SizedBox(
width: 20,
),
Text(
TranslationBase.of(context).contactUs,
style: TextStyle(fontSize: 13.0),
),
],
), ),
Divider( ),
color: Colors.grey, SizedBox(
height: 20, height: 5,
),
Divider(
color: Colors.grey,
height: 20,
),
InkWell(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => FindUsPage()));
},
child: Row(
children: <Widget>[
SvgPicture.asset(
'assets/images/pharmacy/our_locations_icon.svg',
width: 30,
height: 30,
),
SizedBox(
width: 20,
),
Text(
TranslationBase.of(context).ourLocations,
style: TextStyle(fontSize: 13.0),
),
],
), ),
InkWell( )
onTap: () { ],
Navigator.push(context, ),
MaterialPageRoute(builder: (context) => FindUsPage())); )
}, ],
child: Row(
children: <Widget>[
SvgPicture.asset(
'assets/images/pharmacy/our_locations_icon.svg',
width: 30,
height: 30,),
SizedBox(
width: 20,
),
Text(
TranslationBase.of(context).ourLocations,
style: TextStyle(fontSize: 13.0),
),
],
),
)
],
),
)
],
),
), ),
), ),
), ),
); );
}} }
// getUser() async {
// var userData = await sharedPref.getObject(USER_PROFILE);
// if (userData != null) user = AuthenticatedUser.fromJson(userData);
// }
}

@ -16,24 +16,29 @@ class CancelOrderService extends BaseService{
AuthenticatedUser authUser = new AuthenticatedUser(); AuthenticatedUser authUser = new AuthenticatedUser();
AuthProvider authProvider = new AuthProvider(); AuthProvider authProvider = new AuthProvider();
List<OrderModel> get orderDetails => orderDetails; List<OrderModel> _cancelOrderList = List();
List<OrderModel> _orderList = List(); List<OrderModel> get cancelOrderList => _cancelOrderList;
List<OrderModel> get orderList => _orderList;
String url =""; String url ="";
Future cancelOrderDetail(order) async { Future getCanceledOrder(order) async {
print("step 1"); print("step 1");
hasError = false; hasError = false;
dynamic res;
await baseAppClient.getPharmacy(GET_Cancel_ORDER+order, await baseAppClient.getPharmacy(GET_Cancel_ORDER+order,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
_orderList.clear(); res = response;
response['orders'].forEach((item) { print(res);
_orderList.add(OrderModel.fromJson(item)); // _cancelOrderList.clear();
}); // response['success'].forEach((item) {
// _cancelOrderList.add(OrderModel.fromJson(item));
// });
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}); });
return res;
} }
} }

@ -23,7 +23,7 @@ class OrderDetailsService extends BaseService{
Future getOrderDetails(orderId) async { Future getOrderDetails(orderId) async {
print("step 1"); print("step 2" + orderId);
hasError = false; hasError = false;
await baseAppClient.getPharmacy(GET_ORDER_DETAILS+orderId, await baseAppClient.getPharmacy(GET_ORDER_DETAILS+orderId,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {

@ -18,12 +18,12 @@ class OrderService extends BaseService{
List<OrderModel> get orderList => _orderList; List<OrderModel> get orderList => _orderList;
String url =""; String url ="";
Future getOrder(custmerId, page_id) async { Future getOrder(customerId, pageId) async {
print("step 1");
hasError = false; 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=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"; 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";
print(url); print(url);
await baseAppClient.getPharmacy(url, await baseAppClient.getPharmacy(url,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
_orderList.clear(); _orderList.clear();

@ -0,0 +1,40 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/order_model.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:flutter/material.dart';
class writeReviewService extends BaseService{
AppSharedPreferences sharedPref = AppSharedPreferences();
AppGlobal appGlobal = new AppGlobal();
AuthenticatedUser authUser = new AuthenticatedUser();
AuthProvider authProvider = new AuthProvider();
List<OrderModel> get writeReview => writeReview;
List<OrderModel> _writeReviewList = List();
List<OrderModel> get orderList => _writeReviewList;
Future getProductReview() async {
hasError = false;
await baseAppClient.getPharmacy(WRITE_REVIEW,
onSuccess: (dynamic response, int statusCode) {
_writeReviewList.clear();
response[''].forEach((item) {
_writeReviewList.add(OrderModel.fromJson(item));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
});
}
}

@ -773,6 +773,7 @@ class TranslationBase {
String get compare => localizedValues['compare'][locale.languageCode]; String get compare => localizedValues['compare'][locale.languageCode];
String get medicationsRefill => localizedValues['medicationsRefill'][locale.languageCode]; String get medicationsRefill => localizedValues['medicationsRefill'][locale.languageCode];
String get myPrescription => localizedValues['myPrescription'][locale.languageCode]; String get myPrescription => localizedValues['myPrescription'][locale.languageCode];
String get quantity => localizedValues['quantity'][locale.languageCode];
// pharmacy module // pharmacy module

@ -17,11 +17,14 @@ class productTile extends StatelessWidget {
final String qyt; final String qyt;
final String totalPrice; final String totalPrice;
final bool isOrderDetails; final bool isOrderDetails;
final String img;
final int status;
productTile({this.productName, this.productPrice, this.productRate, productTile({this.productName, this.productPrice, this.productRate,
this.qyt, this.totalPrice, this.productReviews, this.qyt, this.totalPrice, this.productReviews, this.img,
this.isOrderDetails=true}); this.isOrderDetails=true, this.status});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -37,13 +40,10 @@ class productTile extends StatelessWidget {
children: [ children: [
Container( Container(
margin: EdgeInsets.only(left: 10), margin: EdgeInsets.only(left: 10),
child: Image( child: Image.network(img),
image: // fit: BoxFit.cover,
AssetImage('assets/images/al-habib_onlne_pharmacy_bg.png'), width: 80,
fit: BoxFit.cover, height: 80,
width: 80,
height: 80,
),
), ),
Expanded( Expanded(
flex: 5, flex: 5,
@ -119,7 +119,7 @@ class productTile extends StatelessWidget {
margin: EdgeInsets.only(bottom: 5.0), margin: EdgeInsets.only(bottom: 5.0),
child: RichText( child: RichText(
text: TextSpan( text: TextSpan(
text: 'QYT: $qyt', text: TranslationBase.of(context).quantity+"" +'$qyt',
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.grey, color: Colors.grey,
@ -163,8 +163,8 @@ class productTile extends StatelessWidget {
), ),
): Container(), ): Container(),
// this.isOrderDetails == true && model.order[0].orderStatusId == 30? // this.isOrderDetails == true && model.order[0].orderStatusId == 30?
this.isOrderDetails == true?
Expanded( if(status ==30 && this.isOrderDetails == true ) Expanded(
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [ children: [
@ -227,7 +227,7 @@ class productTile extends StatelessWidget {
), ),
], ],
), ),
) : Container(), ),
], ],
), ),
); );

Loading…
Cancel
Save