示例
先来看一个例子:假设我们要做一个表单,左边是提示文字,右边是输入框
给出代码:
Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
"$labelName",
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold,
),
),
Expanded(
child: TextField(
obscureText: true,
style: TextStyle(
fontSize: 16,
),
decoration: InputDecoration(
border: OutlineInputBorder(),
hintText: "$hintText",
),
),
)
],
)
可以看到 输入框的高度显然有点太高了
标签:TextStyle,高度,decoration,输入框,hintText,InputDecoration,TextField,Flutter From: https://www.cnblogs.com/hhsk/p/17093066.html