|
|
|
@ -1,4 +1,5 @@
|
|
|
|
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
|
|
|
|
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
|
|
|
|
|
|
|
|
import 'package:diplomaticquarterapp/core/enum/viewstate.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';
|
|
|
|
@ -11,6 +12,7 @@ import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
|
|
|
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
|
|
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
|
|
|
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
|
|
|
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
|
|
|
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
|
|
|
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
|
|
|
|
|
|
|
import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
|
|
|
|
import 'availability_info.dart';
|
|
|
|
import 'availability_info.dart';
|
|
|
|
@ -87,8 +89,8 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return BaseView<ProductDetailViewModel>(
|
|
|
|
return BaseView<ProductDetailViewModel>(
|
|
|
|
allowAny: true,
|
|
|
|
allowAny: true,
|
|
|
|
onModelReady: (model) {
|
|
|
|
onModelReady: (model) async {
|
|
|
|
model.getProductReviewsData(widget.product.id);
|
|
|
|
await model.getProductReviewsData(widget.product.id).then((value) {});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
builder: (_, model, wi) => AppScaffold(
|
|
|
|
builder: (_, model, wi) => AppScaffold(
|
|
|
|
appBarTitle: TranslationBase.of(context).productDetails,
|
|
|
|
appBarTitle: TranslationBase.of(context).productDetails,
|
|
|
|
@ -108,7 +110,8 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
|
|
|
|
isInWishList: isInWishList,
|
|
|
|
isInWishList: isInWishList,
|
|
|
|
addToCartFunction: addToCartFunction,
|
|
|
|
addToCartFunction: addToCartFunction,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
body: SingleChildScrollView(
|
|
|
|
body: model.state == ViewState.Idle
|
|
|
|
|
|
|
|
? SingleChildScrollView(
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
@ -304,8 +307,10 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
|
|
|
|
)
|
|
|
|
)
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
bottomSheet: FooterWidget(
|
|
|
|
: AppCircularProgressIndicator(),
|
|
|
|
|
|
|
|
bottomSheet: model.state == ViewState.Idle
|
|
|
|
|
|
|
|
? FooterWidget(
|
|
|
|
model.isStockAvailable,
|
|
|
|
model.isStockAvailable,
|
|
|
|
widget.product.orderMaximumQuantity,
|
|
|
|
widget.product.orderMaximumQuantity,
|
|
|
|
widget.product.orderMinimumQuantity,
|
|
|
|
widget.product.orderMinimumQuantity,
|
|
|
|
@ -316,7 +321,8 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
|
|
|
|
addToCartFunction: addToCartFunction,
|
|
|
|
addToCartFunction: addToCartFunction,
|
|
|
|
addToShoppingCartFunction: addToShoppingCartFunction,
|
|
|
|
addToShoppingCartFunction: addToShoppingCartFunction,
|
|
|
|
model: model,
|
|
|
|
model: model,
|
|
|
|
),
|
|
|
|
)
|
|
|
|
|
|
|
|
: SizedBox(),
|
|
|
|
));
|
|
|
|
));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|