我无法删除 TextField 的阴影和背景,这是我的代码:
TextFormField(
decoration: InputDecoration.collapsed(),
validator: (input) =>
input == "" ? 'The task is empty' : null,
onSaved: (input) => task = input,
)
Run Code Online (Sandbox Code Playgroud)
这是我想要的结果
我总是尝试 BoxDecoration 但没有成功,因为不与 TextFormField 兼容。
代码是这个类的一部分
class Category extends StatelessWidget {
final String name;
final ColorSwatch color;
final IconData iconLocation;
Run Code Online (Sandbox Code Playgroud)
使用 required 是这样的:
const Category({
Key key,
@required this.name,
@required this.color,
@required this.iconLocation,
}) : assert(name != null),
assert(color != null),
assert(iconLocation != null),
super(key: key);
Run Code Online (Sandbox Code Playgroud)
Key 键的使用也让我感到困惑。