【发布时间】:2019-07-24 13:22:15
【问题描述】:
有什么方法可以在颤动中增加文本字段标签的宽度,以避免省略号(...)?
标签总是小于文本字段区域。
我能想到的改进方法就是减少内容填充的“开始”和“结束”,但效果微乎其微。
child: TextField(
decoration: InputDecoration(
labelText: "em Dólares",
labelStyle: TextStyle(color: Colors.amber[600],
fontStyle: FontStyle.italic),
border: OutlineInputBorder(),
fillColor: Colors.black12,
filled: true,
contentPadding: EdgeInsetsDirectional.only(top: 20.0, bottom: 20.0, start: 5.0, end: 5.0), //<-- weak solution
prefixText: "US\$"),
style: TextStyle(color: Colors.amber[600], fontSize: 20.0),
)
Ps:我在上面的代码中隐藏了一些文本字段中不必要的属性,如控制器、inputFormatters、keyboardType。
【问题讨论】: