getNextFrame method
Implementation
@override
Future<Frame> getNextFrame({required String key}) {
final request = KeyRequest(
key: key,
data: Uint8List.fromList([1]),
).writeToBuffer();
final nativeRequest = toPointer(request);
final completer = Completer<Frame>();
final port = RawReceivePort();
port.handler = (response) {
port.close();
final frame = Frame.fromBuffer(response);
completer.complete(frame);
};
flutterAvifFFI.get_next_frame(
port.sendPort.nativePort,
nativeRequest[0],
nativeRequest[1],
);
malloc.free(nativeRequest[0]);
return completer.future;
}