我有一个位图,我想从这个位图裁剪一个圆形区域.圆圈外的所有像素都应该是透明的.我怎样才能做到这一点?

我有这样的场景,我必须从这样的图像中获取 UInt8List :
List stuff = image.toByteData().buffer.asUInt8List()
Run Code Online (Sandbox Code Playgroud)
做一些操作并回到Image。
我尝试了以下方法:
List stuff = image.toByteData().buffer.asUInt8List()
ui.decodeImageFromList(stuff, (image){
// do stuff with image
});
Run Code Online (Sandbox Code Playgroud)
但我不断收到此异常:
E/flutter (10201): [ERROR:flutter/lib/ui/painting/codec.cc(97)] Failed decoding image. Data is either invalid, or it is encoded using an unsupported format.
E/flutter (10201): [ERROR:flutter/shell/common/shell.cc(186)] Dart Error: Unhandled exception:
...
Run Code Online (Sandbox Code Playgroud)
请注意,即使列表中没有任何更改,也会引发异常。如何使列表具有可编码格式?