我在我的颤振项目中使用图像裁剪器依赖项。
我使用的是image_cropper: ^1.4.1,
,显示时出错
Error: Member not found: 'ImageCropper.cropImage'.
final croppedFile = await ImageCropper.cropImage(
^^^^^^^^^
这是我的密码
Future<File?> cropImage(File imageFile) async {
File? croppedFile;
try {
croppedFile = await ImageCropper.cropImage(
sourcePath: imageFile.path,
aspectRatioPresets: [
CropAspectRatioPreset.square,
CropAspectRatioPreset.ratio3x2,
CropAspectRatioPreset.original,
CropAspectRatioPreset.ratio4x3,
CropAspectRatioPreset.ratio16x9
],
androidUiSettings: AndroidUiSettings(
toolbarTitle: 'Cropper',
toolbarColor: accentColor,
toolbarWidgetColor: white,
initAspectRatio: CropAspectRatioPreset.original,
lockAspectRatio: false),
iosUiSettings: IOSUiSettings(
title: 'Cropper',
));
return croppedFile;
} catch (e) {
print(e);
}
return croppedFile;
}
我不知道是什么导致了这个错误
发布于 2022-05-17 12:09:18
尝试用ImageCropper.cropImage
替换ImageCropper().cropImage
https://stackoverflow.com/questions/72280006
复制相似问题