【发布时间】:2021-10-21 08:02:20
【问题描述】:
我得到“类型‘未来’不是‘小部件’类型的子类型? “在我的 ios 模拟器中。我该如何摆脱这个?请帮忙。
这是我的代码。
Widget build(BuildContext context) {
return Scaffold( ...
body: cropImage(PickedFile)
);
cropImage(pickedFile) async {
File? croppedImage = await ImageCropper.cropImage(
sourcePath: pickedFile,
maxWidth: 1080,
maxHeight: 1080,
);
if (croppedImage != null) {
var image = croppedImage;
setState(() {});
【问题讨论】:
标签: ios flutter widget future subtype