|
|
|
@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
|
|
|
|
import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart';
|
|
|
|
import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart';
|
|
|
|
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/product_detail_view_model.dart';
|
|
|
|
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/product_detail_view_model.dart';
|
|
|
|
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
|
|
|
|
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
|
|
|
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/login/welcome.dart';
|
|
|
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.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';
|
|
|
|
@ -38,7 +39,7 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
|
|
|
|
dynamic wishlistItems;
|
|
|
|
dynamic wishlistItems;
|
|
|
|
|
|
|
|
|
|
|
|
void initState() {
|
|
|
|
void initState() {
|
|
|
|
price = 0;
|
|
|
|
price = 1;
|
|
|
|
specificationData = widget.product;
|
|
|
|
specificationData = widget.product;
|
|
|
|
setState(() {
|
|
|
|
setState(() {
|
|
|
|
customerId = userInfo(widget.product.id, widget.product);
|
|
|
|
customerId = userInfo(widget.product.id, widget.product);
|
|
|
|
@ -79,18 +80,12 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
|
|
|
|
alignment: Alignment.centerRight,
|
|
|
|
alignment: Alignment.centerRight,
|
|
|
|
child: languageID == 'ar'
|
|
|
|
child: languageID == 'ar'
|
|
|
|
? Text(
|
|
|
|
? Text(
|
|
|
|
widget.product
|
|
|
|
widget.product.discountDescriptionn,
|
|
|
|
.discountDescriptionn,
|
|
|
|
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 17),
|
|
|
|
style: TextStyle(
|
|
|
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
|
|
|
fontSize: 17),
|
|
|
|
|
|
|
|
)
|
|
|
|
)
|
|
|
|
: Text(
|
|
|
|
: Text(
|
|
|
|
widget.product
|
|
|
|
widget.product.discountDescription,
|
|
|
|
.discountDescription,
|
|
|
|
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 17),
|
|
|
|
style: TextStyle(
|
|
|
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
|
|
|
fontSize: 17),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -101,8 +96,7 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
|
|
|
|
flex: 0,
|
|
|
|
flex: 0,
|
|
|
|
child: Container(
|
|
|
|
child: Container(
|
|
|
|
child: Image(
|
|
|
|
child: Image(
|
|
|
|
image: AssetImage(
|
|
|
|
image: AssetImage('assets/images/offer.png'),
|
|
|
|
'assets/images/offer.png'),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -180,9 +174,7 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
child: Text(
|
|
|
|
child: Text(
|
|
|
|
TranslationBase.of(context).details,
|
|
|
|
TranslationBase.of(context).details,
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold),
|
|
|
|
fontSize: 16,
|
|
|
|
|
|
|
|
fontWeight: FontWeight.bold),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
color: Colors.white,
|
|
|
|
color: Colors.white,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -210,9 +202,7 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
child: Text(
|
|
|
|
child: Text(
|
|
|
|
TranslationBase.of(context).reviews,
|
|
|
|
TranslationBase.of(context).reviews,
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold),
|
|
|
|
fontSize: 16,
|
|
|
|
|
|
|
|
fontWeight: FontWeight.bold),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
color: Colors.white,
|
|
|
|
color: Colors.white,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -240,9 +230,7 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
child: Text(
|
|
|
|
child: Text(
|
|
|
|
TranslationBase.of(context).availability,
|
|
|
|
TranslationBase.of(context).availability,
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold),
|
|
|
|
fontSize: 16,
|
|
|
|
|
|
|
|
fontWeight: FontWeight.bold),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
color: Colors.white,
|
|
|
|
color: Colors.white,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -270,10 +258,7 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
child: Text(
|
|
|
|
child: Text(
|
|
|
|
TranslationBase.of(context).description,
|
|
|
|
TranslationBase.of(context).description,
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(fontSize: 17, color: Colors.grey, fontWeight: FontWeight.w600),
|
|
|
|
fontSize: 17,
|
|
|
|
|
|
|
|
color: Colors.grey,
|
|
|
|
|
|
|
|
fontWeight: FontWeight.w600),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
SizedBox(
|
|
|
|
SizedBox(
|
|
|
|
@ -281,12 +266,8 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
child: Text(
|
|
|
|
child: Text(
|
|
|
|
languageID == 'ar'
|
|
|
|
languageID == 'ar' ? widget.product.shortDescriptionn : widget.product.shortDescription ?? "",
|
|
|
|
? widget.product.shortDescriptionn
|
|
|
|
style: TextStyle(fontSize: 16, fontFamily: 'WorkSans-Regular'),
|
|
|
|
: widget.product.shortDescription,
|
|
|
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
|
|
|
fontSize: 16,
|
|
|
|
|
|
|
|
fontFamily: 'WorkSans-Regular'),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
SizedBox(
|
|
|
|
SizedBox(
|
|
|
|
@ -295,10 +276,7 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
child: Text(
|
|
|
|
child: Text(
|
|
|
|
TranslationBase.of(context).howToUse,
|
|
|
|
TranslationBase.of(context).howToUse,
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(fontSize: 17, color: Colors.grey, fontWeight: FontWeight.w600),
|
|
|
|
fontSize: 17,
|
|
|
|
|
|
|
|
color: Colors.grey,
|
|
|
|
|
|
|
|
fontWeight: FontWeight.w600),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
SizedBox(
|
|
|
|
SizedBox(
|
|
|
|
@ -306,12 +284,8 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
child: Text(
|
|
|
|
child: Text(
|
|
|
|
languageID == 'ar'
|
|
|
|
languageID == 'ar' ? widget.product.fullDescriptionn : widget.product.fullDescription,
|
|
|
|
? widget.product.fullDescriptionn
|
|
|
|
style: TextStyle(fontSize: 16, fontFamily: 'WorkSans-Regular'),
|
|
|
|
: widget.product.fullDescription,
|
|
|
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
|
|
|
fontSize: 16,
|
|
|
|
|
|
|
|
fontFamily: 'WorkSans-Regular'),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
@ -319,83 +293,41 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
|
|
|
|
)
|
|
|
|
)
|
|
|
|
: isReviews
|
|
|
|
: isReviews
|
|
|
|
? BaseView<ProductDetailViewModel>(
|
|
|
|
? BaseView<ProductDetailViewModel>(
|
|
|
|
onModelReady: (model) =>
|
|
|
|
onModelReady: (model) => model.getProductReviewsData(widget.product.id),
|
|
|
|
model.getProductReviewsData(
|
|
|
|
builder: (_, model, wi) =>
|
|
|
|
widget.product.id),
|
|
|
|
model.productDetailService.length != 0 && model.productDetailService[0].reviews.length != 0
|
|
|
|
builder: (_, model, wi) => model
|
|
|
|
|
|
|
|
.productDetailService
|
|
|
|
|
|
|
|
.length !=
|
|
|
|
|
|
|
|
0 &&
|
|
|
|
|
|
|
|
model.productDetailService[0]
|
|
|
|
|
|
|
|
.reviews.length !=
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
? ListView.builder(
|
|
|
|
? ListView.builder(
|
|
|
|
physics: ScrollPhysics(),
|
|
|
|
physics: ScrollPhysics(),
|
|
|
|
itemCount: model
|
|
|
|
itemCount: model.productDetailService[0].reviews.length,
|
|
|
|
.productDetailService[0]
|
|
|
|
|
|
|
|
.reviews
|
|
|
|
|
|
|
|
.length,
|
|
|
|
|
|
|
|
scrollDirection: Axis.vertical,
|
|
|
|
scrollDirection: Axis.vertical,
|
|
|
|
shrinkWrap: true,
|
|
|
|
shrinkWrap: true,
|
|
|
|
itemBuilder: (BuildContext context,
|
|
|
|
itemBuilder: (BuildContext context, int index) {
|
|
|
|
int index) {
|
|
|
|
|
|
|
|
return Padding(
|
|
|
|
return Padding(
|
|
|
|
padding: EdgeInsets.all(8.0),
|
|
|
|
padding: EdgeInsets.all(8.0),
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
mainAxisAlignment:
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
MainAxisAlignment.start,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
child: Row(
|
|
|
|
child: Row(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
child: Text(
|
|
|
|
child: Text(
|
|
|
|
model
|
|
|
|
model.productDetailService[0].reviews[index].customerId.toString(),
|
|
|
|
.productDetailService[
|
|
|
|
style: TextStyle(fontSize: 17, color: Colors.grey, fontWeight: FontWeight.w600),
|
|
|
|
0]
|
|
|
|
|
|
|
|
.reviews[
|
|
|
|
|
|
|
|
index]
|
|
|
|
|
|
|
|
.customerId
|
|
|
|
|
|
|
|
.toString(),
|
|
|
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
|
|
|
fontSize: 17,
|
|
|
|
|
|
|
|
color: Colors
|
|
|
|
|
|
|
|
.grey,
|
|
|
|
|
|
|
|
fontWeight:
|
|
|
|
|
|
|
|
FontWeight
|
|
|
|
|
|
|
|
.w600),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
margin:
|
|
|
|
margin: EdgeInsets.only(left: 210),
|
|
|
|
EdgeInsets.only(
|
|
|
|
child: RatingBar.readOnly(
|
|
|
|
left: 210),
|
|
|
|
initialRating: model.productDetailService[0].reviews[index].rating.toDouble(),
|
|
|
|
child: RatingBar
|
|
|
|
|
|
|
|
.readOnly(
|
|
|
|
|
|
|
|
initialRating: model
|
|
|
|
|
|
|
|
.productDetailService[
|
|
|
|
|
|
|
|
0]
|
|
|
|
|
|
|
|
.reviews[
|
|
|
|
|
|
|
|
index]
|
|
|
|
|
|
|
|
.rating
|
|
|
|
|
|
|
|
.toDouble(),
|
|
|
|
|
|
|
|
size: 15.0,
|
|
|
|
size: 15.0,
|
|
|
|
filledColor:
|
|
|
|
filledColor: Colors.yellow[700],
|
|
|
|
Colors.yellow[
|
|
|
|
emptyColor: Colors.grey[500],
|
|
|
|
700],
|
|
|
|
isHalfAllowed: true,
|
|
|
|
emptyColor: Colors
|
|
|
|
halfFilledIcon: Icons.star_half,
|
|
|
|
.grey[500],
|
|
|
|
filledIcon: Icons.star,
|
|
|
|
isHalfAllowed:
|
|
|
|
emptyIcon: Icons.star,
|
|
|
|
true,
|
|
|
|
|
|
|
|
halfFilledIcon:
|
|
|
|
|
|
|
|
Icons
|
|
|
|
|
|
|
|
.star_half,
|
|
|
|
|
|
|
|
filledIcon:
|
|
|
|
|
|
|
|
Icons.star,
|
|
|
|
|
|
|
|
emptyIcon:
|
|
|
|
|
|
|
|
Icons.star,
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
@ -406,21 +338,14 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
child: Text(
|
|
|
|
child: Text(
|
|
|
|
model
|
|
|
|
model.productDetailService[0].reviews[index].reviewText,
|
|
|
|
.productDetailService[
|
|
|
|
style: TextStyle(fontSize: 20),
|
|
|
|
0]
|
|
|
|
|
|
|
|
.reviews[index]
|
|
|
|
|
|
|
|
.reviewText,
|
|
|
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
|
|
|
fontSize: 20),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
SizedBox(
|
|
|
|
SizedBox(
|
|
|
|
height: 50,
|
|
|
|
height: 50,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Divider(
|
|
|
|
Divider(height: 1, color: Colors.grey),
|
|
|
|
height: 1,
|
|
|
|
|
|
|
|
color: Colors.grey),
|
|
|
|
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
@ -434,47 +359,32 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
|
|
|
|
)
|
|
|
|
)
|
|
|
|
: isAvailabilty
|
|
|
|
: isAvailabilty
|
|
|
|
? BaseView<ProductDetailViewModel>(
|
|
|
|
? BaseView<ProductDetailViewModel>(
|
|
|
|
onModelReady: (model) =>
|
|
|
|
onModelReady: (model) => model.getProductLocationData(),
|
|
|
|
model.getProductLocationData(),
|
|
|
|
builder: (_, model, wi) => model.productLocationService.length == 0
|
|
|
|
builder: (_, model, wi) => model
|
|
|
|
|
|
|
|
.productLocationService
|
|
|
|
|
|
|
|
.length ==
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
? Container(
|
|
|
|
? Container(
|
|
|
|
padding: EdgeInsets.all(15),
|
|
|
|
padding: EdgeInsets.all(15),
|
|
|
|
alignment: Alignment.center,
|
|
|
|
alignment: Alignment.center,
|
|
|
|
child: Text(
|
|
|
|
child: Text('No location Available'),
|
|
|
|
'No location Available'),
|
|
|
|
|
|
|
|
)
|
|
|
|
)
|
|
|
|
: ListView.builder(
|
|
|
|
: ListView.builder(
|
|
|
|
physics: ScrollPhysics(),
|
|
|
|
physics: ScrollPhysics(),
|
|
|
|
scrollDirection: Axis.vertical,
|
|
|
|
scrollDirection: Axis.vertical,
|
|
|
|
shrinkWrap: true,
|
|
|
|
shrinkWrap: true,
|
|
|
|
itemCount: model
|
|
|
|
itemCount: model.productLocationService.length,
|
|
|
|
.productLocationService
|
|
|
|
itemBuilder: (BuildContext context, int index) {
|
|
|
|
.length,
|
|
|
|
|
|
|
|
itemBuilder:
|
|
|
|
|
|
|
|
(BuildContext context,
|
|
|
|
|
|
|
|
int index) {
|
|
|
|
|
|
|
|
return Padding(
|
|
|
|
return Padding(
|
|
|
|
padding:
|
|
|
|
padding: EdgeInsets.all(8.0),
|
|
|
|
EdgeInsets.all(8.0),
|
|
|
|
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
// mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
// mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Row(
|
|
|
|
Row(
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
mainAxisAlignment:
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
MainAxisAlignment
|
|
|
|
|
|
|
|
.start,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Expanded(
|
|
|
|
Expanded(
|
|
|
|
flex: 1,
|
|
|
|
flex: 1,
|
|
|
|
child: Image.network(model
|
|
|
|
child: Image.network(model.productLocationService[index].projectImageUrl),
|
|
|
|
.productLocationService[
|
|
|
|
|
|
|
|
index]
|
|
|
|
|
|
|
|
.projectImageUrl),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
SizedBox(
|
|
|
|
SizedBox(
|
|
|
|
width: 10,
|
|
|
|
width: 10,
|
|
|
|
@ -482,48 +392,31 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
|
|
|
|
Expanded(
|
|
|
|
Expanded(
|
|
|
|
flex: 4,
|
|
|
|
flex: 4,
|
|
|
|
child: Text(
|
|
|
|
child: Text(
|
|
|
|
model
|
|
|
|
model.productLocationService[index].locationDescription +
|
|
|
|
.productLocationService[
|
|
|
|
|
|
|
|
index]
|
|
|
|
|
|
|
|
.locationDescription +
|
|
|
|
|
|
|
|
"\n" +
|
|
|
|
"\n" +
|
|
|
|
fixingString(model
|
|
|
|
fixingString(model.productLocationService[0].cityName.toString()),
|
|
|
|
.productLocationService[
|
|
|
|
style: TextStyle(fontSize: 12),
|
|
|
|
0]
|
|
|
|
|
|
|
|
.cityName
|
|
|
|
|
|
|
|
.toString()),
|
|
|
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
|
|
|
fontSize:
|
|
|
|
|
|
|
|
12),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Expanded(
|
|
|
|
Expanded(
|
|
|
|
flex: 1,
|
|
|
|
flex: 1,
|
|
|
|
child: IconButton(
|
|
|
|
child: IconButton(
|
|
|
|
icon: Icon(Icons
|
|
|
|
icon: Icon(Icons.location_on),
|
|
|
|
.location_on),
|
|
|
|
color: Colors.red,
|
|
|
|
color:
|
|
|
|
onPressed: () {},
|
|
|
|
Colors.red,
|
|
|
|
|
|
|
|
onPressed:
|
|
|
|
|
|
|
|
() {},
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Expanded(
|
|
|
|
Expanded(
|
|
|
|
flex: 1,
|
|
|
|
flex: 1,
|
|
|
|
child: IconButton(
|
|
|
|
child: IconButton(
|
|
|
|
icon: Icon(Icons
|
|
|
|
icon: Icon(Icons.phone),
|
|
|
|
.phone),
|
|
|
|
color: Colors.red,
|
|
|
|
color:
|
|
|
|
onPressed: () {},
|
|
|
|
Colors.red,
|
|
|
|
|
|
|
|
onPressed:
|
|
|
|
|
|
|
|
() {},
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Divider(
|
|
|
|
Divider(height: 1.2, color: Colors.grey)
|
|
|
|
height: 1.2,
|
|
|
|
|
|
|
|
color: Colors.grey)
|
|
|
|
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
@ -538,12 +431,8 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
bottomSheet: footerWidget(
|
|
|
|
bottomSheet: footerWidget(widget.product.stockAvailability != 'Out of stock', widget.product.orderMaximumQuantity,
|
|
|
|
widget.product.stockAvailability != 'Out of stock',
|
|
|
|
widget.product.orderMinimumQuantity, widget.product.stockQuantity, widget.product),
|
|
|
|
widget.product.orderMaximumQuantity,
|
|
|
|
|
|
|
|
widget.product.orderMinimumQuantity,
|
|
|
|
|
|
|
|
widget.product.stockQuantity,
|
|
|
|
|
|
|
|
widget.product),
|
|
|
|
|
|
|
|
)
|
|
|
|
)
|
|
|
|
: AppScaffold(
|
|
|
|
: AppScaffold(
|
|
|
|
appBarTitle: 'product detail page',
|
|
|
|
appBarTitle: 'product detail page',
|
|
|
|
@ -576,18 +465,12 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
|
|
|
|
alignment: Alignment.centerRight,
|
|
|
|
alignment: Alignment.centerRight,
|
|
|
|
child: languageID == 'ar'
|
|
|
|
child: languageID == 'ar'
|
|
|
|
? Text(
|
|
|
|
? Text(
|
|
|
|
widget.product
|
|
|
|
widget.product.discountDescriptionn,
|
|
|
|
.discountDescriptionn,
|
|
|
|
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 17),
|
|
|
|
style: TextStyle(
|
|
|
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
|
|
|
fontSize: 17),
|
|
|
|
|
|
|
|
)
|
|
|
|
)
|
|
|
|
: Text(
|
|
|
|
: Text(
|
|
|
|
widget.product
|
|
|
|
widget.product.discountDescription,
|
|
|
|
.discountDescription,
|
|
|
|
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 17),
|
|
|
|
style: TextStyle(
|
|
|
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
|
|
|
fontSize: 17),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -598,8 +481,7 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
|
|
|
|
flex: 0,
|
|
|
|
flex: 0,
|
|
|
|
child: Container(
|
|
|
|
child: Container(
|
|
|
|
child: Image(
|
|
|
|
child: Image(
|
|
|
|
image: AssetImage(
|
|
|
|
image: AssetImage('assets/images/offer.png'),
|
|
|
|
'assets/images/offer.png'),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -669,9 +551,7 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
child: Text(
|
|
|
|
child: Text(
|
|
|
|
TranslationBase.of(context).details,
|
|
|
|
TranslationBase.of(context).details,
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold),
|
|
|
|
fontSize: 16,
|
|
|
|
|
|
|
|
fontWeight: FontWeight.bold),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
color: Colors.white,
|
|
|
|
color: Colors.white,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -699,9 +579,7 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
child: Text(
|
|
|
|
child: Text(
|
|
|
|
TranslationBase.of(context).reviews,
|
|
|
|
TranslationBase.of(context).reviews,
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold),
|
|
|
|
fontSize: 16,
|
|
|
|
|
|
|
|
fontWeight: FontWeight.bold),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
color: Colors.white,
|
|
|
|
color: Colors.white,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -729,9 +607,7 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
child: Text(
|
|
|
|
child: Text(
|
|
|
|
TranslationBase.of(context).availability,
|
|
|
|
TranslationBase.of(context).availability,
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold),
|
|
|
|
fontSize: 16,
|
|
|
|
|
|
|
|
fontWeight: FontWeight.bold),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
color: Colors.white,
|
|
|
|
color: Colors.white,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -759,10 +635,7 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
child: Text(
|
|
|
|
child: Text(
|
|
|
|
TranslationBase.of(context).description,
|
|
|
|
TranslationBase.of(context).description,
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(fontSize: 17, color: Colors.grey, fontWeight: FontWeight.w600),
|
|
|
|
fontSize: 17,
|
|
|
|
|
|
|
|
color: Colors.grey,
|
|
|
|
|
|
|
|
fontWeight: FontWeight.w600),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
SizedBox(
|
|
|
|
SizedBox(
|
|
|
|
@ -770,12 +643,8 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
child: Text(
|
|
|
|
child: Text(
|
|
|
|
languageID == 'ar'
|
|
|
|
languageID == 'ar' ? widget.product.fullDescriptionn : widget.product.fullDescription,
|
|
|
|
? widget.product.fullDescriptionn
|
|
|
|
style: TextStyle(fontSize: 16, fontFamily: 'WorkSans-Regular'),
|
|
|
|
: widget.product.fullDescription,
|
|
|
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
|
|
|
fontSize: 16,
|
|
|
|
|
|
|
|
fontFamily: 'WorkSans-Regular'),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
@ -783,83 +652,41 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
|
|
|
|
)
|
|
|
|
)
|
|
|
|
: isReviews
|
|
|
|
: isReviews
|
|
|
|
? BaseView<ProductDetailViewModel>(
|
|
|
|
? BaseView<ProductDetailViewModel>(
|
|
|
|
onModelReady: (model) =>
|
|
|
|
onModelReady: (model) => model.getProductReviewsData(widget.product.id),
|
|
|
|
model.getProductReviewsData(
|
|
|
|
builder: (_, model, wi) =>
|
|
|
|
widget.product.id),
|
|
|
|
model.productDetailService.length != 0 && model.productDetailService[0].reviews.length != 0
|
|
|
|
builder: (_, model, wi) => model
|
|
|
|
|
|
|
|
.productDetailService
|
|
|
|
|
|
|
|
.length !=
|
|
|
|
|
|
|
|
0 &&
|
|
|
|
|
|
|
|
model.productDetailService[0]
|
|
|
|
|
|
|
|
.reviews.length !=
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
? ListView.builder(
|
|
|
|
? ListView.builder(
|
|
|
|
physics: ScrollPhysics(),
|
|
|
|
physics: ScrollPhysics(),
|
|
|
|
itemCount: model
|
|
|
|
itemCount: model.productDetailService[0].reviews.length,
|
|
|
|
.productDetailService[0]
|
|
|
|
|
|
|
|
.reviews
|
|
|
|
|
|
|
|
.length,
|
|
|
|
|
|
|
|
scrollDirection: Axis.vertical,
|
|
|
|
scrollDirection: Axis.vertical,
|
|
|
|
shrinkWrap: true,
|
|
|
|
shrinkWrap: true,
|
|
|
|
itemBuilder: (BuildContext context,
|
|
|
|
itemBuilder: (BuildContext context, int index) {
|
|
|
|
int index) {
|
|
|
|
|
|
|
|
return Padding(
|
|
|
|
return Padding(
|
|
|
|
padding: EdgeInsets.all(8.0),
|
|
|
|
padding: EdgeInsets.all(8.0),
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
mainAxisAlignment:
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
MainAxisAlignment.start,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
child: Row(
|
|
|
|
child: Row(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
child: Text(
|
|
|
|
child: Text(
|
|
|
|
model
|
|
|
|
model.productDetailService[0].reviews[index].customerId.toString(),
|
|
|
|
.productDetailService[
|
|
|
|
style: TextStyle(fontSize: 17, color: Colors.grey, fontWeight: FontWeight.w600),
|
|
|
|
0]
|
|
|
|
|
|
|
|
.reviews[
|
|
|
|
|
|
|
|
index]
|
|
|
|
|
|
|
|
.customerId
|
|
|
|
|
|
|
|
.toString(),
|
|
|
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
|
|
|
fontSize: 17,
|
|
|
|
|
|
|
|
color: Colors
|
|
|
|
|
|
|
|
.grey,
|
|
|
|
|
|
|
|
fontWeight:
|
|
|
|
|
|
|
|
FontWeight
|
|
|
|
|
|
|
|
.w600),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
margin:
|
|
|
|
margin: EdgeInsets.only(left: 210),
|
|
|
|
EdgeInsets.only(
|
|
|
|
child: RatingBar.readOnly(
|
|
|
|
left: 210),
|
|
|
|
initialRating: model.productDetailService[0].reviews[index].rating.toDouble(),
|
|
|
|
child: RatingBar
|
|
|
|
|
|
|
|
.readOnly(
|
|
|
|
|
|
|
|
initialRating: model
|
|
|
|
|
|
|
|
.productDetailService[
|
|
|
|
|
|
|
|
0]
|
|
|
|
|
|
|
|
.reviews[
|
|
|
|
|
|
|
|
index]
|
|
|
|
|
|
|
|
.rating
|
|
|
|
|
|
|
|
.toDouble(),
|
|
|
|
|
|
|
|
size: 15.0,
|
|
|
|
size: 15.0,
|
|
|
|
filledColor:
|
|
|
|
filledColor: Colors.yellow[700],
|
|
|
|
Colors.yellow[
|
|
|
|
emptyColor: Colors.grey[500],
|
|
|
|
700],
|
|
|
|
isHalfAllowed: true,
|
|
|
|
emptyColor: Colors
|
|
|
|
halfFilledIcon: Icons.star_half,
|
|
|
|
.grey[500],
|
|
|
|
filledIcon: Icons.star,
|
|
|
|
isHalfAllowed:
|
|
|
|
emptyIcon: Icons.star,
|
|
|
|
true,
|
|
|
|
|
|
|
|
halfFilledIcon:
|
|
|
|
|
|
|
|
Icons
|
|
|
|
|
|
|
|
.star_half,
|
|
|
|
|
|
|
|
filledIcon:
|
|
|
|
|
|
|
|
Icons.star,
|
|
|
|
|
|
|
|
emptyIcon:
|
|
|
|
|
|
|
|
Icons.star,
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
@ -870,21 +697,14 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
child: Text(
|
|
|
|
child: Text(
|
|
|
|
model
|
|
|
|
model.productDetailService[0].reviews[index].reviewText,
|
|
|
|
.productDetailService[
|
|
|
|
style: TextStyle(fontSize: 20),
|
|
|
|
0]
|
|
|
|
|
|
|
|
.reviews[index]
|
|
|
|
|
|
|
|
.reviewText,
|
|
|
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
|
|
|
fontSize: 20),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
SizedBox(
|
|
|
|
SizedBox(
|
|
|
|
height: 50,
|
|
|
|
height: 50,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Divider(
|
|
|
|
Divider(height: 1, color: Colors.grey),
|
|
|
|
height: 1,
|
|
|
|
|
|
|
|
color: Colors.grey),
|
|
|
|
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
@ -898,17 +718,13 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
|
|
|
|
)
|
|
|
|
)
|
|
|
|
: isAvailabilty
|
|
|
|
: isAvailabilty
|
|
|
|
? BaseView<ProductDetailViewModel>(
|
|
|
|
? BaseView<ProductDetailViewModel>(
|
|
|
|
onModelReady: (model) =>
|
|
|
|
onModelReady: (model) => model.getProductLocationData(),
|
|
|
|
model.getProductLocationData(),
|
|
|
|
builder: (_, model, wi) => ListView.builder(
|
|
|
|
builder: (_, model, wi) =>
|
|
|
|
|
|
|
|
ListView.builder(
|
|
|
|
|
|
|
|
physics: ScrollPhysics(),
|
|
|
|
physics: ScrollPhysics(),
|
|
|
|
scrollDirection: Axis.vertical,
|
|
|
|
scrollDirection: Axis.vertical,
|
|
|
|
shrinkWrap: true,
|
|
|
|
shrinkWrap: true,
|
|
|
|
itemCount: model
|
|
|
|
itemCount: model.productLocationService.length,
|
|
|
|
.productLocationService.length,
|
|
|
|
itemBuilder: (BuildContext context, int index) {
|
|
|
|
itemBuilder: (BuildContext context,
|
|
|
|
|
|
|
|
int index) {
|
|
|
|
|
|
|
|
return Padding(
|
|
|
|
return Padding(
|
|
|
|
padding: EdgeInsets.all(8.0),
|
|
|
|
padding: EdgeInsets.all(8.0),
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
@ -917,15 +733,11 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Row(
|
|
|
|
Row(
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
mainAxisAlignment:
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
MainAxisAlignment.start,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Expanded(
|
|
|
|
Expanded(
|
|
|
|
flex: 1,
|
|
|
|
flex: 1,
|
|
|
|
child: Image.network(model
|
|
|
|
child: Image.network(model.productLocationService[index].projectImageUrl),
|
|
|
|
.productLocationService[
|
|
|
|
|
|
|
|
index]
|
|
|
|
|
|
|
|
.projectImageUrl),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
SizedBox(
|
|
|
|
SizedBox(
|
|
|
|
width: 10,
|
|
|
|
width: 10,
|
|
|
|
@ -933,25 +745,16 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
|
|
|
|
Expanded(
|
|
|
|
Expanded(
|
|
|
|
flex: 4,
|
|
|
|
flex: 4,
|
|
|
|
child: Text(
|
|
|
|
child: Text(
|
|
|
|
model
|
|
|
|
model.productLocationService[index].locationDescription +
|
|
|
|
.productLocationService[
|
|
|
|
|
|
|
|
index]
|
|
|
|
|
|
|
|
.locationDescription +
|
|
|
|
|
|
|
|
"\n" +
|
|
|
|
"\n" +
|
|
|
|
fixingString(model
|
|
|
|
fixingString(model.productLocationService[0].cityName.toString()),
|
|
|
|
.productLocationService[
|
|
|
|
style: TextStyle(fontSize: 12),
|
|
|
|
0]
|
|
|
|
|
|
|
|
.cityName
|
|
|
|
|
|
|
|
.toString()),
|
|
|
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
|
|
|
fontSize: 12),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Expanded(
|
|
|
|
Expanded(
|
|
|
|
flex: 1,
|
|
|
|
flex: 1,
|
|
|
|
child: IconButton(
|
|
|
|
child: IconButton(
|
|
|
|
icon: Icon(Icons
|
|
|
|
icon: Icon(Icons.location_on),
|
|
|
|
.location_on),
|
|
|
|
|
|
|
|
color: Colors.red,
|
|
|
|
color: Colors.red,
|
|
|
|
onPressed: () {},
|
|
|
|
onPressed: () {},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -959,17 +762,14 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
|
|
|
|
Expanded(
|
|
|
|
Expanded(
|
|
|
|
flex: 1,
|
|
|
|
flex: 1,
|
|
|
|
child: IconButton(
|
|
|
|
child: IconButton(
|
|
|
|
icon:
|
|
|
|
icon: Icon(Icons.phone),
|
|
|
|
Icon(Icons.phone),
|
|
|
|
|
|
|
|
color: Colors.red,
|
|
|
|
color: Colors.red,
|
|
|
|
onPressed: () {},
|
|
|
|
onPressed: () {},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Divider(
|
|
|
|
Divider(height: 1.2, color: Colors.grey)
|
|
|
|
height: 1.2,
|
|
|
|
|
|
|
|
color: Colors.grey)
|
|
|
|
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
@ -984,12 +784,8 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
bottomSheet: footerWidget(
|
|
|
|
bottomSheet: footerWidget(widget.product.stockAvailability != 'Out of stock', widget.product.orderMaximumQuantity,
|
|
|
|
widget.product.stockAvailability != 'Out of stock',
|
|
|
|
widget.product.orderMinimumQuantity, widget.product.stockQuantity, widget.product),
|
|
|
|
widget.product.orderMaximumQuantity,
|
|
|
|
|
|
|
|
widget.product.orderMinimumQuantity,
|
|
|
|
|
|
|
|
widget.product.stockQuantity,
|
|
|
|
|
|
|
|
widget.product),
|
|
|
|
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -1000,8 +796,7 @@ class footerWidget extends StatefulWidget {
|
|
|
|
final int minQuantity;
|
|
|
|
final int minQuantity;
|
|
|
|
final int quantityLimit;
|
|
|
|
final int quantityLimit;
|
|
|
|
final PharmacyProduct item;
|
|
|
|
final PharmacyProduct item;
|
|
|
|
footerWidget(this.isAvailble, this.maxQuantity, this.minQuantity,
|
|
|
|
footerWidget(this.isAvailble, this.maxQuantity, this.minQuantity, this.quantityLimit, this.item);
|
|
|
|
this.quantityLimit, this.item);
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
_footerWidgetState createState() => _footerWidgetState();
|
|
|
|
_footerWidgetState createState() => _footerWidgetState();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -1031,8 +826,7 @@ class _footerWidgetState extends State<footerWidget> {
|
|
|
|
padding: const EdgeInsets.all(8.0),
|
|
|
|
padding: const EdgeInsets.all(8.0),
|
|
|
|
child: Text(
|
|
|
|
child: Text(
|
|
|
|
TranslationBase.of(context).quantity,
|
|
|
|
TranslationBase.of(context).quantity,
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(fontSize: 15, fontWeight: FontWeight.bold),
|
|
|
|
fontSize: 15, fontWeight: FontWeight.bold),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
// ListView(
|
|
|
|
// ListView(
|
|
|
|
@ -1054,9 +848,7 @@ class _footerWidgetState extends State<footerWidget> {
|
|
|
|
color: Colors.white,
|
|
|
|
color: Colors.white,
|
|
|
|
child: Text(
|
|
|
|
child: Text(
|
|
|
|
'1',
|
|
|
|
'1',
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20),
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
|
|
|
fontSize: 20),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
onTap: () {
|
|
|
|
onTap: () {
|
|
|
|
@ -1081,9 +873,7 @@ class _footerWidgetState extends State<footerWidget> {
|
|
|
|
color: Colors.white,
|
|
|
|
color: Colors.white,
|
|
|
|
child: Text(
|
|
|
|
child: Text(
|
|
|
|
'2',
|
|
|
|
'2',
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20),
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
|
|
|
fontSize: 20),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
onTap: () {
|
|
|
|
onTap: () {
|
|
|
|
@ -1108,9 +898,7 @@ class _footerWidgetState extends State<footerWidget> {
|
|
|
|
color: Colors.white,
|
|
|
|
color: Colors.white,
|
|
|
|
child: Text(
|
|
|
|
child: Text(
|
|
|
|
'3',
|
|
|
|
'3',
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20),
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
|
|
|
fontSize: 20),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
onTap: () {
|
|
|
|
onTap: () {
|
|
|
|
@ -1135,9 +923,7 @@ class _footerWidgetState extends State<footerWidget> {
|
|
|
|
color: Colors.white,
|
|
|
|
color: Colors.white,
|
|
|
|
child: Text(
|
|
|
|
child: Text(
|
|
|
|
'4',
|
|
|
|
'4',
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20),
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
|
|
|
fontSize: 20),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
onTap: () {
|
|
|
|
onTap: () {
|
|
|
|
@ -1162,9 +948,7 @@ class _footerWidgetState extends State<footerWidget> {
|
|
|
|
color: Colors.white,
|
|
|
|
color: Colors.white,
|
|
|
|
child: Text(
|
|
|
|
child: Text(
|
|
|
|
'5',
|
|
|
|
'5',
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20),
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
|
|
|
fontSize: 20),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
onTap: () {
|
|
|
|
onTap: () {
|
|
|
|
@ -1189,9 +973,7 @@ class _footerWidgetState extends State<footerWidget> {
|
|
|
|
color: Colors.white,
|
|
|
|
color: Colors.white,
|
|
|
|
child: Text(
|
|
|
|
child: Text(
|
|
|
|
'6',
|
|
|
|
'6',
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20),
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
|
|
|
fontSize: 20),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
onTap: () {
|
|
|
|
onTap: () {
|
|
|
|
@ -1216,9 +998,7 @@ class _footerWidgetState extends State<footerWidget> {
|
|
|
|
color: Colors.white,
|
|
|
|
color: Colors.white,
|
|
|
|
child: Text(
|
|
|
|
child: Text(
|
|
|
|
'7',
|
|
|
|
'7',
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20),
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
|
|
|
fontSize: 20),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
onTap: () {
|
|
|
|
onTap: () {
|
|
|
|
@ -1243,9 +1023,7 @@ class _footerWidgetState extends State<footerWidget> {
|
|
|
|
color: Colors.white,
|
|
|
|
color: Colors.white,
|
|
|
|
child: Text(
|
|
|
|
child: Text(
|
|
|
|
'8',
|
|
|
|
'8',
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20),
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
|
|
|
fontSize: 20),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
onTap: () {
|
|
|
|
onTap: () {
|
|
|
|
@ -1270,9 +1048,7 @@ class _footerWidgetState extends State<footerWidget> {
|
|
|
|
color: Colors.white,
|
|
|
|
color: Colors.white,
|
|
|
|
child: Text(
|
|
|
|
child: Text(
|
|
|
|
'9',
|
|
|
|
'9',
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20),
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
|
|
|
fontSize: 20),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
onTap: () {
|
|
|
|
onTap: () {
|
|
|
|
@ -1297,9 +1073,7 @@ class _footerWidgetState extends State<footerWidget> {
|
|
|
|
color: Colors.white,
|
|
|
|
color: Colors.white,
|
|
|
|
child: Text(
|
|
|
|
child: Text(
|
|
|
|
'10',
|
|
|
|
'10',
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20),
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
|
|
|
fontSize: 20),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
onTap: () {
|
|
|
|
onTap: () {
|
|
|
|
@ -1320,8 +1094,7 @@ class _footerWidgetState extends State<footerWidget> {
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
width: 50.0,
|
|
|
|
width: 50.0,
|
|
|
|
child: TextField(
|
|
|
|
child: TextField(
|
|
|
|
decoration:
|
|
|
|
decoration: InputDecoration(labelText: 'quantity #'),
|
|
|
|
InputDecoration(labelText: 'quantity #'),
|
|
|
|
|
|
|
|
onChanged: (text) {
|
|
|
|
onChanged: (text) {
|
|
|
|
print(price);
|
|
|
|
print(price);
|
|
|
|
print(widget.quantityLimit);
|
|
|
|
print(widget.quantityLimit);
|
|
|
|
@ -1400,10 +1173,7 @@ class _footerWidgetState extends State<footerWidget> {
|
|
|
|
alignment: Alignment.center,
|
|
|
|
alignment: Alignment.center,
|
|
|
|
child: Text(
|
|
|
|
child: Text(
|
|
|
|
TranslationBase.of(context).addToCart,
|
|
|
|
TranslationBase.of(context).addToCart,
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 15),
|
|
|
|
color: Colors.white,
|
|
|
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
|
|
|
fontSize: 15),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
)
|
|
|
|
@ -1418,10 +1188,7 @@ class _footerWidgetState extends State<footerWidget> {
|
|
|
|
color: Colors.green,
|
|
|
|
color: Colors.green,
|
|
|
|
child: Text(
|
|
|
|
child: Text(
|
|
|
|
TranslationBase.of(context).addToCart,
|
|
|
|
TranslationBase.of(context).addToCart,
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 15),
|
|
|
|
color: Colors.white,
|
|
|
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
|
|
|
fontSize: 15),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -1437,10 +1204,7 @@ class _footerWidgetState extends State<footerWidget> {
|
|
|
|
alignment: Alignment.center,
|
|
|
|
alignment: Alignment.center,
|
|
|
|
child: Text(
|
|
|
|
child: Text(
|
|
|
|
TranslationBase.of(context).buyNow,
|
|
|
|
TranslationBase.of(context).buyNow,
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 15),
|
|
|
|
color: Colors.white,
|
|
|
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
|
|
|
fontSize: 15),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
)
|
|
|
|
@ -1450,8 +1214,7 @@ class _footerWidgetState extends State<footerWidget> {
|
|
|
|
addToCartFunction(price, widget.item.id);
|
|
|
|
addToCartFunction(price, widget.item.id);
|
|
|
|
Navigator.push(
|
|
|
|
Navigator.push(
|
|
|
|
context,
|
|
|
|
context,
|
|
|
|
MaterialPageRoute(
|
|
|
|
MaterialPageRoute(builder: (context) => CartOrderPage()),
|
|
|
|
builder: (context) => CartOrderPage()),
|
|
|
|
|
|
|
|
);
|
|
|
|
);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
child: Container(
|
|
|
|
@ -1461,10 +1224,7 @@ class _footerWidgetState extends State<footerWidget> {
|
|
|
|
color: Colors.blue,
|
|
|
|
color: Colors.blue,
|
|
|
|
child: Text(
|
|
|
|
child: Text(
|
|
|
|
TranslationBase.of(context).buyNow,
|
|
|
|
TranslationBase.of(context).buyNow,
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 15),
|
|
|
|
color: Colors.white,
|
|
|
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
|
|
|
fontSize: 15),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -1505,30 +1265,30 @@ class _productNameAndPriceState extends State<productNameAndPrice> {
|
|
|
|
widget.item.stockAvailability,
|
|
|
|
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(fontWeight: FontWeight.bold, color: Colors.green),
|
|
|
|
fontWeight: FontWeight.bold, color: Colors.green),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
SizedBox(width: 20),
|
|
|
|
SizedBox(width: 20),
|
|
|
|
widget.item.stockAvailability == 'Out of stock'
|
|
|
|
widget.item.stockAvailability == 'Out of stock' && customerId != null
|
|
|
|
? Text(
|
|
|
|
? InkWell(
|
|
|
|
|
|
|
|
onTap: () => notifyMeWhenAvailable(context, widget.item.id),
|
|
|
|
|
|
|
|
child: Row(children: [
|
|
|
|
|
|
|
|
Text(
|
|
|
|
TranslationBase.of(context).notifyMe,
|
|
|
|
TranslationBase.of(context).notifyMe,
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
|
color: Colors.blue,
|
|
|
|
color: Colors.blue,
|
|
|
|
decoration: TextDecoration.underline,
|
|
|
|
decoration: TextDecoration.underline,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
),
|
|
|
|
: Container(),
|
|
|
|
SizedBox(width: 4),
|
|
|
|
widget.item.stockAvailability == 'Out of stock'
|
|
|
|
Icon(
|
|
|
|
? Icon(
|
|
|
|
|
|
|
|
FontAwesomeIcons.bell,
|
|
|
|
FontAwesomeIcons.bell,
|
|
|
|
color: Colors.blue,
|
|
|
|
color: Colors.blue,
|
|
|
|
size: 15.0,
|
|
|
|
size: 15.0,
|
|
|
|
)
|
|
|
|
)
|
|
|
|
: Container(),
|
|
|
|
]),
|
|
|
|
Container(
|
|
|
|
)
|
|
|
|
margin: languageID == 'ar'
|
|
|
|
: Container(
|
|
|
|
? EdgeInsets.only(right: 25)
|
|
|
|
margin: languageID == 'ar' ? EdgeInsets.only(right: 25) : EdgeInsets.only(left: 25),
|
|
|
|
: EdgeInsets.only(left: 25),
|
|
|
|
|
|
|
|
width: 40,
|
|
|
|
width: 40,
|
|
|
|
height: 40,
|
|
|
|
height: 40,
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
@ -1564,12 +1324,9 @@ class _productNameAndPriceState extends State<productNameAndPrice> {
|
|
|
|
child: Container(
|
|
|
|
child: Container(
|
|
|
|
margin: EdgeInsets.only(left: 5),
|
|
|
|
margin: EdgeInsets.only(left: 5),
|
|
|
|
child: Align(
|
|
|
|
child: Align(
|
|
|
|
alignment:
|
|
|
|
alignment: languageID == 'ar' ? Alignment.topRight : Alignment.topLeft,
|
|
|
|
languageID == 'ar' ? Alignment.topRight : Alignment.topLeft,
|
|
|
|
|
|
|
|
child: Text(
|
|
|
|
child: Text(
|
|
|
|
languageID == 'ar'
|
|
|
|
languageID == 'ar' ? widget.item.fullDescriptionn : widget.item.fullDescription,
|
|
|
|
? widget.item.fullDescriptionn
|
|
|
|
|
|
|
|
: widget.item.fullDescription,
|
|
|
|
|
|
|
|
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 15),
|
|
|
|
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 15),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -1601,9 +1358,7 @@ class _productNameAndPriceState extends State<productNameAndPrice> {
|
|
|
|
child: Container(
|
|
|
|
child: Container(
|
|
|
|
child: widget.item.rxMessage != null
|
|
|
|
child: widget.item.rxMessage != null
|
|
|
|
? Text(
|
|
|
|
? Text(
|
|
|
|
languageID == 'ar'
|
|
|
|
languageID == 'ar' ? widget.item.rxMessagen.toString() : widget.item.rxMessage.toString(),
|
|
|
|
? widget.item.rxMessagen.toString()
|
|
|
|
|
|
|
|
: widget.item.rxMessage.toString(),
|
|
|
|
|
|
|
|
style: TextStyle(color: Colors.red, fontSize: 10),
|
|
|
|
style: TextStyle(color: Colors.red, fontSize: 10),
|
|
|
|
)
|
|
|
|
)
|
|
|
|
: Container()),
|
|
|
|
: Container()),
|
|
|
|
@ -1769,9 +1524,7 @@ slideDetail() {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
color: Colors.white,
|
|
|
|
color: Colors.white,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
child: const Text('1',
|
|
|
|
child: const Text('1', textAlign: TextAlign.center, style: TextStyle(color: Color(0xFF000000))),
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
|
|
|
style: TextStyle(color: Color(0xFF000000))),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
)
|
|
|
|
],
|
|
|
|
],
|
|
|
|
@ -1801,6 +1554,11 @@ addToCartFunction(quantity, itemID) async {
|
|
|
|
await x.addToCartData(quantity, itemID);
|
|
|
|
await x.addToCartData(quantity, itemID);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
notifyMeWhenAvailable(context, itemId) async {
|
|
|
|
|
|
|
|
ProductDetailViewModel x = new ProductDetailViewModel();
|
|
|
|
|
|
|
|
await x.notifyMe(customerId, itemId);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
addToWishlistFunction(itemID) async {
|
|
|
|
addToWishlistFunction(itemID) async {
|
|
|
|
ProductDetailViewModel x = new ProductDetailViewModel();
|
|
|
|
ProductDetailViewModel x = new ProductDetailViewModel();
|
|
|
|
isInWishlit = true;
|
|
|
|
isInWishlit = true;
|
|
|
|
@ -1848,13 +1606,7 @@ settingModalBottomSheet(context) {
|
|
|
|
leading: new Icon(Icons.shopping_cart),
|
|
|
|
leading: new Icon(Icons.shopping_cart),
|
|
|
|
title: new Text('Add to cart'),
|
|
|
|
title: new Text('Add to cart'),
|
|
|
|
onTap: () => {
|
|
|
|
onTap: () => {
|
|
|
|
if (price > 0)
|
|
|
|
if (price > 0) {addToCartFunction(price, itemID)} else {AppToast.showErrorToast(message: "you should add quantity")}
|
|
|
|
{addToCartFunction(price, itemID)}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
AppToast.showErrorToast(
|
|
|
|
|
|
|
|
message: "you should add quantity")
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}),
|
|
|
|
}),
|
|
|
|
new ListTile(
|
|
|
|
new ListTile(
|
|
|
|
leading: new Icon(Icons.favorite_border),
|
|
|
|
leading: new Icon(Icons.favorite_border),
|
|
|
|
@ -1865,8 +1617,7 @@ settingModalBottomSheet(context) {
|
|
|
|
leading: new Icon(Icons.compare),
|
|
|
|
leading: new Icon(Icons.compare),
|
|
|
|
title: new Text('Compare'),
|
|
|
|
title: new Text('Compare'),
|
|
|
|
onTap: () => {
|
|
|
|
onTap: () => {
|
|
|
|
Provider.of<CompareList>(context, listen: false)
|
|
|
|
Provider.of<CompareList>(context, listen: false).addItem(specificationData),
|
|
|
|
.addItem(specificationData),
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
@ -1875,13 +1626,14 @@ settingModalBottomSheet(context) {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
userInfo(id, product) async {
|
|
|
|
Future userInfo(id, product) async {
|
|
|
|
customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID);
|
|
|
|
customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID);
|
|
|
|
if (customerId != null) {
|
|
|
|
if (customerId != null) {
|
|
|
|
itemID = id;
|
|
|
|
itemID = id;
|
|
|
|
product = product;
|
|
|
|
product = product;
|
|
|
|
checkWishlist();
|
|
|
|
checkWishlist();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
print("customerId:$customerId");
|
|
|
|
return customerId;
|
|
|
|
return customerId;
|
|
|
|
// getSpecificationData(itemID);
|
|
|
|
// getSpecificationData(itemID);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|