|
|
|
|
@ -1,3 +1,4 @@
|
|
|
|
|
import 'package:diplomaticquarterapp/config/config.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart';
|
|
|
|
|
@ -5,7 +6,6 @@ import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/product_deta
|
|
|
|
|
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/base/base_view.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/pages/pharmacies/screens/product-details/shared/custom-divider.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
|
|
|
|
|
@ -252,17 +252,19 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
|
|
|
|
|
Column(
|
|
|
|
|
children: [
|
|
|
|
|
FlatButton(
|
|
|
|
|
onPressed: () async {
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
await model.getProductLocationData(widget.product.sku);
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
onPressed: model.isStockAvailable
|
|
|
|
|
? () async {
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
await model.getProductLocationData(widget.product.sku);
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
//
|
|
|
|
|
setState(() {
|
|
|
|
|
isDetails = false;
|
|
|
|
|
isReviews = false;
|
|
|
|
|
isAvailability = true;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
setState(() {
|
|
|
|
|
isDetails = false;
|
|
|
|
|
isReviews = false;
|
|
|
|
|
isAvailability = true;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
: null,
|
|
|
|
|
child: Text(
|
|
|
|
|
TranslationBase.of(context).availability,
|
|
|
|
|
style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold),
|
|
|
|
|
@ -289,20 +291,18 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
|
|
|
|
|
previousModel: model,
|
|
|
|
|
)
|
|
|
|
|
: isAvailability && widget.product.stockAvailability != "Out of stock"
|
|
|
|
|
? AvailabilityInfo(
|
|
|
|
|
previousModel: model
|
|
|
|
|
)
|
|
|
|
|
? AvailabilityInfo(previousModel: model)
|
|
|
|
|
: isAvailability && widget.product.stockAvailability == "Out of stock"
|
|
|
|
|
? Container(
|
|
|
|
|
// padding: EdgeInsets.all(15),
|
|
|
|
|
padding: EdgeInsets.fromLTRB(15,15,15,20),
|
|
|
|
|
margin: EdgeInsets.only(bottom: 20),
|
|
|
|
|
alignment: Alignment.center,
|
|
|
|
|
child: Text(
|
|
|
|
|
TranslationBase.of(context).noLocationAvailable,
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
: Container(),
|
|
|
|
|
? Container(
|
|
|
|
|
// padding: EdgeInsets.all(15),
|
|
|
|
|
padding: EdgeInsets.fromLTRB(15, 15, 15, 20),
|
|
|
|
|
margin: EdgeInsets.only(bottom: 20),
|
|
|
|
|
alignment: Alignment.center,
|
|
|
|
|
child: Text(
|
|
|
|
|
TranslationBase.of(context).noLocationAvailable,
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
: Container(),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
@ -369,8 +369,9 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
|
|
|
|
|
await model.addToCartData(quantity, itemID, context);
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
notifyMeWhenAvailable({itemId, customerId, ProductDetailViewModel model, }) async {
|
|
|
|
|
await model.notifyMe(customerId, itemId, );
|
|
|
|
|
notifyMeWhenAvailable({itemId, customerId, ProductDetailViewModel model}) async {
|
|
|
|
|
await model.notifyMe(customerId, itemId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|