Flutter Android S2E2 : SearchView ListView - Search/Filter

preview_player
Показать описание
Flutter Android SearchView ListView tutorial example. How to search filter a listview using a custom textfield we call a searchview. We will first populate our listview with simple data from a dart list. Then we will use a texteditingcontroller to get notified when as the user types data in the searchview.

We will apply a searchview using the contains() method of the string class.

Let's start.
Рекомендации по теме
Комментарии
Автор

Thank you so much. It worked perfectly :)

nileshsolankiphotography
Автор

Great tutorial! thanks. A correction: "return _createFilteredListView()"; line must place the last line of "Widget _performSearch"

elinevi
Автор

Please make a video for search data from realtime firebase database (not firestore)

PRAMODYADAV-mkow
Автор

What if my list is actually a list of lists that come from a class.

joeydunivan
Автор

Para todos los que no le funciona el código o no se dieron cuenta de lo que falta, tienen que agregar el
onChanged: _HomeState() en _createSearchView(), es decir, de la siguiente manera:
Widget _createSearchView() {
return new Container(
height: 50,
decoration: BoxDecoration(
border: Border.all(width: 1.0)
),
child: new TextField(
controller: _resultados,
decoration: InputDecoration(
hintText: "Buscar",
hintStyle: new TextStyle(color: Colors.grey[300]),

),
onChanged: _HomeState(),
aquí, here
textAlign: TextAlign.center,
),
);
}

felipemansilla
join shbcf.ru