make some updates in firebase version and update gradle, finish review order

merge-requests/206/head
mosazaid 4 years ago
parent 4a84483698
commit 359eba2da0

@ -72,9 +72,17 @@ flutter {
dependencies { dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "com.google.firebase:firebase-messaging:20.3.0" /* implementation ("com.google.firebase:firebase-messaging:21.0.0", {
// protobuf-lite that firebase-config and Tink depends on.
exclude group: 'com.google.protobuf',module: 'protobuf-javalite'
// exclude group: 'com.google.protobuf',module: 'protobuf-lite'
})
implementation ('com.google.firebase:firebase-inappmessaging-display:19.1.2',{
// protobuf-lite that firebase-config and Tink depends on.
exclude group: 'com.google.protobuf',module: 'protobuf-javalite'
// exclude group: 'com.google.protobuf',module: 'protobuf-lite'
})*/
implementation 'pub.devrel:easypermissions:0.4.0' implementation 'pub.devrel:easypermissions:0.4.0'
implementation 'com.google.firebase:firebase-inappmessaging-display:17.2.0'
implementation 'com.google.guava:guava:27.0.1-android' implementation 'com.google.guava:guava:27.0.1-android'
// Dependency on local binaries // Dependency on local binaries
implementation fileTree(dir: 'libs', include: ['*.jar']) implementation fileTree(dir: 'libs', include: ['*.jar'])

@ -8,7 +8,7 @@ buildscript {
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:4.0.1' classpath 'com.android.tools.build:gradle:4.0.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.2' classpath 'com.google.gms:google-services:4.3.4'
} }
} }

@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip

@ -410,6 +410,7 @@ const GET_PATIENT_ALL_PRES_ORD =
'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders'; 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders';
const PATIENT_ER_INSERT_PRES_ORDER = const PATIENT_ER_INSERT_PRES_ORDER =
'Services/Patients.svc/REST/PatientER_InsertPresOrder'; 'Services/Patients.svc/REST/PatientER_InsertPresOrder';
const PHARMACY_MAKE_REVIEW = 'epharmacy/api/insertreviews';
// External API // External API
const ADD_ADDRESS_INFO = const ADD_ADDRESS_INFO =

