Data[i] in ListView always returning index 0


I have a simple ListView with a button inside the container, which open up a an aside Drawer.
The title of the drawer is set to[i].name, but the title is always set to the name of the first element in the ListView.
I can manually input data[1] and it will show the name of the second item in the ListView.

I have the same problem with confirmation messages for a query, where it is also only getting the first item, regardless of which item I have always clicked on.

So it seems like it could be a wider issue related to ListView.

I hope you can help me, as it really hinders what I can do at the moment.