unable to update the list of items by text field in a flutter. I am not using APIs or local storage. Only want to dynamically update the data on Screen.

for adding items I used this function on button onpressed function
binLocation.add(BinLocation(binLocation: dropdownValues,quantity: quantity));
and for deleting the item, I am using this line of code during the delete button onpressed in the list
onPressed: ()
{
setState(() {
binLocation.remove(binLocation[index]);
});
},
Modal class
class BinLocation {
final String binLocation; final String quantity;
BinLocation ({this.binLocation,this.quantity});
}
not work? I'v tried it using
flutter demoapp, it worked