@ -1,4 +1,3 @@
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/Order.dart';
import 'package:diplomaticquarterapp/pages/pharmacy/order/OrderDetails.dart'; import 'package:diplomaticquarterapp/pages/pharmacy/order/OrderDetails.dart';
@ -12,18 +11,17 @@ import '../../../locator.dart';
import '../base_view_model.dart'; import '../base_view_model.dart';
class OrderModelViewModel extends BaseViewModel { class OrderModelViewModel extends BaseViewModel {
OrderService _orderService = locator<OrderService>(); OrderService _orderService = locator<OrderService>();
List<OrderModel> get order => _orderService.orderList; List<OrderModel> get order => _orderService.orderList;
OrderDetailsService _orderDetailsService = locator<OrderDetailsService>(); OrderDetailsService _orderDetailsService = locator<OrderDetailsService>();
List<OrderModel> get orderDetails => _orderDetailsService.orderDetails; List<OrderModel> get orderDetails => _orderDetailsService.orderDetails;
CancelOrderService _cancelOrderService = locator<CancelOrderService>(); CancelOrderService _cancelOrderService = locator<CancelOrderService>();
List<OrderModel> get cancelOrder => _cancelOrderService.cancelOrderList;
List<OrderModel> get cancelOrder => _cancelOrderService.cancelOrderList;
Future getOrder(customerId, pageID) async { Future getOrder(customerId, pageID) async {
print("this is customer id" + customerId); print("this is customer id" + customerId);
@ -36,7 +34,6 @@ class OrderModelViewModel extends BaseViewModel {
//order = _orderService.orderList; //order = _orderService.orderList;
setState(ViewState.Idle); setState(ViewState.Idle);
} }
} }
Future getOrderDetails(orderId) async { Future getOrderDetails(orderId) async {
@ -52,7 +49,7 @@ class OrderModelViewModel extends BaseViewModel {
Future getProductReview() async { Future getProductReview() async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _orderService.getProductReview(); // await _orderService.getProductReview();
if (_orderService.hasError) { if (_orderService.hasError) {
error = _orderService.error; error = _orderService.error;
setState(ViewState.Error); setState(ViewState.Error);
@ -71,7 +68,6 @@ class OrderModelViewModel extends BaseViewModel {
print(value['success']['SuccessEndUserMsg']); print(value['success']['SuccessEndUserMsg']);
AppToast.showSuccessToast(message: "Request Sent Successfully"); AppToast.showSuccessToast(message: "Request Sent Successfully");
// Navigator.pop(context); // Navigator.pop(context);
}); });
if (_cancelOrderService.hasError) { if (_cancelOrderService.hasError) {
error = _cancelOrderService.error; error = _cancelOrderService.error;
@ -86,7 +82,19 @@ class OrderModelViewModel extends BaseViewModel {
} }
return res; return res;
} }
Future makeReview(Product product, double rating, String reviewText) async {
setState(ViewState.Busy);
await _orderDetailsService.makeReview(product, rating, reviewText);
if (_orderDetailsService.hasError) {
error = _orderDetailsService.error;
setState(ViewState.Error);
AppToast.showErrorToast(message: error);
} else {
setState(ViewState.Idle);
AppToast.showSuccessToast(
message: "Your review has been Submitted successfully");
}
}
} }

@ -1,41 +1,29 @@
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/order/Order.dart'; import 'package:diplomaticquarterapp/pages/pharmacy/order/Order.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; 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: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/material.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/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/services/pharmacy_services/orderDetails_service.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';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:flutter/src/widgets/image.dart' as flutterImage;
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
class OrderDetailsPage extends StatefulWidget { class OrderDetailsPage extends StatefulWidget {
var languageID; var languageID;
OrderModel orderModel; OrderModel orderModel;
OrderDetailsPage({
@required this.orderModel OrderDetailsPage({@required this.orderModel});
});
@override @override
_OrderDetailsPageState createState() => _OrderDetailsPageState(); _OrderDetailsPageState createState() => _OrderDetailsPageState();
} }
class _OrderDetailsPageState extends State<OrderDetailsPage> { class _OrderDetailsPageState extends State<OrderDetailsPage> {
getLanguageID() async { getLanguageID() async {
return await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); return await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
} }
@ -45,7 +33,9 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
String customerId; String customerId;
List<OrderModel> orderList = []; List<OrderModel> orderList = [];
List<OrderModel> cancelledOrderList = []; List<OrderModel> cancelledOrderList = [];
// String orderId="3516"; // String orderId="3516";
var model; var model;
var isCancel = false; var isCancel = false;
@ -53,7 +43,6 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
var dataIsCancel; var dataIsCancel;
var dataIsRefund; var dataIsRefund;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
@ -86,16 +75,19 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
SvgPicture.asset( SvgPicture.asset(
'assets/images/pharmacy/shipping_mark_icon.svg', 'assets/images/pharmacy/shipping_mark_icon.svg',
width: 28, width: 28,
height: 28,), height: 28,
Text(TranslationBase.of(context).shippingAddress, ),
style: TextStyle(fontSize: 13.0, fontWeight: FontWeight.bold, Text(
TranslationBase.of(context).shippingAddress,
style: TextStyle(
fontSize: 13.0,
fontWeight: FontWeight.bold,
), ),
), ),
], ],
), ),
), ),
Container( Container(
margin: EdgeInsets.only(top: 15.0, right: 10.0), margin: EdgeInsets.only(top: 15.0, right: 10.0),
padding: EdgeInsets.only(left: 11.0, right: 11.0), padding: EdgeInsets.only(left: 11.0, right: 11.0),
decoration: BoxDecoration( decoration: BoxDecoration(
@ -105,13 +97,14 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
width: 5.0, width: 5.0,
), ),
color: getStatusBackgroundColor(), color: getStatusBackgroundColor(),
borderRadius: BorderRadius.circular(30.0) borderRadius: BorderRadius.circular(30.0)),
),
child: Text( child: Text(
// widget.orderModel.orderStatus.toString().substring(12), // widget.orderModel.orderStatus.toString().substring(12),
widget.languageID == "ar" widget.languageID == "ar"
? widget.orderModel.orderStatusn.toString() ? widget.orderModel.orderStatusn.toString()
: widget.orderModel.orderStatus.toString().substring(12) , : widget.orderModel.orderStatus
.toString()
.substring(12),
// TranslationBase.of(context).delivered, // TranslationBase.of(context).delivered,
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.white,
@ -127,40 +120,56 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Text(widget.orderModel.shippingAddress.firstName.toString().substring(10) + ' ' +model.order[0].shippingAddress.lastName.toString().substring(9), Text(
style: TextStyle(fontSize: 15.0, fontWeight: FontWeight.bold, widget.orderModel.shippingAddress.firstName
), .toString()
.substring(10) +
' ' +
model.order[0].shippingAddress.lastName
.toString()
.substring(9),
style: TextStyle(
fontSize: 15.0,
fontWeight: FontWeight.bold,
), ),
]
), ),
]),
), ),
Container( Container(
margin: EdgeInsets.fromLTRB(11.0, 5.0, 1.0, 5.0), margin: EdgeInsets.fromLTRB(11.0, 5.0, 1.0, 5.0),
child: Row( child: Text(
crossAxisAlignment: CrossAxisAlignment.start, widget.orderModel.shippingAddress.address1
children:<Widget> [ .toString()
Text(widget.orderModel.shippingAddress.address1.toString().substring(9), .substring(9),
style: TextStyle(fontSize: 11.0, fontWeight: FontWeight.bold, style: TextStyle(
fontSize: 11.0,
fontWeight: FontWeight.bold,
color: Colors.grey, color: Colors.grey,
), ),
), ),
],
),
), ),
Container( Container(
margin: EdgeInsets.fromLTRB(10.0, 5.0, 1.0, 5.0), margin: EdgeInsets.fromLTRB(10.0, 5.0, 1.0, 5.0),
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Text(widget.orderModel.shippingAddress.address2.toString().substring(9) Text(
+ ' ' + widget.orderModel.shippingAddress.country.toString() widget.orderModel.shippingAddress.address2
+ ' ' + widget.orderModel.shippingAddress.zipPostalCode.toString(), .toString()
style: TextStyle(fontSize: 10.0, fontWeight: FontWeight.bold, .substring(9) +
' ' +
widget.orderModel.shippingAddress.country
.toString() +
' ' +
widget.orderModel.shippingAddress.zipPostalCode
.toString(),
style: TextStyle(
fontSize: 10.0,
fontWeight: FontWeight.bold,
color: Colors.grey, color: Colors.grey,
), ),
), ),
] ]),
),
), ),
Container( Container(
child: Row( child: Row(
@ -169,12 +178,16 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
margin: EdgeInsets.fromLTRB(10.0, 5.0, 8.0, 5.0), margin: EdgeInsets.fromLTRB(10.0, 5.0, 8.0, 5.0),
child: SvgPicture.asset( child: SvgPicture.asset(
'assets/images/pharmacy/mobile_number_icon.svg', 'assets/images/pharmacy/mobile_number_icon.svg',
height: 13,), height: 13,
),
), ),
Container( Container(
margin: EdgeInsets.only(top: 5.0, bottom: 5.0), margin: EdgeInsets.only(top: 5.0, bottom: 5.0),
child: Text(widget.orderModel.shippingAddress.phoneNumber.toString(), child: Text(
style: TextStyle(fontSize: 15.0, widget.orderModel.shippingAddress.phoneNumber
.toString(),
style: TextStyle(
fontSize: 15.0,
), ),
), ),
), ),
@ -195,30 +208,48 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
child: SvgPicture.asset( child: SvgPicture.asset(
'assets/images/pharmacy/shipping_truck_icon.svg', 'assets/images/pharmacy/shipping_truck_icon.svg',
height: 20, height: 20,
width: 20,), width: 20,
),
), ),
Container( Container(
margin: EdgeInsets.all(10.0), margin: EdgeInsets.all(10.0),
child:Text(TranslationBase.of(context).shippedMethod, child: Text(
style: TextStyle(fontSize: 13.0, fontWeight: FontWeight.bold, TranslationBase.of(context).shippedMethod,
style: TextStyle(
fontSize: 13.0,
fontWeight: FontWeight.bold,
), ),
), ),
), ),
Container( Container(
child: widget.orderModel.shippingRateComputationMethodSystemName == "Shipping.FixedOrByWeight" child: flutterImage.Image.asset(
widget.orderModel
.shippingRateComputationMethodSystemName ==
"Shipping.FixedOrByWeight"
? "assets/images/pharmacy_module/payment/hmg_shipping_logo.png"
: "assets/images/pharmacy_module/payment/aramex_shipping_logo.png",
fit: BoxFit.contain,
),
),
Container(
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(
'assets/images/pharmacy/hmg_shipping_logo.svg', 'assets/images/pharmacy_module/payment/hmg_shipping_logo.png',
height: 25, height: 25,
width: 25,), width: 25,
),
) )
: 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(
'assets/images/pharmacy/aramex_shipping_logo.svg', 'assets/images/pharmacy_module/payment/aramex_shipping_logo.png',
height: 25, height: 25,
width: 25,), width: 25,
),
), ),
), ),
], ],
@ -232,24 +263,21 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
), ),
Row( Row(
children: <Widget>[ children: <Widget>[
Container(
margin: EdgeInsets.fromLTRB(10.0, 10.0, 1.0, 10.0),
child: SvgPicture.asset(
'assets/images/pharmacy/credit_card_icon.svg',
height: 20,
width: 20,),
),
Container( Container(
margin: EdgeInsets.all(10.0), margin: EdgeInsets.all(10.0),
child: SvgPicture.asset( child: SvgPicture.asset(
'assets/images/pharmacy/credit_card_icon.svg', 'assets/images/pharmacy/credit_card_icon.svg',
height: 20, height: 20,
width: 20,), width: 20,
),
), ),
Container( Container(
margin: EdgeInsets.only(bottom: 10.0, top: 10.0), margin: EdgeInsets.only(bottom: 10.0, top: 10.0),
child:Text(widget.orderModel.paymentName.toString().substring(12), child: Text(
style: TextStyle(fontSize: 13.0, fontWeight: FontWeight.bold, widget.orderModel.paymentName.toString().substring(12),
style: TextStyle(
fontSize: 13.0,
fontWeight: FontWeight.bold,
), ),
), ),
), ),
@ -268,8 +296,11 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text(TranslationBase.of(context).orderDetail, Text(
style: TextStyle(fontSize: 15.0, fontWeight: FontWeight.bold, TranslationBase.of(context).orderDetail,
style: TextStyle(
fontSize: 15.0,
fontWeight: FontWeight.bold,
), ),
), ),
], ],
@ -282,18 +313,30 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
itemCount: widget.orderModel.orderItems.length, itemCount: widget.orderModel.orderItems.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
return Container( return Container(
child: productTile(productName: widget.orderModel.orderItems[index].product.name.toString(), child: productTile(
productPrice: widget.orderModel.orderItems[index].product.price.toString(), productName: widget
productRate: widget.orderModel.orderItems[index].product.approvedRatingSum.toDouble(), .orderModel.orderItems[index].product.name
productReviews:widget.orderModel.orderItems[index].product.approvedTotalReviews, .toString(),
totalPrice: "${(widget.orderModel.orderItems[index].product.price productPrice: widget
* widget.orderModel.orderItems[index].quantity).toStringAsFixed(2)}", .orderModel.orderItems[index].product.price
qyt: widget.orderModel.orderItems[index].quantity.toString(), .toString(),
img:widget.orderModel.orderItems[index].product.images[0].src.toString(), productRate: widget.orderModel.orderItems[index]
status: widget.orderModel.orderStatusId,), .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(),
img: widget.orderModel.orderItems[index].product
.images[0].src
.toString(),
status: widget.orderModel.orderStatusId,
product: widget.orderModel.orderItems[index].product,
), ),
);
}),
Container( Container(
padding: EdgeInsets.only(bottom: 10.0), padding: EdgeInsets.only(bottom: 10.0),
@ -301,8 +344,11 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text(TranslationBase.of(context).orderSummary, Text(
style: TextStyle(fontSize: 15.0, fontWeight: FontWeight.bold, TranslationBase.of(context).orderSummary,
style: TextStyle(
fontSize: 15.0,
fontWeight: FontWeight.bold,
), ),
), ),
], ],
@ -328,13 +374,17 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
children: <Widget>[ children: <Widget>[
Container( Container(
margin: EdgeInsets.only(right: 5.0), margin: EdgeInsets.only(right: 5.0),
child: Text(TranslationBase.of(context).sar, child: Text(
style: TextStyle(fontSize: 13.0, TranslationBase.of(context).sar,
style: TextStyle(
fontSize: 13.0,
), ),
), ),
), ),
Text(widget.orderModel.orderSubtotalExclTax.toString(), Text(
style: TextStyle(fontSize: 13.0, widget.orderModel.orderSubtotalExclTax.toString(),
style: TextStyle(
fontSize: 13.0,
), ),
), ),
], ],
@ -362,13 +412,17 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
children: <Widget>[ children: <Widget>[
Container( Container(
margin: EdgeInsets.only(right: 5.0), margin: EdgeInsets.only(right: 5.0),
child: Text(TranslationBase.of(context).sar, child: Text(
style: TextStyle(fontSize: 13.0, TranslationBase.of(context).sar,
style: TextStyle(
fontSize: 13.0,
), ),
), ),
), ),
Text(widget.orderModel.orderShippingExclTax.toString(), Text(
style: TextStyle(fontSize: 13.0, widget.orderModel.orderShippingExclTax.toString(),
style: TextStyle(
fontSize: 13.0,
), ),
), ),
], ],
@ -396,13 +450,17 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
children: <Widget>[ children: <Widget>[
Container( Container(
margin: EdgeInsets.only(right: 5.0), margin: EdgeInsets.only(right: 5.0),
child: Text(TranslationBase.of(context).sar, child: Text(
style: TextStyle(fontSize: 13.0, TranslationBase.of(context).sar,
style: TextStyle(
fontSize: 13.0,
), ),
), ),
), ),
Text(model.order[0].orderTax.toString(), Text(
style: TextStyle(fontSize: 13.0, model.order[0].orderTax.toString(),
style: TextStyle(
fontSize: 13.0,
), ),
), ),
], ],
@ -418,7 +476,8 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
child: Text( child: Text(
TranslationBase.of(context).total, TranslationBase.of(context).total,
style: TextStyle( style: TextStyle(
fontSize: 15.0,fontWeight: FontWeight.bold, fontSize: 15.0,
fontWeight: FontWeight.bold,
), ),
), ),
), ),
@ -428,13 +487,19 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
children: <Widget>[ children: <Widget>[
Container( Container(
margin: EdgeInsets.only(right: 5.0), margin: EdgeInsets.only(right: 5.0),
child: Text(TranslationBase.of(context).sar, child: Text(
style: TextStyle(fontSize: 15.0,fontWeight: FontWeight.bold, TranslationBase.of(context).sar,
style: TextStyle(
fontSize: 15.0,
fontWeight: FontWeight.bold,
), ),
), ),
), ),
Text(widget.orderModel.orderTotal.toString(), Text(
style: TextStyle(fontSize: 15.0, fontWeight: FontWeight.bold, widget.orderModel.orderTotal.toString(),
style: TextStyle(
fontSize: 15.0,
fontWeight: FontWeight.bold,
), ),
), ),
], ],
@ -442,7 +507,8 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
), ),
], ],
), ),
widget.orderModel.orderStatusId == 10 ? InkWell( widget.orderModel.orderStatusId == 10
? InkWell(
onTap: () { onTap: () {
// Navigator.push(context, // Navigator.push(context,
// MaterialPageRoute(builder: (context) => InAppBrowser())); // MaterialPageRoute(builder: (context) => InAppBrowser()));
@ -457,11 +523,9 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
border: Border.all( border: Border.all(
color: Colors.green, color: Colors.green,
style: BorderStyle.solid, style: BorderStyle.solid,
width: 1.0 width: 1.0),
),
color: Colors.green, color: Colors.green,
borderRadius: BorderRadius.circular(5.0) borderRadius: BorderRadius.circular(5.0)),
),
child: Center( child: Center(
child: Text( child: Text(
TranslationBase.of(context).payOnline, TranslationBase.of(context).payOnline,
@ -473,11 +537,14 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
), ),
), ),
), ),
) : Container(), )
: Container(),
// getCancelOrder(canCancel, canRefund), // getCancelOrder(canCancel, canRefund),
isCancel ? InkWell( isCancel
? InkWell(
onTap: () { onTap: () {
presentConfirmDialog(model,widget.orderModel.id);//(widget.orderModel.id)); presentConfirmDialog(model,
widget.orderModel.id); //(widget.orderModel.id));
// //
}, },
child: Container( child: Container(
@ -490,12 +557,12 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
style: TextStyle( style: TextStyle(
color: Colors.red[900], color: Colors.red[900],
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
decoration: TextDecoration.underline decoration: TextDecoration.underline),
),
), ),
), ),
), ),
) : Container(), )
: Container(),
], ],
), ),
), ),
@ -504,47 +571,42 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
); );
} }
Color getStatusBackgroundColor() { Color getStatusBackgroundColor() {
print(widget.orderModel.orderStatusId); print(widget.orderModel.orderStatusId);
// if(orderStatus == 'delivered') // if(orderStatus == 'delivered')
if(widget.orderModel.orderStatusId == 30 ||widget.orderModel.orderStatusId == 997 if (widget.orderModel.orderStatusId == 30 ||
||widget.orderModel.orderStatusId == 994) widget.orderModel.orderStatusId == 997 ||
widget.orderModel.orderStatusId == 994)
return Colors.blue[700]; return Colors.blue[700];
else if (widget.orderModel.orderStatusId == 20 ||widget.orderModel.orderStatusId == 995 else if (widget.orderModel.orderStatusId == 20 ||
||widget.orderModel.orderStatusId == 998 ||widget.orderModel.orderStatusId == 999) widget.orderModel.orderStatusId == 995 ||
widget.orderModel.orderStatusId == 998 ||
widget.orderModel.orderStatusId == 999)
return Colors.green; return Colors.green;
else if (widget.orderModel.orderStatusId == 10) else if (widget.orderModel.orderStatusId == 10)
return Colors.orange[300]; return Colors.orange[300];
else if (widget.orderModel.orderStatusId == 40 ||widget.orderModel.orderStatusId == 996 else if (widget.orderModel.orderStatusId == 40 ||
||widget.orderModel.orderStatusId == 200) widget.orderModel.orderStatusId == 996 ||
return Colors.red[900]; widget.orderModel.orderStatusId == 200) return Colors.red[900];
} }
getCancelOrder(dataIsCancel) { getCancelOrder(dataIsCancel) {
if(widget.orderModel.canCancel && widget.orderModel.canRefund) if (widget.orderModel.canCancel && widget.orderModel.canRefund) {
{
setState(() { setState(() {
isCancel = true; isCancel = true;
isRefund = false; isRefund = false;
}); });
} } else if (widget.orderModel.canCancel) {
else if (widget.orderModel.canCancel ){
setState(() { setState(() {
isCancel = true; isCancel = true;
isRefund = false; isRefund = false;
}); });
} else if (widget.orderModel.canRefund) {
}
else if (widget.orderModel.canRefund){
setState(() { setState(() {
isCancel = false; isCancel = false;
isRefund = true; isRefund = true;
}); });
} } else {
else {
setState(() { setState(() {
isCancel = false; isCancel = false;
isRefund = false; isRefund = false;
@ -559,17 +621,19 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
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: () => cancelFunction.getCanceledOrder(id, context).then((value){ okFunction: () =>
cancelFunction.getCanceledOrder(id, context).then((value) {
print(":D"); print(":D");
print(value); print(value);
// Navigator.pop(context); // Navigator.pop(context);
Navigator.push(context, Navigator.push(
MaterialPageRoute(builder: (context) => context,
OrderPage(customerID: widget.orderModel.customerId.toString())), MaterialPageRoute(
);}), builder: (context) => OrderPage(
customerID: widget.orderModel.customerId.toString())),
cancelFunction: () => {}
); );
}),
cancelFunction: () => {});
dialog.showAlertDialog(context); dialog.showAlertDialog(context);
} }
@ -582,12 +646,5 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
// MaterialPageRoute(builder: (context) => OrderPage())); // MaterialPageRoute(builder: (context) => OrderPage()));
} }
} }
} }

