|
|
|
@ -17,9 +17,10 @@ import 'package:provider/provider.dart';
|
|
|
|
import 'package:rating_bar/rating_bar.dart';
|
|
|
|
import 'package:rating_bar/rating_bar.dart';
|
|
|
|
import 'package:diplomaticquarterapp/core/model/pharmacies/recommendedProduct_model.dart';
|
|
|
|
import 'package:diplomaticquarterapp/core/model/pharmacies/recommendedProduct_model.dart';
|
|
|
|
import 'screens/cart-order-page.dart';
|
|
|
|
import 'screens/cart-order-page.dart';
|
|
|
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
|
|
|
|
|
|
|
|
|
|
|
|
int price = 0;
|
|
|
|
int price = 0;
|
|
|
|
var languageID;
|
|
|
|
dynamic languageID;
|
|
|
|
bool isOverQuantity = false;
|
|
|
|
bool isOverQuantity = false;
|
|
|
|
bool isInWishlit = false;
|
|
|
|
bool isInWishlit = false;
|
|
|
|
//int isSelected = 1;
|
|
|
|
//int isSelected = 1;
|
|
|
|
@ -35,7 +36,7 @@ class ProductDetailPage extends StatefulWidget {
|
|
|
|
// final Products recommendedProducts;
|
|
|
|
// final Products recommendedProducts;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ProductDetailPage(this.product, );
|
|
|
|
ProductDetailPage(this.product );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
@ -43,15 +44,20 @@ class ProductDetailPage extends StatefulWidget {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
class __ProductDetailPageState extends State<ProductDetailPage> {
|
|
|
|
class __ProductDetailPageState extends State<ProductDetailPage> {
|
|
|
|
|
|
|
|
AppSharedPreferences sharedPref = AppSharedPreferences();
|
|
|
|
|
|
|
|
|
|
|
|
bool isTrue = true;
|
|
|
|
bool isTrue = true;
|
|
|
|
bool isDetails = true;
|
|
|
|
bool isDetails = true;
|
|
|
|
bool isReviews = false;
|
|
|
|
bool isReviews = false;
|
|
|
|
bool isAvailabilty = false;
|
|
|
|
bool isAvailabilty = false;
|
|
|
|
dynamic wishlistItems;
|
|
|
|
dynamic wishlistItems;
|
|
|
|
var model;
|
|
|
|
//var model;
|
|
|
|
|
|
|
|
|
|
|
|
// String ProductId="4561";
|
|
|
|
// String ProductId="4561";
|
|
|
|
String productId = "";
|
|
|
|
// String productId = "";
|
|
|
|
|
|
|
|
getLanguageID() async {
|
|
|
|
|
|
|
|
languageID = await sharedPref.getString(APP_LANGUAGE);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
checkWishlist() async {
|
|
|
|
checkWishlist() async {
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
@ -72,11 +78,12 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
|
|
|
|
setState(() {});
|
|
|
|
setState(() {});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void initState() {
|
|
|
|
void initState() {
|
|
|
|
|
|
|
|
getLanguageID();
|
|
|
|
price = 1;
|
|
|
|
price = 1;
|
|
|
|
specificationData = widget.product;
|
|
|
|
specificationData = widget.product;
|
|
|
|
userInfo();
|
|
|
|
userInfo();
|
|
|
|
// recommendedData= widget.recommendedProducts;
|
|
|
|
|
|
|
|
super.initState();
|
|
|
|
super.initState();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -97,7 +104,7 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return customerId != null
|
|
|
|
return customerId != null
|
|
|
|
? DetailPageScafold(
|
|
|
|
? DetailPageScafold(
|
|
|
|
appBarTitle: 'product detail page',
|
|
|
|
appBarTitle: TranslationBase.of(context).productDetails,
|
|
|
|
isShowAppBar: true,
|
|
|
|
isShowAppBar: true,
|
|
|
|
isPharmacy: true,
|
|
|
|
isPharmacy: true,
|
|
|
|
isShowDecPage: false,
|
|
|
|
isShowDecPage: false,
|
|
|
|
@ -125,7 +132,7 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
|
|
|
|
flex: 1,
|
|
|
|
flex: 1,
|
|
|
|
child: Container(
|
|
|
|
child: Container(
|
|
|
|
alignment: Alignment.centerRight,
|
|
|
|
alignment: Alignment.centerRight,
|
|
|
|
child: languageID == 'ar'
|
|
|
|
child: languageID == "ar"
|
|
|
|
? Text(
|
|
|
|
? Text(
|
|
|
|
widget.product
|
|
|
|
widget.product
|
|
|
|
.discountDescriptionn,
|
|
|
|
.discountDescriptionn,
|
|
|
|
@ -166,7 +173,7 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
width: 500,
|
|
|
|
width: 500,
|
|
|
|
height: 150,
|
|
|
|
height: 220,
|
|
|
|
color: Colors.white,
|
|
|
|
color: Colors.white,
|
|
|
|
child: productNameAndPrice(context, widget.product),
|
|
|
|
child: productNameAndPrice(context, widget.product),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -175,7 +182,7 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
width: 500,
|
|
|
|
width: 500,
|
|
|
|
height: 120,
|
|
|
|
height: 100,
|
|
|
|
color: Colors.white,
|
|
|
|
color: Colors.white,
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
@ -195,7 +202,8 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
|
|
|
|
padding: const EdgeInsets.all(8.0),
|
|
|
|
padding: const EdgeInsets.all(8.0),
|
|
|
|
child: Container(
|
|
|
|
child: Container(
|
|
|
|
child: Text(
|
|
|
|
child: Text(
|
|
|
|
"there is no data",
|
|
|
|
TranslationBase.of(context).noData,
|
|
|
|
|
|
|
|
// "there is no data",
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -335,10 +343,9 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
child: Text(
|
|
|
|
child: Text(
|
|
|
|
languageID == 'ar'
|
|
|
|
languageID == "ar"
|
|
|
|
? widget.product.fullDescriptionn
|
|
|
|
? widget.product.fullDescriptionn
|
|
|
|
: widget.product
|
|
|
|
: widget.product.fullDescription ??
|
|
|
|
.fullDescription ??
|
|
|
|
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 16,
|
|
|
|
fontSize: 16,
|
|
|
|
@ -507,7 +514,8 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
|
|
|
|
: Container(
|
|
|
|
: Container(
|
|
|
|
padding: EdgeInsets.all(15),
|
|
|
|
padding: EdgeInsets.all(15),
|
|
|
|
alignment: Alignment.center,
|
|
|
|
alignment: Alignment.center,
|
|
|
|
child: Text('No Reviews Available'),
|
|
|
|
child: Text(TranslationBase.of(context).noReviewsAvailable,),
|
|
|
|
|
|
|
|
// Text('No Reviews Available'),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
)
|
|
|
|
: isAvailabilty
|
|
|
|
: isAvailabilty
|
|
|
|
@ -521,8 +529,8 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
|
|
|
|
? Container(
|
|
|
|
? Container(
|
|
|
|
padding: EdgeInsets.all(15),
|
|
|
|
padding: EdgeInsets.all(15),
|
|
|
|
alignment: Alignment.center,
|
|
|
|
alignment: Alignment.center,
|
|
|
|
child: Text(
|
|
|
|
child: Text(TranslationBase.of(context).noLocationAvailable,),
|
|
|
|
'No location Available'),
|
|
|
|
// Text('No location Available'),
|
|
|
|
)
|
|
|
|
)
|
|
|
|
: ListView.builder(
|
|
|
|
: ListView.builder(
|
|
|
|
physics: ScrollPhysics(),
|
|
|
|
physics: ScrollPhysics(),
|
|
|
|
@ -614,14 +622,7 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Row(
|
|
|
|
Row(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
// Container(
|
|
|
|
customerId != null ? Container(
|
|
|
|
// width: 500,
|
|
|
|
|
|
|
|
// height: 100,
|
|
|
|
|
|
|
|
// margin: EdgeInsets.only(bottom: 100),
|
|
|
|
|
|
|
|
// color: Colors.white,
|
|
|
|
|
|
|
|
// child: Text("ENAD TEST"),
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
Container(
|
|
|
|
|
|
|
|
width: 410,
|
|
|
|
width: 410,
|
|
|
|
height: 50,
|
|
|
|
height: 50,
|
|
|
|
// margin: EdgeInsets.only(bottom: 5),
|
|
|
|
// margin: EdgeInsets.only(bottom: 5),
|
|
|
|
@ -630,7 +631,8 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
|
|
|
|
TranslationBase.of(context).recommended,
|
|
|
|
TranslationBase.of(context).recommended,
|
|
|
|
bold: true,
|
|
|
|
bold: true,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
|
|
|
|
: Container(),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
SingleChildScrollView(
|
|
|
|
SingleChildScrollView(
|
|
|
|
@ -653,7 +655,6 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
|
|
|
|
onModelReady: (model) => model.getRecommendedProducts(widget.product.id),
|
|
|
|
onModelReady: (model) => model.getRecommendedProducts(widget.product.id),
|
|
|
|
builder: (_, model, wi) => Container(
|
|
|
|
builder: (_, model, wi) => Container(
|
|
|
|
child:
|
|
|
|
child:
|
|
|
|
// Text(model.recommendedProductList[0].id),
|
|
|
|
|
|
|
|
model.recommendedProductList.length != null
|
|
|
|
model.recommendedProductList.length != null
|
|
|
|
? Expanded(
|
|
|
|
? Expanded(
|
|
|
|
child: ListView.builder(
|
|
|
|
child: ListView.builder(
|
|
|
|
@ -668,10 +669,13 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
|
|
|
|
onTap: ()
|
|
|
|
onTap: ()
|
|
|
|
async {
|
|
|
|
async {
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
await Navigator.push(
|
|
|
|
RecommendedProductModel data = model.recommendedProductList[index];
|
|
|
|
|
|
|
|
var json = data.toJson();
|
|
|
|
|
|
|
|
PharmacyProduct product = new PharmacyProduct.fromJson(json);
|
|
|
|
|
|
|
|
await Navigator.pushReplacement(
|
|
|
|
context,
|
|
|
|
context,
|
|
|
|
FadePage(
|
|
|
|
FadePage(
|
|
|
|
page: ProductDetailPage(model.recommendedProductList[index]['id']),
|
|
|
|
page: ProductDetailPage(product),
|
|
|
|
));
|
|
|
|
));
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
@ -702,26 +706,26 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
|
|
|
|
child: Align(
|
|
|
|
child: Align(
|
|
|
|
alignment: Alignment.topRight,
|
|
|
|
alignment: Alignment.topRight,
|
|
|
|
child: IconButton(
|
|
|
|
child: IconButton(
|
|
|
|
icon: Icon(model.recommendedProductList[index]['isinwishlist'] != true ? Icons.favorite_border : Icons.favorite),
|
|
|
|
icon: Icon(model.recommendedProductList[index].isinwishlist != true ? Icons.favorite_border : Icons.favorite),
|
|
|
|
color: model.recommendedProductList[index]['isinwishlist'] != true ? Colors.grey : Colors.red,
|
|
|
|
color: model.recommendedProductList[index].isinwishlist != true ? Colors.grey : Colors.red,
|
|
|
|
onPressed: () async {
|
|
|
|
onPressed: () async {
|
|
|
|
|
|
|
|
|
|
|
|
if (customerId != null ) {
|
|
|
|
if (customerId != null ) {
|
|
|
|
if (!isInWishlit && model.recommendedProductList[index]['isinwishlist'] != true) {
|
|
|
|
if (!isInWishlit && model.recommendedProductList[index].isinwishlist != true) {
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
await addToWishlistFunction(model.recommendedProductList[index]['id']);
|
|
|
|
await addToWishlistFunction(model.recommendedProductList[index].id);
|
|
|
|
// checkWishlist();
|
|
|
|
// checkWishlist();
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
setState((){
|
|
|
|
setState((){
|
|
|
|
model.recommendedProductList[index]['isinwishlist'] = true;
|
|
|
|
model.recommendedProductList[index].isinwishlist= true;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
await deleteFromWishlistFunction(model.recommendedProductList[index]['id']);
|
|
|
|
await deleteFromWishlistFunction(model.recommendedProductList[index].id);
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
setState((){
|
|
|
|
setState((){
|
|
|
|
model.recommendedProductList[index]['isinwishlist'] = false;
|
|
|
|
model.recommendedProductList[index].isinwishlist = false;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
@ -773,10 +777,10 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
|
|
|
|
alignment:
|
|
|
|
alignment:
|
|
|
|
Alignment.center,
|
|
|
|
Alignment.center,
|
|
|
|
// padding: EdgeInsets.only(left: 25, bottom: 20),
|
|
|
|
// padding: EdgeInsets.only(left: 25, bottom: 20),
|
|
|
|
child: (model.recommendedProductList[index]['images'] != null &&
|
|
|
|
child: (model.recommendedProductList[index].images != null &&
|
|
|
|
model.recommendedProductList[index]['images'].length > 0)
|
|
|
|
model.recommendedProductList[index].images.length > 0)
|
|
|
|
? Image.network(
|
|
|
|
? Image.network(
|
|
|
|
model.recommendedProductList[index]['images'][0]['src'].toString(),
|
|
|
|
model.recommendedProductList[index].images[0].src.toString(),
|
|
|
|
// item.images[0].src,
|
|
|
|
// item.images[0].src,
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
height: 60,
|
|
|
|
height: 60,
|
|
|
|
@ -788,7 +792,7 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
width: model.recommendedProductList[index]['rx_message'] !=
|
|
|
|
width: model.recommendedProductList[index].rxMessage !=
|
|
|
|
null
|
|
|
|
null
|
|
|
|
? MediaQuery.of(context).size.width /
|
|
|
|
? MediaQuery.of(context).size.width /
|
|
|
|
5
|
|
|
|
5
|
|
|
|
@ -802,20 +806,16 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
|
|
|
|
borderRadius:
|
|
|
|
borderRadius:
|
|
|
|
BorderRadius.only(topLeft: Radius.circular(6)),
|
|
|
|
BorderRadius.only(topLeft: Radius.circular(6)),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
child:
|
|
|
|
child: model.recommendedProductList[index].rxMessage != null
|
|
|
|
Texts(
|
|
|
|
? Texts(
|
|
|
|
model.recommendedProductList[index]['rx_message'] != null
|
|
|
|
languageID == "ar"
|
|
|
|
? model.recommendedProductList[index]['rx_message']
|
|
|
|
? model.recommendedProductList[index].rxMessagen
|
|
|
|
: "",
|
|
|
|
: model.recommendedProductList[index].rxMessage,
|
|
|
|
color:
|
|
|
|
color: Colors.white,
|
|
|
|
Colors.white,
|
|
|
|
regular: true,
|
|
|
|
regular:
|
|
|
|
fontSize: 10,
|
|
|
|
true,
|
|
|
|
fontWeight: FontWeight.w400,
|
|
|
|
fontSize:
|
|
|
|
):Texts (""),
|
|
|
|
10,
|
|
|
|
|
|
|
|
fontWeight:
|
|
|
|
|
|
|
|
FontWeight.w400,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
]),
|
|
|
|
]),
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
@ -831,10 +831,9 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
|
|
|
|
.start,
|
|
|
|
.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
Text(
|
|
|
|
languageID ==
|
|
|
|
languageID == "ar"
|
|
|
|
"ar"
|
|
|
|
? model.recommendedProductList[index].namen
|
|
|
|
? model.recommendedProductList[index]['namen']
|
|
|
|
: model.recommendedProductList[index].name,
|
|
|
|
: model.recommendedProductList[index]['name'],
|
|
|
|
|
|
|
|
style:
|
|
|
|
style:
|
|
|
|
TextStyle(
|
|
|
|
TextStyle(
|
|
|
|
color:
|
|
|
|
color:
|
|
|
|
@ -853,7 +852,7 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
|
|
|
|
5),
|
|
|
|
5),
|
|
|
|
child:
|
|
|
|
child:
|
|
|
|
Texts(
|
|
|
|
Texts(
|
|
|
|
"SAR ${model.recommendedProductList[index]['price']}",
|
|
|
|
"SAR ${model.recommendedProductList[index].price}",
|
|
|
|
bold:
|
|
|
|
bold:
|
|
|
|
true,
|
|
|
|
true,
|
|
|
|
fontSize:
|
|
|
|
fontSize:
|
|
|
|
@ -879,8 +878,7 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
|
|
|
|
Alignment.topLeft,
|
|
|
|
Alignment.topLeft,
|
|
|
|
child:
|
|
|
|
child:
|
|
|
|
RatingBar.readOnly(
|
|
|
|
RatingBar.readOnly(
|
|
|
|
initialRating:
|
|
|
|
initialRating: model.recommendedProductList[index].approvedRatingSum.toDouble(),
|
|
|
|
model.recommendedProductList[index]['approved_rating_sum'].toDouble(),
|
|
|
|
|
|
|
|
// initialRating: productRate,
|
|
|
|
// initialRating: productRate,
|
|
|
|
size:
|
|
|
|
size:
|
|
|
|
13.0,
|
|
|
|
13.0,
|
|
|
|
@ -900,7 +898,7 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Texts(
|
|
|
|
Texts(
|
|
|
|
"(${model.recommendedProductList[index]['approved_total_reviews'].toString()})",
|
|
|
|
"(${model.recommendedProductList[index].notApprovedTotalReviews.toString()})",
|
|
|
|
// bold: true,
|
|
|
|
// bold: true,
|
|
|
|
fontSize:
|
|
|
|
fontSize:
|
|
|
|
12,
|
|
|
|
12,
|
|
|
|
@ -941,7 +939,7 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
|
|
|
|
widget.product),
|
|
|
|
widget.product),
|
|
|
|
)
|
|
|
|
)
|
|
|
|
: AppScaffold(
|
|
|
|
: AppScaffold(
|
|
|
|
appBarTitle: 'product detail page',
|
|
|
|
appBarTitle: TranslationBase.of(context).productDetails,
|
|
|
|
isShowAppBar: true,
|
|
|
|
isShowAppBar: true,
|
|
|
|
isPharmacy: true,
|
|
|
|
isPharmacy: true,
|
|
|
|
isShowDecPage: false,
|
|
|
|
isShowDecPage: false,
|
|
|
|
@ -1321,7 +1319,8 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
|
|
|
|
: Container(
|
|
|
|
: Container(
|
|
|
|
padding: EdgeInsets.all(15),
|
|
|
|
padding: EdgeInsets.all(15),
|
|
|
|
alignment: Alignment.center,
|
|
|
|
alignment: Alignment.center,
|
|
|
|
child: Text('No Reviews Available'),
|
|
|
|
child: Text(TranslationBase.of(context).noReviewsAvailable),
|
|
|
|
|
|
|
|
// Text('No Reviews Available'),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
)
|
|
|
|
: isAvailabilty
|
|
|
|
: isAvailabilty
|
|
|
|
@ -1938,7 +1937,8 @@ class _productNameAndPriceState extends State<productNameAndPrice> {
|
|
|
|
width: 40,
|
|
|
|
width: 40,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Text(
|
|
|
|
Text(
|
|
|
|
widget.item.stockAvailability,
|
|
|
|
languageID == 'ar'?
|
|
|
|
|
|
|
|
widget.item.stockAvailabilityn : widget.item.stockAvailability ,
|
|
|
|
style: widget.item.stockAvailability == 'Out of stock'
|
|
|
|
style: widget.item.stockAvailability == 'Out of stock'
|
|
|
|
? TextStyle(fontWeight: FontWeight.bold, color: Colors.red)
|
|
|
|
? TextStyle(fontWeight: FontWeight.bold, color: Colors.red)
|
|
|
|
: TextStyle(
|
|
|
|
: TextStyle(
|
|
|
|
@ -2098,9 +2098,9 @@ fixingString(txt) {
|
|
|
|
return newTxt;
|
|
|
|
return newTxt;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
getLanguageID() async {
|
|
|
|
//getLanguageID() async {
|
|
|
|
languageID = await sharedPref.getString(APP_LANGUAGE);
|
|
|
|
// languageID = await sharedPref.getString(APP_LANGUAGE);
|
|
|
|
}
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
getSpecificationData(itemID) async {
|
|
|
|
getSpecificationData(itemID) async {
|
|
|
|
ProductDetailViewModel x = new ProductDetailViewModel();
|
|
|
|
ProductDetailViewModel x = new ProductDetailViewModel();
|
|
|
|
@ -2165,7 +2165,8 @@ settingModalBottomSheet(context) {
|
|
|
|
children: <Widget>[
|
|
|
|
children: <Widget>[
|
|
|
|
new ListTile(
|
|
|
|
new ListTile(
|
|
|
|
leading: Icon(Icons.shopping_cart),
|
|
|
|
leading: Icon(Icons.shopping_cart),
|
|
|
|
title: Text('Add to cart'),
|
|
|
|
title: Text(TranslationBase.of(context)
|
|
|
|
|
|
|
|
.addToCart,),
|
|
|
|
onTap: () => {
|
|
|
|
onTap: () => {
|
|
|
|
if (price > 0)
|
|
|
|
if (price > 0)
|
|
|
|
{addToCartFunction(price, itemID, context)}
|
|
|
|
{addToCartFunction(price, itemID, context)}
|
|
|
|
@ -2177,12 +2178,14 @@ settingModalBottomSheet(context) {
|
|
|
|
}),
|
|
|
|
}),
|
|
|
|
ListTile(
|
|
|
|
ListTile(
|
|
|
|
leading: Icon(Icons.favorite_border),
|
|
|
|
leading: Icon(Icons.favorite_border),
|
|
|
|
title: Text('Add to wishlist'),
|
|
|
|
title: Text(TranslationBase.of(context)
|
|
|
|
|
|
|
|
.addToWishlist,),
|
|
|
|
onTap: () => {addToWishlistFunction(itemID)},
|
|
|
|
onTap: () => {addToWishlistFunction(itemID)},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
ListTile(
|
|
|
|
ListTile(
|
|
|
|
leading: Icon(Icons.compare),
|
|
|
|
leading: Icon(Icons.compare),
|
|
|
|
title: Text('Compare'),
|
|
|
|
title: Text(TranslationBase.of(context)
|
|
|
|
|
|
|
|
.compare,),
|
|
|
|
onTap: () => {
|
|
|
|
onTap: () => {
|
|
|
|
Provider.of<CompareList>(context, listen: false)
|
|
|
|
Provider.of<CompareList>(context, listen: false)
|
|
|
|
.addItem(specificationData),
|
|
|
|
.addItem(specificationData),
|
|
|
|
|