我无法删除TextField的阴影和背景,这是我的代码:
TextFormField(
decoration: InputDecoration.collapsed(),
validator: (input) =>
input == "" ? 'The task is empty' : null,
onSaved: (input) => task = input,
)
这是我想要的结果我总是尝试BoxDecoration但没有成功,因为它与TextFormField不兼容。
最佳答案
您应该将fill设置为true。
TextField(decoration: InputDecoration( fillColor: Colors.red, filled: true)),
关于flutter - 如何在Flutter Widget中删除TextField的背景颜色?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55083248/