Search Bar in Flutter – Logic & Material UI

Reso Coder
Reso Coder
65.3 هزار بار بازدید - 4 سال پیش - 📗 Learn from the written
📗 Learn from the written tutorial 👇👇
https://resocoder.com/flutter-search-bar

📧 Get Flutter news 📰 and resources:
👉 http://flutter.education

👨‍💻 Do you write good code? Find out now!
https://resocoder.com/good-code-quiz

Searching through all kinds of various content in your Flutter app is something you'll likely have to implement one day. A successful search implementation needs basically two things - a usable search history and also the search bar widget. Now, we're going to take a look at the most extensible and good-looking way to do this.

We're going to build a simple project that will contain all of the basic building blocks of a good search implementation. The package that we're going to use for the UI part is called material_floating_search_bar. There are many other packages and even the built-in showSearch function, but the package we're using is one of the best ones out there in terms of customizability and it also looks really good out of the box.

When it comes to the search history part, we're going to keep it simple. We could introduce all kinds of third-party dependencies like different state management packages and all kinds of persistent databases. However, we're going to implement the history only inside a StatefulWidget and as an in-memory List. Yet, as you'll see in a little while, the code will be easily applicable to any state management and database solution you like.

Go to my website for more information, code examples, and articles:
https://resocoder.com

Follow me on social media:
Instagram: resocoder
Facebook: resocoder
Twitter: resocoder
4 سال پیش در تاریخ 1399/11/04 منتشر شده است.
65,399 بـار بازدید شده
... بیشتر