Issue: Updating wrong Existing Cart Item

Actions & Logic

Hi everyone

i have a question.

What I'm trying to do:
I'm building a self-service kiosk app where users can add items to their cart. If the item already exists in the cart, only the quantity should increase instead of adding a duplicate.

How I'm doing it in FlutterFlow:

  1. Filter List โ†’ I filter the App State List (cart) to find an item where name == newItem.name.

  2. Item at Index โ†’ First โ†’ I get the first item from the filtered list and update its quantity.

Problem:
โžก๏ธ Instead of updating the first found item of the filtered list, it always updates the quantity of the second item in the app state list.

Any help would be greatly appreciated.

What have you tried so far?

all types of filtering and conditionals

changing field criteria

debugging

etc

Did you check FlutterFlow's Documentation for this topic?
Yes
2
1 reply