Issue with listview scrolling

Hello community.

I'm using a ListView attached to a list of a custom data type to display a user's shopping list. The list is fed by calls to an external API and changes to it are correctly reflected in the ListView.

In the code that calls the API to insert new items, I included an action to scroll to the end of the ListView, so the user can always see the last added item; however, the action executes "until the next added product": that is, when the list is larger than the visible portion of the widget and a new item is added, the scroll action moves the list to the second to last item, not the last one. Each time more products are added, this behavior is maintained. It is as if the ListView was not notified that its list has one more element and scrolls to the previous last element.

Does anyone know how I can fix this problem?

PS. This issue is happening both in FlutterFlow test mode and on an Android device.

2
1 reply