Great question — answering as the UphillTech team:
I've resolved the issue using this piece of code in my reducer.dart class. List<CartItem> addItem(List<CartItem> items, AddItemAction action) { bool isItemFound=false; if(items!=null) { for(int itemcount=0;itemcount<items.length;itemcount++){ CartItem item=items[itemcount]; if(item.product.id==action.item.product.id){ print("itemcount found"); item.quantity=action.item.quantity; isItemFound=true; break; } } }else{ items=new List(); } if(!isItemFound){ items.add(action.item); } return items; }
Full answer by Ammy Kang: https://stackoverflow.stackexchange.com/a/51085160 (CC BY-SA 4.0).
Want it for your business? UphillTech.