如何在我的 flutter 项目中解决这个错误
this expression has a type of void so its value cant be used.
这是我的代码:
Future<void> _updateItem(item) async {
final acc = await _box.get(widget.phone);
List putit = acc["transaction"];
var save_hive = putit.add(item);
print(save_hive);
final gg = _box.put(widget.phone, save_hive);
}
希望得到帮助,感谢您对我的问题的影响。
putit.add(item)
返回了一个空值save_hive
,不能在print(save_hive)
中使用