search_choices flutter 包有 border 字段吗?

问题描述 投票:0回答:1

我使用 searchchoices.single 在下拉列表中搜索和使用,但我无法在不将其包装到容器的情况下为搜索选项提供边框

SearchChoices.single(

                     items: tyreserialno.map((category) => DropdownMenuItem(

                       value: category,
                       child: Text(category.name),
                     )).toList(),
                     value: _selectedtyrserialnoCategory,
                     hint: "Select Tyre Serial No",
                     searchHint: "Search for Tyre Serial No",
                     onChanged: (value) {
                       setState(() {
                         _selectedtyrserialnoCategory = value;
                         tyreserialnoid = value?.id;
                       });
                     },
                     isExpanded: true,
                   ), i want to give decoration border function to give inside searchchoice howtogive i dont want to wrap it with container
flutter dart flutter-dependencies
1个回答
0
投票

您可以使用

InputDecoration
属性。

SearchChoices.single(
  items: tyreserialno.map((category) => DropdownMenuItem(
    value: category,
    child: Text(category.name),
  )).toList(),
  value: _selectedtyrserialnoCategory,
  hint: "Select Tyre Serial No",
  searchHint: "Search for Tyre Serial No",
  onChanged: (value) {
    setState(() {
      _selectedtyrserialnoCategory = value;
      tyreserialnoid = value?.id;
    });
  },
  isExpanded: true,
  decoration: InputDecoration(
    border: OutlineInputBorder(),   // Add border to the SearchChoices
  ),
),
© www.soinside.com 2019 - 2024. All rights reserved.