Flutter DropdownSearch "No Data Found" 消息自定义

Flutter DropdownSearch "No Data Found" Message customization

如果搜索栏的用户输入与列表中的任何项目都不匹配,则会显示此文本。

如何自定义此文本? No data found text My Code

Widget cityDropdown() {
    return DropdownSearch(
      validator: (val) => val == null ? 'Bir şehir seçiniz' : null,
      dropdownSearchDecoration: authInputDecoration.copyWith(
        contentPadding: EdgeInsets.fromLTRB(12, 5, 0, 5),
        labelText: 'Şehir',
        labelStyle: TextStyle(
            color: cityFocusNode.hasFocus ? Color(0xff70a43c) : Color(0xffB8B8B8)
        ),
      ),
      searchBoxDecoration: authInputDecoration.copyWith(
          labelText: "Şehrinizi Bulun",
          labelStyle: TextStyle(
            color: Color(0xff70a43c),
          )
      ),
      mode: Mode.BOTTOM_SHEET,
      items: cities,
      showSearchBox: true,
      onChanged: (value) {
        city = value;
      },
    );
  }

检查这个,

使用emptyBuilder自定义。

emptyBuilder: (context, searchEntry) => Center(child: Text('No data',style:TextStyle(color:Colors.blue))),

要删除黄色下划线样式,您必须将脚手架作为父元素添加到您的小部件或 Material 小部件作为根元素。