@ -1,4 +1,3 @@
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/order_model_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/order_model_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/pharmacy/profile/profile.dart'; import 'package:diplomaticquarterapp/pages/pharmacy/profile/profile.dart';
@ -8,110 +7,98 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/order_model.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/order_model.dart';
import 'package:flutter_svg/svg.dart'; import 'package:flutter_svg/svg.dart';
import 'package:intl/intl.dart';
import 'package:rating_bar/rating_bar.dart'; import 'package:rating_bar/rating_bar.dart';
import 'package:flutter/src/widgets/image.dart' as flutterImage;
class ProductReviewPage extends StatefulWidget { class ProductReviewPage extends StatefulWidget {
final Product product;
ProductReviewPage(this.product);
OrderModel orderModel;
ProductReviewPage({
@required this.orderModel
});
@override @override
_ProductReviewPageState createState() => _ProductReviewPageState(); _ProductReviewPageState createState() => _ProductReviewPageState();
} }
class _ProductReviewPageState extends State<ProductReviewPage> { class _ProductReviewPageState extends State<ProductReviewPage> {
String orderId ="3516";
var pharmacyUser ="";
var product ="";
var CustomerId ="";
String submitTxt ="";
var doctorRating= "";
var reviewObj = {};
AppSharedPreferences sharedPref = AppSharedPreferences(); AppSharedPreferences sharedPref = AppSharedPreferences();
double currentRating = 0;
String reviewText = "";
TextEditingController _reviewController = new TextEditingController();
bool finishReview = false;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
double ratingValue = double.parse("${widget.product.approvedRatingSum}");
return BaseView<OrderModelViewModel>( return BaseView<OrderModelViewModel>(
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: !finishReview ? SingleChildScrollView(
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
Row( Container(
mainAxisAlignment: MainAxisAlignment.spaceEvenly, margin: EdgeInsets.symmetric(vertical: 8, horizontal: 16),
children: [
ListView.builder(
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: ScrollPhysics(),
itemCount:widget.orderModel.orderItems.length,
itemBuilder: (context, index){
return Container(
margin: EdgeInsets.only(top :15.0, bottom: 15.0),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
Column( widget.product.images != null
children: [ ? flutterImage.Image.network(
Row( widget.product.images[0].src,
mainAxisAlignment: MainAxisAlignment.spaceEvenly, fit: BoxFit.cover,
children: [ height: 80,
Container( )
margin: EdgeInsets.only(left: 10), : flutterImage.Image.asset(
child: SvgPicture.asset( "assets/images/no_image.png",
// widget.orderModel.orderItems[index].product.images[index].src.toString(),
'assets/images/al-habib_onlne_pharmacy_bg.png',
fit: BoxFit.cover, fit: BoxFit.cover,
width: 80,
height: 80, height: 80,
), ),
), Expanded(
] child: Container(
), child: Column(
],
),
Column(
children: <Widget>[
Row(
children: <Widget>[
Text(widget.orderModel.orderItems[index].product.name.toString(),
style: TextStyle(fontSize: 16.0,
),
),
],
),
Row(
children: [ children: [
Container( Container(
margin: EdgeInsets.only(left: 5), margin: EdgeInsets.all(5),
child: Text(widget.orderModel.orderItems[index].product.price.toString(), child: Align(
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, alignment: Alignment.topLeft,
child: RichText(
text: TextSpan(
text: widget.product.name,
style: TextStyle(
color: Colors.black,
fontSize: 14,
fontWeight: FontWeight.normal),
),
), ),
), ),
), ),
Container( Container(
margin: EdgeInsets.only(left: 5), margin: EdgeInsets.all(5),
child: Text(TranslationBase.of(context).sar, child: Align(
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, alignment: Alignment.topLeft,
child: RichText(
text: TextSpan(
text:
'${widget.product.price} ${TranslationBase.of(context).sar}',
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.black,
fontSize: 13),
), ),
), ),
), ),
],
), ),
Row( Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
Container( Container(
margin: EdgeInsets.all(5),
child: Align( child: Align(
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
child: RatingBar.readOnly( child: RatingBar.readOnly(
initialRating: 3, initialRating: ratingValue,
size: 15.0, size: 15.0,
filledColor: Colors.yellow[700], filledColor: Colors.yellow[700],
emptyColor: Colors.grey[500], emptyColor: Colors.grey[500],
@ -122,17 +109,20 @@ class _ProductReviewPageState extends State<ProductReviewPage> {
), ),
), ),
), ),
Container( SizedBox(
child: Text(widget.orderModel.orderItems[index].product.approvedRatingSum.toString(), width: 20,
style: TextStyle(fontSize: 14.0, fontWeight: FontWeight.bold,
),
),
), ),
Container( Container(
margin: EdgeInsets.only(left: 5), child: Align(
child: Text("(" + widget.orderModel.orderItems[index].product.approvedTotalReviews.toString() child: RichText(
+ ' ' + TranslationBase.of(context).review +")", text: TextSpan(
style: TextStyle(fontSize: 12.0, text:
'(${widget.product.approvedTotalReviews} reviews)',
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.grey,
fontSize: 13),
),
), ),
), ),
), ),
@ -140,13 +130,10 @@ class _ProductReviewPageState extends State<ProductReviewPage> {
), ),
], ],
), ),
]
), ),
);
}
), ),
]), ]),
),
Divider( Divider(
color: Colors.grey[350], color: Colors.grey[350],
height: 20, height: 20,
@ -162,8 +149,6 @@ class _ProductReviewPageState extends State<ProductReviewPage> {
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
children: <Widget>[ children: <Widget>[
RatingBar( RatingBar(
// initialRating:
// this.doctor.actualDoctorRate.toDouble(),
size: 40.0, size: 40.0,
filledColor: Colors.yellow[700], filledColor: Colors.yellow[700],
emptyColor: Colors.grey[500], emptyColor: Colors.grey[500],
@ -171,51 +156,79 @@ class _ProductReviewPageState extends State<ProductReviewPage> {
halfFilledIcon: Icons.star_half, halfFilledIcon: Icons.star_half,
filledIcon: Icons.star, filledIcon: Icons.star,
emptyIcon: Icons.star, emptyIcon: Icons.star,
onRatingChanged: (rating) {
currentRating = rating;
},
), ),
], ],
), ),
), ),
Container( Container(
padding: EdgeInsets.fromLTRB(8.0, 20.0, 8.0,20.0), padding: EdgeInsets.symmetric(horizontal: 16, vertical: 16),
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
TextFormField( TextFormField(
controller: _reviewController,
maxLines: 6,
minLines: 4,
decoration: InputDecoration( decoration: InputDecoration(
contentPadding: const EdgeInsets.symmetric(vertical: 60.0),
border: InputBorder.none, border: InputBorder.none,
hintText: 'Tell us more about product!', hintText: 'Tell us more about product!',
focusedBorder: OutlineInputBorder( focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(5.0), borderRadius: BorderRadius.circular(5.0),
borderSide: BorderSide(width: 1, color: Colors.grey[400]), borderSide:
BorderSide(width: 1, color: Colors.grey[400]),
), ),
enabledBorder: OutlineInputBorder( enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(5.0)), borderRadius:
borderSide: BorderSide(color: Colors.grey[400], width: 1), BorderRadius.all(Radius.circular(5.0)),
borderSide:
BorderSide(color: Colors.grey[400], width: 1),
), ),
), ),
onChanged: (value) {
setState(() {
reviewText = value;
});
},
textAlign: TextAlign.start,
textAlignVertical: TextAlignVertical.top,
), ),
], ],
), ),
), ),
InkWell( InkWell(
onTap: () { onTap: reviewText != null && reviewText != ""
// Navigator.push(context, ? () {
// MaterialPageRoute(builder: (context) => )); model
}, .makeReview(
widget.product, ratingValue, reviewText)
.then((value) {
setState(() {
finishReview = true;
});
});
}
: null,
child: Container( child: Container(
margin: EdgeInsets.symmetric(vertical: 8, horizontal: 16),
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], color: _reviewController.value.text != null &&
_reviewController.value.text != ""
? Colors.yellow[700]
: Color(0xFFf5d69c),
style: BorderStyle.solid, style: BorderStyle.solid,
width: 1.0 width: 1.0),
), color: _reviewController.value.text != null &&
color: Colors.yellow[700], _reviewController.value.text != ""
borderRadius: BorderRadius.circular(5.0) ? Colors.yellow[700]
), : Color(0xFFf5d69c),
borderRadius: BorderRadius.circular(5.0)),
child: Center( child: Center(
child: Text( child: Text(
TranslationBase.of(context).shareReview, TranslationBase.of(context).shareReview,
@ -231,14 +244,12 @@ class _ProductReviewPageState extends State<ProductReviewPage> {
), ),
], ],
), ),
) : getReviewedProduct(),
),
), ),
),),
); );
} }
//new screen is showing after submitting the review //new screen is showing after submitting the review
Widget getReviewedProduct() { Widget getReviewedProduct() {
return Column( return Column(
@ -250,20 +261,26 @@ class _ProductReviewPageState extends State<ProductReviewPage> {
SvgPicture.asset( SvgPicture.asset(
'assets/images/pharmacy/check_icon.svg', 'assets/images/pharmacy/check_icon.svg',
width: 28, width: 28,
height: 28,), height: 28,
),
Container( Container(
margin: EdgeInsets.only(left: 10.0), margin: EdgeInsets.symmetric(horizontal: 8),
child: Text(TranslationBase.of(context).reviewSuccessful, child: Text(
style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold, TranslationBase.of(context).reviewSuccessful,
style: TextStyle(
fontSize: 20.0,
fontWeight: FontWeight.bold,
), ),
), ),
), ),
], ],
), ),
Container( Container(
margin: EdgeInsets.only(top:5.0, bottom: 20.0 ), margin: EdgeInsets.symmetric(horizontal: 8, vertical: 8),
child: Text(TranslationBase.of(context).reviewShared, child: Text(
style: TextStyle(fontSize: 15.0, TranslationBase.of(context).reviewShared,
style: TextStyle(
fontSize: 15.0,
), ),
), ),
), ),
@ -272,10 +289,11 @@ class _ProductReviewPageState extends State<ProductReviewPage> {
child: SvgPicture.asset( child: SvgPicture.asset(
'assets/images/pharmacy/success_review_icon.svg', 'assets/images/pharmacy/success_review_icon.svg',
width: 100, width: 100,
height: 100,), height: 100,
),
), ),
Container( Container(
margin: EdgeInsets.only(left: 20.0, right: 20.0), margin: EdgeInsets.symmetric(horizontal: 16),
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
Row( Row(
@ -284,17 +302,15 @@ class _ProductReviewPageState extends State<ProductReviewPage> {
SvgPicture.asset( SvgPicture.asset(
'assets/images/pharmacy/quote_start.svg', 'assets/images/pharmacy/quote_start.svg',
width: 15, width: 15,
height: 15,), height: 15,
],
), ),
Row( ],
mainAxisAlignment: MainAxisAlignment.center,
children:<Widget> [
Text(TranslationBase.of(context).reviewComment,
style: TextStyle(fontSize: 15.0,
), ),
Text(
TranslationBase.of(context).reviewComment,
style: TextStyle(
fontSize: 15.0,
), ),
],
), ),
Row( Row(
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
@ -302,7 +318,8 @@ class _ProductReviewPageState extends State<ProductReviewPage> {
SvgPicture.asset( SvgPicture.asset(
'assets/images/pharmacy/quote_end.svg', 'assets/images/pharmacy/quote_end.svg',
width: 15, width: 15,
height: 15,), height: 15,
),
], ],
), ),
], ],
@ -320,17 +337,16 @@ class _ProductReviewPageState extends State<ProductReviewPage> {
); );
}, },
child: Container( child: Container(
height: 50.0, color: Colors.transparent, height: 50.0,
color: Colors.transparent,
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border.all( border: Border.all(
color: Colors.orange, color: Colors.orange,
style: BorderStyle.solid, style: BorderStyle.solid,
width: 1.0 width: 1.0),
),
color: Colors.transparent, color: Colors.transparent,
borderRadius: BorderRadius.circular(5.0) borderRadius: BorderRadius.circular(5.0)),
),
child: Center( child: Center(
child: Text( child: Text(
TranslationBase.of(context).backMyAccount, TranslationBase.of(context).backMyAccount,
@ -348,23 +364,4 @@ class _ProductReviewPageState extends State<ProductReviewPage> {
); );
} }
// submit(){
// this.orderId.id = "0";
// this.reviewObj.position = 0;
// this.reviewObj.customerId = this.pharmacyUser.CustomerId;
// this.reviewObj.productId = this.product.id;
// this.reviewObj.storeId = 2;
// this.reviewObj.isApproved = false;
// this.reviewObj.title ='';
// this.reviewObj.reviewText = this.submitTxt;
// this.reviewObj.rating = this.doctorRating;
// this.reviewObj.replyText = null;
// this.reviewObj.helpfulYesTotal = 0;
// this.reviewObj.helpfulNoTotal = 0;
// this.reviewObj.createdOnUtc = new Date().toString();
// this.submitProductReview();
// }
submitProductReview(){
}
} }

