我想在图标上添加背景颜色,因此我试图将它包装在容器中,但它不工作它给了我这个错误。
The constructor being called isn't a const constructor.
Try removing 'const' from the constructor invocation
这是我的代码
Container(
padding: EdgeInsets.fromLTRB(70, 10,60, 0),
//width: 350,
child: TextFormField(
decoration: const InputDecoration(
border: InputBorder.none,
prefixIcon: Container(
color:Colors.red,
child: new IconButton(color: Colors.blue, icon: Icon(Icons.home))),
hintText: 'Description',
labelText: 'Description'),
controller: descriptionController,
validator: (value) {
if (value.isEmpty) {
return 'This field is required.';
}
return null;
},
),
),
请帮助如何解决它