|
|
|
|
@ -93,44 +93,37 @@ class _CartOrderPageState extends State<CartOrderPage> {
|
|
|
|
|
Container(
|
|
|
|
|
child: ListView.builder(
|
|
|
|
|
itemCount:
|
|
|
|
|
model.cartResponse.shoppingCarts.length,
|
|
|
|
|
model.cartResponse.shoppingCarts.length,
|
|
|
|
|
scrollDirection: Axis.vertical,
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
physics: const AlwaysScrollableScrollPhysics (),
|
|
|
|
|
physics: const AlwaysScrollableScrollPhysics(),
|
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
|
return ProductOrderItem(
|
|
|
|
|
item:model.cartResponse
|
|
|
|
|
.shoppingCarts[index],
|
|
|
|
|
changeCartItems:() async {
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(
|
|
|
|
|
context);
|
|
|
|
|
item: model.cartResponse.shoppingCarts[index],
|
|
|
|
|
changeCartItems: () async {
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
await model.changeProductQuantity(model
|
|
|
|
|
.cartResponse.shoppingCarts[index]);
|
|
|
|
|
if (model.state != ViewState.Error) {
|
|
|
|
|
}
|
|
|
|
|
if (model.state ==
|
|
|
|
|
ViewState.ErrorLocal) {
|
|
|
|
|
if (model.state != ViewState.Error) {}
|
|
|
|
|
if (model.state == ViewState.ErrorLocal) {
|
|
|
|
|
Utils.showErrorToast(model.error);
|
|
|
|
|
}
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(
|
|
|
|
|
context);
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
deleteCartItems:() async {
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(
|
|
|
|
|
context);
|
|
|
|
|
deleteCartItems: () async {
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
await model
|
|
|
|
|
.deleteProduct(model.cartResponse
|
|
|
|
|
.shoppingCarts[index])
|
|
|
|
|
.deleteProduct(model
|
|
|
|
|
.cartResponse.shoppingCarts[index])
|
|
|
|
|
.then((value) {
|
|
|
|
|
if (model.state ==
|
|
|
|
|
ViewState.ErrorLocal) {
|
|
|
|
|
if (model.state == ViewState.ErrorLocal) {
|
|
|
|
|
Utils.showErrorToast(model.error);
|
|
|
|
|
}
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(
|
|
|
|
|
context);
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
});
|
|
|
|
|
},model: model,);
|
|
|
|
|
},
|
|
|
|
|
model: model,
|
|
|
|
|
);
|
|
|
|
|
}),
|
|
|
|
|
),
|
|
|
|
|
const Divider(
|
|
|
|
|
@ -290,8 +283,9 @@ class _OrderBottomWidgetState extends State<OrderBottomWidget> {
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
ProjectViewModel projectProvider = Provider.of(context);
|
|
|
|
|
|
|
|
|
|
return ! widget.isLoading && !(widget.model.cartResponse.shoppingCarts == null ||
|
|
|
|
|
widget.model.cartResponse.shoppingCarts.length == 0)
|
|
|
|
|
return !widget.isLoading &&
|
|
|
|
|
!(widget.model.cartResponse.shoppingCarts == null ||
|
|
|
|
|
widget.model.cartResponse.shoppingCarts.length == 0)
|
|
|
|
|
? Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
|