@ -36,4 +36,40 @@ class OrderDetailsService extends BaseService{
super.error = error; super.error = error;
}); });
} }
Future makeReview(Product product, double rating, String reviewText) async {
hasError = false;
super.error = "";
var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID);
Map<String, dynamic> body = Map();
Map<String, dynamic> reviewBody = Map();
reviewBody["created_on_utc"] = DateTime.now().toString();
reviewBody["customer_id"] = customerId;
reviewBody["helpful_no_total"] = 0;
reviewBody["helpful_yes_total"] = 0;
reviewBody["id"] = 0;
reviewBody["is_approved"] = false;
reviewBody["position"] = 0;
reviewBody["product_id"] = product.id;
reviewBody["rating"] = rating;
reviewBody["reply_text"] = reviewText;
reviewBody["store_id"] = 2;
reviewBody["title"] = "";
body['review'] = reviewBody;
await baseAppClient.post("$PHARMACY_MAKE_REVIEW",
onSuccess: (response, statusCode) async {
/*
"success": {
"SuccessEndUserMsg": "Your request has been completed successfuly.",
"SuccessEndUserMsgN": "تمت العملية بنجاح"
}
*/
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
} }

@ -1,3 +1,4 @@
import 'package:diplomaticquarterapp/core/model/pharmacies/order_model.dart';
import 'package:diplomaticquarterapp/pages/pharmacy/order/ProductReview.dart'; import 'package:diplomaticquarterapp/pages/pharmacy/order/ProductReview.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_html/style.dart'; import 'package:flutter_html/style.dart';
@ -5,7 +6,7 @@ import 'package:flutter_html/style.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:rating_bar/rating_bar.dart'; import 'package:rating_bar/rating_bar.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/src/widgets/image.dart' as flutterImage;
@ -19,11 +20,11 @@ class productTile extends StatelessWidget {
final bool isOrderDetails; final bool isOrderDetails;
final String img; final String img;
final int status; final int status;
final Product product;
productTile({this.productName, this.productPrice, this.productRate, productTile({this.productName, this.productPrice, this.productRate,
this.qyt, this.totalPrice, this.productReviews, this.img, this.qyt, this.totalPrice, this.productReviews, this.img,
this.isOrderDetails=true, this.status}); this.isOrderDetails=true, this.status, this.product});
@override @override
@ -40,7 +41,7 @@ class productTile extends StatelessWidget {
children: [ children: [
Container( Container(
margin: EdgeInsets.only(left: 10), margin: EdgeInsets.only(left: 10),
child: Image.network(img), child: flutterImage.Image.network(img),
// fit: BoxFit.cover, // fit: BoxFit.cover,
width: 80, width: 80,
height: 80, height: 80,
@ -202,7 +203,7 @@ class productTile extends StatelessWidget {
InkWell( InkWell(
onTap: () { onTap: () {
Navigator.push(context, Navigator.push(context,
MaterialPageRoute(builder: (context) => ProductReviewPage())); MaterialPageRoute(builder: (context) => ProductReviewPage(product)));
}, },
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),

@ -45,7 +45,7 @@ dependencies:
url_launcher: ^5.5.0 url_launcher: ^5.5.0
shared_preferences: ^0.5.8 shared_preferences: ^0.5.8
flutter_flexible_toast: ^0.1.4 flutter_flexible_toast: ^0.1.4
firebase_messaging: ^7.0.0 firebase_messaging: ^7.0.3
android_intent: ^0.3.7+7 android_intent: ^0.3.7+7
# Progress bar # Progress bar
progress_hud_v2: ^2.0.0 progress_hud_v2: ^2.0.0

Loading…
Cancel
Save