我使用 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
您可以使用
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
),
),