我正在使用以下代码生成TextFormField
,可以通过更改文本字段的垂直填充来更改高度。
final hotelSearchField = TextFormField(
keyboardType: TextInputType.text,
focusNode: _hotelSearchFocus,
controller: _hotelSearchController,
textInputAction: TextInputAction.search,
onFieldSubmitted: (term) {},
decoration: InputDecoration(
contentPadding: EdgeInsets.symmetric(vertical: 7.0, horizontal: 20),
hintText: "Search",
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(10.0),
),
),
);
但是,当我在prefixIcon
装饰中添加TextFormField
时,无法通过更改垂直填充来更改TextFormField
的高度。
decoration: InputDecoration(
contentPadding: EdgeInsets.symmetric(vertical: 7.0, horizontal: 20),
hintText: "Search",
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(10.0),
),
prefixIcon: Icon(Icons.search, size: 20.0),
)
我尝试减小图标的大小。但这只会更改Icon的大小,填充相同。
没有重点:
有重点:
我只希望降低高度。
谢谢..