Hi,
I've been struggling for the past hour trying to create a popup menu at the location of my ListTile item.
I have a ListTile and on longpress() I want to open a popup menu with options to either open it or delete it. I wrote the following within the onLongPressed() of this listTile, but nothing opens.. The popup menu does not show..
What am I doing wrong?
onLongPress: () {
PopupMenuButton<String>(
onSelected: (String value) {
setState(() {
});
},
itemBuilder: (BuildContext context) => <PopupMenuEntry<String>>[
const PopupMenuItem<String>(
value: 'Open',
child: Text('Open'),
),
const PopupMenuItem<String>(
value: 'Delete',
child: Text('Delete'),
),
],
);
},