How to delete item from listview in flutter

Posted by Andre Scott | Updated on

If you want to delete item from listview in flutter. With this solution you’ll still see the view change. If you want to prevent that, you’ll need a new stateful page, and a bit of refactoring:

1. Make your _saved items global (only for this example)
2. Remove the _pushSaved method
3. Update the onPressed function that used to call the _pushSaved function
4. Add the stateful DetailPage instead of the _pushSaved method

Like so:

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

Related Questions & Answers