In flutter_typehead TypeAheadField widget, how do I customize the message letting user know there is no matching item found?


I am trying to use this module to make a text field with autocomplete/"type ahead" functionality.

When the user searches an item in the text field form and the item is not found, there is a ‘No Item Found’ message returned. How do I customize this message for localization purposes?


The TypeAheadFormField provides a callback which can be used to customize the message "No Item Found". I did not see this in the doc but its available. The callback is: noItemsFoundBuilder .

Here a sample code for using this callback:

          textFieldConfiguration: TextFieldConfiguration(
          itemBuilder: (context, suggestion) {
            return ListTile(
              title: Text(''),
          noItemsFoundBuilder: (value) {
            var localizedMessage = "Parlez-vous Fran├žais!";
            return Text(localizedMessage);
          }, )

Answered By – Keita

Answer Checked By – Gilberto Lyons (FlutterFixes Admin)

Leave a Reply

Your email address will not be published. Required fields are marked *