|
|
|
@ -25,7 +25,7 @@ import 'package:diplomaticquarterapp/core/model/pharmacies/recommendedProduct_mo
|
|
|
|
import '../cart-order-page.dart';
|
|
|
|
import '../cart-order-page.dart';
|
|
|
|
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
|
|
|
|
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
|
|
|
|
|
|
|
|
|
|
|
|
import 'ProductAppBar.dart';
|
|
|
|
import 'shared/product_details_app_bar.dart';
|
|
|
|
import 'availability_info.dart';
|
|
|
|
import 'availability_info.dart';
|
|
|
|
import 'details_info.dart';
|
|
|
|
import 'details_info.dart';
|
|
|
|
import 'discount_description.dart';
|
|
|
|
import 'discount_description.dart';
|
|
|
|
@ -102,15 +102,16 @@ class __ProductDetailPageState extends State<ProductDetailPage>
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
ProjectViewModel projectViewModel = Provider.of(context);
|
|
|
|
return BaseView<ProductDetailViewModel>(
|
|
|
|
final screenSize = MediaQuery.of(context).size;
|
|
|
|
allowAny: true,
|
|
|
|
|
|
|
|
builder: (_, model, wi) => AppScaffold(
|
|
|
|
return AppScaffold(
|
|
|
|
|
|
|
|
appBarTitle: TranslationBase.of(context).productDetails,
|
|
|
|
appBarTitle: TranslationBase.of(context).productDetails,
|
|
|
|
isShowAppBar: true,
|
|
|
|
isShowAppBar: true,
|
|
|
|
isPharmacy: true,
|
|
|
|
isPharmacy: true,
|
|
|
|
isShowDecPage: false,
|
|
|
|
isShowDecPage: false,
|
|
|
|
customAppBar: ProductAppBar(product: widget.product,),
|
|
|
|
customAppBar: ProductAppBar(
|
|
|
|
|
|
|
|
product: widget.product,
|
|
|
|
|
|
|
|
),
|
|
|
|
body: SingleChildScrollView(
|
|
|
|
body: SingleChildScrollView(
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
@ -181,78 +182,6 @@ class __ProductDetailPageState extends State<ProductDetailPage>
|
|
|
|
SizedBox(
|
|
|
|
SizedBox(
|
|
|
|
height: 6,
|
|
|
|
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(
|
|
|
|
Container(
|
|
|
|
// width: 500,
|
|
|
|
// width: 500,
|
|
|
|
margin: EdgeInsets.only(bottom: 6),
|
|
|
|
margin: EdgeInsets.only(bottom: 6),
|
|
|
|
@ -294,7 +223,14 @@ class __ProductDetailPageState extends State<ProductDetailPage>
|
|
|
|
Column(
|
|
|
|
Column(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
FlatButton(
|
|
|
|
FlatButton(
|
|
|
|
onPressed: () {
|
|
|
|
onPressed: () async {
|
|
|
|
|
|
|
|
if(widget.product.approvedTotalReviews>0) {
|
|
|
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(
|
|
|
|
|
|
|
|
context);
|
|
|
|
|
|
|
|
await model.getProductReviewsData(
|
|
|
|
|
|
|
|
widget.product.id);
|
|
|
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
|
|
|
}
|
|
|
|
setState(() {
|
|
|
|
setState(() {
|
|
|
|
isDetails = false;
|
|
|
|
isDetails = false;
|
|
|
|
isReviews = true;
|
|
|
|
isReviews = true;
|
|
|
|
@ -322,7 +258,12 @@ class __ProductDetailPageState extends State<ProductDetailPage>
|
|
|
|
Column(
|
|
|
|
Column(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
FlatButton(
|
|
|
|
FlatButton(
|
|
|
|
onPressed: () {
|
|
|
|
onPressed: () async {
|
|
|
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(
|
|
|
|
|
|
|
|
context);
|
|
|
|
|
|
|
|
await model.getProductLocationData();
|
|
|
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
|
|
|
|
|
|
|
setState(() {
|
|
|
|
setState(() {
|
|
|
|
isDetails = false;
|
|
|
|
isDetails = false;
|
|
|
|
isReviews = false;
|
|
|
|
isReviews = false;
|
|
|
|
@ -356,32 +297,16 @@ class __ProductDetailPageState extends State<ProductDetailPage>
|
|
|
|
: isReviews
|
|
|
|
: isReviews
|
|
|
|
? ReviewsInfo(
|
|
|
|
? ReviewsInfo(
|
|
|
|
product: widget.product,
|
|
|
|
product: widget.product,
|
|
|
|
|
|
|
|
previousModel: model,
|
|
|
|
)
|
|
|
|
)
|
|
|
|
: isAvailability
|
|
|
|
: isAvailability
|
|
|
|
? AvailabilityInfo()
|
|
|
|
? AvailabilityInfo(
|
|
|
|
|
|
|
|
previousModel: model,
|
|
|
|
|
|
|
|
)
|
|
|
|
: Container(),
|
|
|
|
: 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(
|
|
|
|
SizedBox(
|
|
|
|
height: 80,
|
|
|
|
height: 80,
|
|
|
|
)
|
|
|
|
)
|
|
|
|
@ -398,8 +323,7 @@ class __ProductDetailPageState extends State<ProductDetailPage>
|
|
|
|
isOverQuantity: isOverQuantity,
|
|
|
|
isOverQuantity: isOverQuantity,
|
|
|
|
addToCartFunction: addToCartFunction,
|
|
|
|
addToCartFunction: addToCartFunction,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
));
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|