[英]How to crop image using extended_image in flutter
拍攝圖像后,我正在嘗試使用 flutter 中的擴展圖像編輯圖像,但我無法做到。 如何在 flutter 中使用擴展圖像。
final picker = ImagePicker();
Future getImage() async {
final pickedFile = await picker.getImage(source: ImageSource.camera);
setState(() {
_image = File(pickedFile.path);
});
_croppedImage = ExtendedImage.file(
_image,
fit: BoxFit.contain,
mode: ExtendedImageMode.editor,
extendedImageEditorKey: editorKey,
initEditorConfigHandler: (state) {
return EditorConfig(
maxScale: 8.0,
cropRectPadding: EdgeInsets.all(20.0),
hitTestSize: 20.0,
cropAspectRatio: CropAspectRatios.original);
},
);
}
但它不提供編輯器。
您需要在小部件樹中使用 ExtendedImage.file,而不是 function,例如作者的 github, image_editor_demo
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.