在Flutter中点击DropdownSearch后,如何在搜索栏上设置焦点?

jdg4fx2g  于 2023-05-23  发布在  Flutter
关注(0)|答案(1)|浏览(175)

单击DropdownSearch时,如何将焦点放在搜索栏上?
我想找出是哪个领域造成的。我发现了下拉式生成器,但我不能弄清楚。

child: DropdownSearch<String>(
              popupProps: const PopupProps.menu(
                showSearchBox: true,
                showSelectedItems: true,
                searchDelay: Duration(milliseconds: 40)
              ),
              dropdownDecoratorProps: DropDownDecoratorProps(
                dropdownSearchDecoration: InputDecoration(
                  border: OutlineInputBorder(
                    borderRadius: BorderRadius.circular(10),
                  ),
                  isDense: true,
                )
              ),
              onChanged: (String? value) {
                setState(() {
                  _signs!.signs[index].type = RoadSignType.fromDisplay(value!);
                });
              },
              items: _signTypeItems,
            ),`
w41d8nur

w41d8nur1#

使用FocusNade

FocusNode focusNode = FocusNode();

和上面或下面showSearchBox = true使用代码粘贴

focusNode: focusNode;

相关问题