我刚收到这个错误。必须向Text小部件提供非空字符串。而我确信我正在向这个小部件传递一个值。
RaisedButton(
child: Text('Save'),
onPressed: () {
final Map<String, dynamic> product = {
'titile': titleValue,
'description': descriptionValue,
'price': priceValue,
'image': 'assets/33.jpg',
};
widget.addProduct(product);
当Text小部件中出现null值时,您可以使用它正在处理的toString((方法像Text(foo.toString(((;