Flutter Autocomplete optionsViewBuilder height,width issue

Viewed 32

Set height and width to Autocomplete optionsViewBuilder is failed.How i can set custom width and height to autocomplete options view.

Problem enter image description here

code :

child: Autocomplete<User>(
                                displayStringForOption: _displayStringForOption,
                                optionsBuilder: (TextEditingValue textEditingValue) {
                                  if (textEditingValue.text == '') {
                                    return const Iterable<User>.empty();
                                  }
                                  return _userOptions.where((User option) {
                                    return option
                                        .getName()
                                        .contains(textEditingValue.text);
                                  });
                                },
                                optionsViewBuilder: (context, onSelected, options) {
                                  return Container(
                                    height: 100,
                                    width: 150,
                                    color: Colors.white,
                                  );
                                },
                                onSelected: (User selection) {
                                  debugPrint('You just selected ${_displayStringForOption(selection)}');
                                },
                              ),
0 Answers
Related