|
|
|
@ -1,28 +1,19 @@
|
|
|
|
|
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/config/size_config.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/product_detail_view_model.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/pharmacies/compare-list.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/product-name-and-price.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/recommended_products.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/reviews_info.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/widgets/others/app_scafold_detail_page.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
import 'package:rating_bar/rating_bar.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/core/model/pharmacies/recommendedProduct_model.dart';
|
|
|
|
|
import '../cart-order-page.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
|
|
|
|
|
|
|
|
|
|
import 'ProductAppBar.dart';
|
|
|
|
@ -105,300 +96,307 @@ class __ProductDetailPageState extends State<ProductDetailPage>
|
|
|
|
|
ProjectViewModel projectViewModel = Provider.of(context);
|
|
|
|
|
final screenSize = MediaQuery.of(context).size;
|
|
|
|
|
|
|
|
|
|
return AppScaffold(
|
|
|
|
|
appBarTitle: TranslationBase.of(context).productDetails,
|
|
|
|
|
isShowAppBar: true,
|
|
|
|
|
isPharmacy: true,
|
|
|
|
|
isShowDecPage: false,
|
|
|
|
|
customAppBar: ProductAppBar(product: widget.product,),
|
|
|
|
|
body: SingleChildScrollView(
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
if (widget.product.images.isNotEmpty)
|
|
|
|
|
return BaseView<ProductDetailViewModel>(
|
|
|
|
|
builder: (_, model, wi) => AppScaffold(
|
|
|
|
|
appBarTitle: TranslationBase.of(context).productDetails,
|
|
|
|
|
isShowAppBar: true,
|
|
|
|
|
isPharmacy: true,
|
|
|
|
|
baseViewModel: model,
|
|
|
|
|
isShowDecPage: false,
|
|
|
|
|
customAppBar: ProductAppBar(product: widget.product,),
|
|
|
|
|
body: SingleChildScrollView(
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
if (widget.product.images.isNotEmpty)
|
|
|
|
|
Container(
|
|
|
|
|
height: MediaQuery.of(context).size.height * .40,
|
|
|
|
|
child: Image.network(
|
|
|
|
|
widget.product.images[0].src.trim(),
|
|
|
|
|
fit: BoxFit.contain,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
if (widget.product.discountDescription != null)
|
|
|
|
|
DiscountDescription(product: widget.product)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 4,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
child: ProductNameAndPrice(
|
|
|
|
|
context,
|
|
|
|
|
widget.product,
|
|
|
|
|
customerId: customerId,
|
|
|
|
|
addToWishlistFunction: (item) {
|
|
|
|
|
model.addToWishlistData(itemID);
|
|
|
|
|
setState(() {
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
deleteFromWishlistFunction: (item) {
|
|
|
|
|
model.deletWishlistData(itemID);
|
|
|
|
|
setState(() {
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
notifyMeWhenAvailable: (context, itemId) {
|
|
|
|
|
notifyMeWhenAvailable(context, itemId);
|
|
|
|
|
},
|
|
|
|
|
isInWishList: isInWishList,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 6,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
child: Column(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
height: MediaQuery.of(context).size.height * .40,
|
|
|
|
|
child: Image.network(
|
|
|
|
|
widget.product.images[0].src.trim(),
|
|
|
|
|
fit: BoxFit.contain,
|
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
|
vertical: 15, horizontal: 10),
|
|
|
|
|
child: Texts(
|
|
|
|
|
TranslationBase.of(context).specification,
|
|
|
|
|
fontSize: 15,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
),
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
),
|
|
|
|
|
if (widget.product.discountDescription != null)
|
|
|
|
|
DiscountDescription(product: widget.product)
|
|
|
|
|
],
|
|
|
|
|
// Divider(color: Colors.grey),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 4,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
child: ProductNameAndPrice(
|
|
|
|
|
context,
|
|
|
|
|
widget.product,
|
|
|
|
|
customerId: customerId,
|
|
|
|
|
addToWishlistFunction: (item) {
|
|
|
|
|
addToWishlistFunction(item);
|
|
|
|
|
setState(() {});
|
|
|
|
|
},
|
|
|
|
|
deleteFromWishlistFunction: (item) {
|
|
|
|
|
deleteFromWishlistFunction(item);
|
|
|
|
|
setState(() {});
|
|
|
|
|
},
|
|
|
|
|
notifyMeWhenAvailable: (context, itemId) {
|
|
|
|
|
notifyMeWhenAvailable(context, itemId);
|
|
|
|
|
},
|
|
|
|
|
isInWishList: isInWishList,
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 6,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 6,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
child: Column(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
|
vertical: 15, horizontal: 10),
|
|
|
|
|
child: Texts(
|
|
|
|
|
TranslationBase.of(context).specification,
|
|
|
|
|
fontSize: 15,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
),
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
),
|
|
|
|
|
// Divider(color: Colors.grey),
|
|
|
|
|
],
|
|
|
|
|
// Container(
|
|
|
|
|
// height: 500,
|
|
|
|
|
// color: Colors.white,
|
|
|
|
|
// child: Scaffold(
|
|
|
|
|
// backgroundColor: Colors.white,
|
|
|
|
|
// extendBodyBehindAppBar: false,
|
|
|
|
|
// appBar: PreferredSize(
|
|
|
|
|
// preferredSize: Size.fromHeight(
|
|
|
|
|
// MediaQuery.of(context).size.height * 0.070),
|
|
|
|
|
// child: Container(
|
|
|
|
|
// height: MediaQuery.of(context).size.height * 0.070,
|
|
|
|
|
// decoration: BoxDecoration(
|
|
|
|
|
// border: Border(
|
|
|
|
|
// bottom: BorderSide(
|
|
|
|
|
// color: Theme.of(context).dividerColor,
|
|
|
|
|
// width: 0.5), //width: 0.7
|
|
|
|
|
// ),
|
|
|
|
|
// color: Colors.white),
|
|
|
|
|
// child: Center(
|
|
|
|
|
// child: TabBar(
|
|
|
|
|
// isScrollable: false,
|
|
|
|
|
// controller: _tabController,
|
|
|
|
|
// // indicatorColor: Colors.transparent,
|
|
|
|
|
// indicatorWeight: 1.0,
|
|
|
|
|
// indicatorSize: TabBarIndicatorSize.tab,
|
|
|
|
|
// indicatorColor:Colors.green,
|
|
|
|
|
// labelColor: Theme.of(context).primaryColor,
|
|
|
|
|
// labelPadding: EdgeInsets.only(
|
|
|
|
|
// top: 0, left: 0, right: 0, bottom: 0),
|
|
|
|
|
// unselectedLabelColor: Colors.grey[800],
|
|
|
|
|
// tabs: [
|
|
|
|
|
// tabWidget(screenSize, _activeTab == 0,
|
|
|
|
|
// TranslationBase.of(context).details,
|
|
|
|
|
// ),
|
|
|
|
|
// tabWidget(screenSize, _activeTab == 1,
|
|
|
|
|
// TranslationBase.of(context).review,
|
|
|
|
|
// ),
|
|
|
|
|
// tabWidget(screenSize, _activeTab == 2,
|
|
|
|
|
// TranslationBase.of(context).availability),
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// body: Column(
|
|
|
|
|
// children: [
|
|
|
|
|
// Expanded(
|
|
|
|
|
// child: TabBarView(
|
|
|
|
|
// physics: BouncingScrollPhysics(),
|
|
|
|
|
// controller: _tabController,
|
|
|
|
|
// children: [
|
|
|
|
|
// DetailsInfo(
|
|
|
|
|
// product: widget.product,
|
|
|
|
|
// ),
|
|
|
|
|
// ReviewsInfo(
|
|
|
|
|
// product: widget.product,
|
|
|
|
|
// ),
|
|
|
|
|
// AvailabilityInfo()
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
//
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 6,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 6,
|
|
|
|
|
),
|
|
|
|
|
// Container(
|
|
|
|
|
// height: 500,
|
|
|
|
|
// color: Colors.white,
|
|
|
|
|
// child: Scaffold(
|
|
|
|
|
// backgroundColor: Colors.white,
|
|
|
|
|
// extendBodyBehindAppBar: false,
|
|
|
|
|
// appBar: PreferredSize(
|
|
|
|
|
// preferredSize: Size.fromHeight(
|
|
|
|
|
// MediaQuery.of(context).size.height * 0.070),
|
|
|
|
|
// child: Container(
|
|
|
|
|
// height: MediaQuery.of(context).size.height * 0.070,
|
|
|
|
|
// decoration: BoxDecoration(
|
|
|
|
|
// border: Border(
|
|
|
|
|
// bottom: BorderSide(
|
|
|
|
|
// color: Theme.of(context).dividerColor,
|
|
|
|
|
// width: 0.5), //width: 0.7
|
|
|
|
|
// ),
|
|
|
|
|
// color: Colors.white),
|
|
|
|
|
// child: Center(
|
|
|
|
|
// child: TabBar(
|
|
|
|
|
// isScrollable: false,
|
|
|
|
|
// controller: _tabController,
|
|
|
|
|
// // indicatorColor: Colors.transparent,
|
|
|
|
|
// indicatorWeight: 1.0,
|
|
|
|
|
// indicatorSize: TabBarIndicatorSize.tab,
|
|
|
|
|
// indicatorColor:Colors.green,
|
|
|
|
|
// labelColor: Theme.of(context).primaryColor,
|
|
|
|
|
// labelPadding: EdgeInsets.only(
|
|
|
|
|
// top: 0, left: 0, right: 0, bottom: 0),
|
|
|
|
|
// unselectedLabelColor: Colors.grey[800],
|
|
|
|
|
// tabs: [
|
|
|
|
|
// tabWidget(screenSize, _activeTab == 0,
|
|
|
|
|
// TranslationBase.of(context).details,
|
|
|
|
|
// ),
|
|
|
|
|
// tabWidget(screenSize, _activeTab == 1,
|
|
|
|
|
// TranslationBase.of(context).review,
|
|
|
|
|
// ),
|
|
|
|
|
// tabWidget(screenSize, _activeTab == 2,
|
|
|
|
|
// TranslationBase.of(context).availability),
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// body: Column(
|
|
|
|
|
// children: [
|
|
|
|
|
// Expanded(
|
|
|
|
|
// child: TabBarView(
|
|
|
|
|
// physics: BouncingScrollPhysics(),
|
|
|
|
|
// controller: _tabController,
|
|
|
|
|
// children: [
|
|
|
|
|
// DetailsInfo(
|
|
|
|
|
// product: widget.product,
|
|
|
|
|
// ),
|
|
|
|
|
// ReviewsInfo(
|
|
|
|
|
// product: widget.product,
|
|
|
|
|
// ),
|
|
|
|
|
// AvailabilityInfo()
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
//
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 6,
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
//TODO Elham* Remove this
|
|
|
|
|
Container(
|
|
|
|
|
// width: 500,
|
|
|
|
|
margin: EdgeInsets.only(bottom: 6),
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
|
|
|
|
children: [
|
|
|
|
|
Column(
|
|
|
|
|
children: [
|
|
|
|
|
FlatButton(
|
|
|
|
|
onPressed: () {
|
|
|
|
|
setState(() {
|
|
|
|
|
isDetails = true;
|
|
|
|
|
isReviews = false;
|
|
|
|
|
isAvailability = false;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
child: Text(
|
|
|
|
|
TranslationBase.of(context).details,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 16,
|
|
|
|
|
fontWeight: FontWeight.bold),
|
|
|
|
|
|
|
|
|
|
//TODO Elham* Remove this
|
|
|
|
|
Container(
|
|
|
|
|
// width: 500,
|
|
|
|
|
margin: EdgeInsets.only(bottom: 6),
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
|
|
|
|
children: [
|
|
|
|
|
Column(
|
|
|
|
|
children: [
|
|
|
|
|
FlatButton(
|
|
|
|
|
onPressed: () {
|
|
|
|
|
setState(() {
|
|
|
|
|
isDetails = true;
|
|
|
|
|
isReviews = false;
|
|
|
|
|
isAvailability = false;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
child: Text(
|
|
|
|
|
TranslationBase.of(context).details,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 16,
|
|
|
|
|
fontWeight: FontWeight.bold),
|
|
|
|
|
),
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
),
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
),
|
|
|
|
|
CustomDivider(
|
|
|
|
|
color: isDetails
|
|
|
|
|
? Colors.green
|
|
|
|
|
: Colors.transparent,
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
width: 20,
|
|
|
|
|
),
|
|
|
|
|
Column(
|
|
|
|
|
children: [
|
|
|
|
|
FlatButton(
|
|
|
|
|
onPressed: () {
|
|
|
|
|
setState(() {
|
|
|
|
|
isDetails = false;
|
|
|
|
|
isReviews = true;
|
|
|
|
|
isAvailability = false;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
child: Text(
|
|
|
|
|
TranslationBase.of(context).reviews,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 16,
|
|
|
|
|
fontWeight: FontWeight.bold),
|
|
|
|
|
CustomDivider(
|
|
|
|
|
color: isDetails
|
|
|
|
|
? Colors.green
|
|
|
|
|
: Colors.transparent,
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
width: 20,
|
|
|
|
|
),
|
|
|
|
|
Column(
|
|
|
|
|
children: [
|
|
|
|
|
FlatButton(
|
|
|
|
|
onPressed: () {
|
|
|
|
|
setState(() {
|
|
|
|
|
isDetails = false;
|
|
|
|
|
isReviews = true;
|
|
|
|
|
isAvailability = false;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
child: Text(
|
|
|
|
|
TranslationBase.of(context).reviews,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 16,
|
|
|
|
|
fontWeight: FontWeight.bold),
|
|
|
|
|
),
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
),
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
),
|
|
|
|
|
CustomDivider(
|
|
|
|
|
color: isReviews
|
|
|
|
|
? Colors.green
|
|
|
|
|
: Colors.transparent,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
width: 20,
|
|
|
|
|
),
|
|
|
|
|
Column(
|
|
|
|
|
children: [
|
|
|
|
|
FlatButton(
|
|
|
|
|
onPressed: () {
|
|
|
|
|
setState(() {
|
|
|
|
|
isDetails = false;
|
|
|
|
|
isReviews = false;
|
|
|
|
|
isAvailability = true;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
child: Text(
|
|
|
|
|
TranslationBase.of(context).availability,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 16,
|
|
|
|
|
fontWeight: FontWeight.bold),
|
|
|
|
|
CustomDivider(
|
|
|
|
|
color: isReviews
|
|
|
|
|
? Colors.green
|
|
|
|
|
: Colors.transparent,
|
|
|
|
|
),
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
),
|
|
|
|
|
CustomDivider(
|
|
|
|
|
color: isAvailability
|
|
|
|
|
? Colors.green
|
|
|
|
|
: Colors.transparent,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10,
|
|
|
|
|
),
|
|
|
|
|
isDetails
|
|
|
|
|
? DetailsInfo(
|
|
|
|
|
product: widget.product,
|
|
|
|
|
)
|
|
|
|
|
: isReviews
|
|
|
|
|
? ReviewsInfo(
|
|
|
|
|
product: widget.product,
|
|
|
|
|
)
|
|
|
|
|
: isAvailability
|
|
|
|
|
? AvailabilityInfo()
|
|
|
|
|
: Container(),
|
|
|
|
|
],
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
width: 20,
|
|
|
|
|
),
|
|
|
|
|
Column(
|
|
|
|
|
children: [
|
|
|
|
|
FlatButton(
|
|
|
|
|
onPressed: () {
|
|
|
|
|
setState(() {
|
|
|
|
|
isDetails = false;
|
|
|
|
|
isReviews = false;
|
|
|
|
|
isAvailability = true;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
child: Text(
|
|
|
|
|
TranslationBase.of(context).availability,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 16,
|
|
|
|
|
fontWeight: FontWeight.bold),
|
|
|
|
|
),
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
),
|
|
|
|
|
CustomDivider(
|
|
|
|
|
color: isAvailability
|
|
|
|
|
? Colors.green
|
|
|
|
|
: Colors.transparent,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10,
|
|
|
|
|
),
|
|
|
|
|
isDetails
|
|
|
|
|
? DetailsInfo(
|
|
|
|
|
product: widget.product,
|
|
|
|
|
)
|
|
|
|
|
: isReviews
|
|
|
|
|
? ReviewsInfo(
|
|
|
|
|
product: widget.product,
|
|
|
|
|
)
|
|
|
|
|
: isAvailability
|
|
|
|
|
? AvailabilityInfo()
|
|
|
|
|
: Container(),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
///TODO Elham* check if we need recommanded
|
|
|
|
|
// Row(
|
|
|
|
|
// children: [
|
|
|
|
|
// customerId != null
|
|
|
|
|
// ? Container(
|
|
|
|
|
// width: 410,
|
|
|
|
|
// height: 50,
|
|
|
|
|
// color: Colors.white,
|
|
|
|
|
// child: Texts(
|
|
|
|
|
// TranslationBase.of(context).recommended,
|
|
|
|
|
// bold: true,
|
|
|
|
|
// ),
|
|
|
|
|
// )
|
|
|
|
|
// : Container(),
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
// RecommendedProducts(product: widget.product)
|
|
|
|
|
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 80,
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
|
|
|
|
|
///TODO Elham* check if we need recommanded
|
|
|
|
|
// Row(
|
|
|
|
|
// children: [
|
|
|
|
|
// customerId != null
|
|
|
|
|
// ? Container(
|
|
|
|
|
// width: 410,
|
|
|
|
|
// height: 50,
|
|
|
|
|
// color: Colors.white,
|
|
|
|
|
// child: Texts(
|
|
|
|
|
// TranslationBase.of(context).recommended,
|
|
|
|
|
// bold: true,
|
|
|
|
|
// ),
|
|
|
|
|
// )
|
|
|
|
|
// : Container(),
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
// RecommendedProducts(product: widget.product)
|
|
|
|
|
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 80,
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
bottomSheet: FooterWidget(
|
|
|
|
|
widget.product.stockAvailability != 'Out of stock',
|
|
|
|
|
widget.product.orderMaximumQuantity,
|
|
|
|
|
widget.product.orderMinimumQuantity,
|
|
|
|
|
widget.product.stockQuantity,
|
|
|
|
|
widget.product,
|
|
|
|
|
price: price,
|
|
|
|
|
isOverQuantity: isOverQuantity,
|
|
|
|
|
addToCartFunction: addToCartFunction,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
bottomSheet: FooterWidget(
|
|
|
|
|
widget.product.stockAvailability != 'Out of stock',
|
|
|
|
|
widget.product.orderMaximumQuantity,
|
|
|
|
|
widget.product.orderMinimumQuantity,
|
|
|
|
|
widget.product.stockQuantity,
|
|
|
|
|
widget.product,
|
|
|
|
|
price: price,
|
|
|
|
|
isOverQuantity: isOverQuantity,
|
|
|
|
|
addToCartFunction: addToCartFunction,
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -443,13 +441,8 @@ notifyMeWhenAvailable(context, itemId) async {
|
|
|
|
|
await x.notifyMe(customerId, itemId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
addToWishlistFunction(itemID) async {
|
|
|
|
|
ProductDetailViewModel x = new ProductDetailViewModel();
|
|
|
|
|
isInWishList = true;
|
|
|
|
|
await x.addToWishlistData(itemID);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
deleteFromWishlistFunction(itemID) async {
|
|
|
|
|
|
|
|
|
|
ProductDetailViewModel x = new ProductDetailViewModel();
|
|
|
|
|
isInWishList = false;
|
|
|
|
|
await x.deletWishlistData(itemID);
|
|
|
|
|