How to delete item list using pop up menu in flutter?

Posted by Ramesh Singh | Updated on

If you want to delete item list using pop up menu in flutter? Add a callback function to your PopUpMenu class:

Then when creating it in your original class:

General rule of thumb in Flutter is to pass a callback down to children rather than try to access data in a parent.

You may also need to make your StuffInTiles Widget Stateful and add setState(() {}); to your onDelete, as simply removing the value won’t actually update your view with the new list.


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers