# Chapter 9/ Remove an item from previous searches

**URL:** <https://forums.kodeco.com/t/chapter-9-remove-an-item-from-previous-searches/157377>\
**Category:** Flutter Apprentice\
**Created:** [November 15, 2021, 11:13am UTC](https://forums.kodeco.com/t/chapter-9-remove-an-item-from-previous-searches/157377 "2021-11-15T11:13:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![alilosoft](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/alilosoft/32/99601_2.png) [@alilosoft](https://forums.kodeco.com/u/alilosoft)\
**Post date:** [November 15, 2021, 11:13am UTC](https://forums.kodeco.com/t/chapter-9-remove-an-item-from-previous-searches/157377/1 "2021-11-15T11:13:51Z")

</div>

In Chapter 9 → building the popup menu for previous searches:

In the callback of `CustomDropdownMenuItem` after we remove the item from the `previousSearches` list we didn’t call `savePreviousSearches();` so the removed item will stay in the `shared_prefs`, this seems incorrect for me, do I miss something?

---

<div class="post-metadata">

**Author:** ![alilosoft](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/alilosoft/32/99601_2.png) [@alilosoft](https://forums.kodeco.com/u/alilosoft)\
**Post date:** [November 15, 2021, 8:38pm UTC](https://forums.kodeco.com/t/chapter-9-remove-an-item-from-previous-searches/157377/2 "2021-11-15T20:38:11Z")

</div>

anyone have an idea?

---

<div class="post-metadata">

**Author:** ![rishabajain](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/rishabajain/32/81494_2.png) [@rishabajain](https://forums.kodeco.com/u/rishabajain)\
**Post date:** [January 17, 2022, 1:29pm UTC](https://forums.kodeco.com/t/chapter-9-remove-an-item-from-previous-searches/157377/3 "2022-01-17T13:29:40Z")

</div>

I had the same question. As you mentioned in your question, I added `savePreviousSearches();` in the callback of `CustomDropdownMenuItem` in `_buildSearchCard()` in recipe\_list.dart.  
Now, after I remove an item and stop the app, and when I start it again, the list does not have the removed item.  
Thanks for sharing !
