Hello! I'm new to MIT
Im trying to make a shoe shopping app where i can input data and with a press of a button, i can add that data to my cart (which is firebase).
When i add new items to my cart, it creates a new OrderNo. in firebase
Example:
New Items created
So here's my issue. Whenever i try to update items (without deleting anything) In my cart it will be updated both in listview and firebase. However, when i delete an item and then try to update another item, it updates the firebase not based on the OrderNo. but based on which number is the item on the listview.
Example:
New items created
I deleted 1 item which is OrderNo. 2
Here is the updated firebase:
Now i want to update OrderNo.3 and change its price to 700. However when i select the item in ListView, it will read it as OrderNo.2, so when i press the update button it creates a new Item in the database called OrderNo.2 instead of updating OrderNo.3
I need to be able to find a way on how to update and delete both items in my ListView and Firebase based on the OrderNo. and not on the selection on the ListView
here is my blocks:
Im kinda new to MIT so any help would be great. Thanks!