Alert dialog pop not closing. In previously this code is worked as now its not working? when i clicked the cancel or confirm button background navigation is worked but alert cannot close foreground what cause the problem?
Dialogs.materialDialog(
msg: 'Delete cart item ?',
title: "Mojarto",
color: Colors.white,
barrierDismissible: true,
context: context,
actions: [
IconsOutlineButton(
onPressed: () {
Navigator.of(context).pop();
},
text: 'Cancel',
textStyle: TextStyle(color: Colors.grey),
iconColor: Colors.grey,
),
IconsButton(
onPressed: () {
Navigator.of(context)
.pop();
_apiResponse
.removeCart(
getCartViewModel[
index]
.id
.toString())
.then((value) {
if (value) {
Navigator.pop(context);
clearAllFilters();
Navigator.push(context,
PageTransition( type: PageTransitionType.fade,
child: CartPage(widget.lotno),
));
}
});
},
text: "Delete",
color: Colors.red,
textStyle: TextStyle(
color:
Colors.white),
iconColor: Colors.white,
),
]
);