Image 颤振/飞镖-将URL传递给图像裁剪器而不是图像文件?

Image 颤振/飞镖-将URL传递给图像裁剪器而不是图像文件?,image,flutter,dart,image-processing,Image,Flutter,Dart,Image Processing,我正在尝试使用flatter_Native_Image将URL中的图像裁剪成500 X 500像素的正方形 下面是我正在使用的函数,它需要一个图像文件,但是如何传递图像URL呢 cropAvatar(imagefile)async{ ImageProperties properties = await FlutterNativeImage.getImageProperties(imagefile); int originX= properties.width ~/ 2; i

我正在尝试使用flatter_Native_Image将URL中的图像裁剪成500 X 500像素的正方形

下面是我正在使用的函数,它需要一个图像文件,但是如何传递图像URL呢

 cropAvatar(imagefile)async{

  ImageProperties properties = await FlutterNativeImage.getImageProperties(imagefile);

  int originX= properties.width  ~/ 2;

  int originY = properties.height  ~/ 2;

  File croppedFile = await FlutterNativeImage.cropImage(imagefile, originX, originY, 500, 500);

  uploadAvatar(currentuserid:'77', filepath:croppedFile.path);
}