如何从“ImmutableBuffer”获取“Uint8List”?

Bam*_*oUA 8 type-conversion dart flutter

load新的 Flutter 3.3 弃用了class 的方法ImageProvider,现在我的一些代码变得无法工作,因为有一个type 的load参数,但有一个.bytesUit8ListloadBufferbufferImmutableBuffer

我曾经使用包Uint8List解码图像image

final bytes = img.decodeImage(bytes); // bytes is instance of Uit8List
Run Code Online (Sandbox Code Playgroud)

完整的代码可以从文章《Remove a color from an image in Flutter》中阅读,从第 4. 节开始解码

在此输入图像描述

现在我需要转换ImmutableBufferUint8List. 有人知道该怎么做吗?