flutter_typeahead icon indicating copy to clipboard operation
flutter_typeahead copied to clipboard

SuggestionsCallback starts by itself when TypeAheadField is focused.

Open kokikudo opened this issue 2 years ago • 4 comments

SuggestionsCallback call by itself when TypeAheadField is focused.

TypeAheadField(
              textFieldConfiguration: TextFieldConfiguration(
                  style: DefaultTextStyle.of(context).style.copyWith(
                      fontStyle: FontStyle.italic
                  ),
                  decoration: InputDecoration(
                      border: OutlineInputBorder()
                  ),
              ),
              suggestionsCallback: (pattern)  {
                print(pattern);
                return [Text('suggest')];
              },
              itemBuilder: (context, suggestion) {
                return ListTile(
                  leading: Icon(Icons.shopping_cart),
                  title: suggestion as Text,
                );
              }, onSuggestionSelected: (Text suggestion) {},
            )

画面収録-2021-10-24-9 39 05

kokikudo avatar Oct 24 '21 00:10 kokikudo

Any workaround ?.

gustav3d avatar Nov 20 '21 14:11 gustav3d

I guess if we ever get #350, it could fix that, by setting the minimum to 1.

clragon avatar Nov 21 '21 15:11 clragon

transitionBuilder: (context, suggestionsBox, animationController) {
            return Visibility(
                visible: controller.searchController.value.text.length == 0
                    ? false
                    : true,
                child: suggestionsBox);
          },

liemeon avatar Dec 23 '21 11:12 liemeon

transitionBuilder: (context, suggestionsBox, animationController) { return Visibility( visible: controller.searchController.value.text.length == 0 ? false : true, child: suggestionsBox); },

This works!

mark8044 avatar Jan 04 '22 00:01 mark8044