opt: fetch rgba positively for sessions on flutter

This commit is contained in:
Kingtous
2023-02-11 09:57:27 +08:00
parent d416d7d965
commit 491932cda1
5 changed files with 31 additions and 3 deletions

View File

@@ -1376,7 +1376,12 @@ class FFI {
debugPrint('json.decode fail1(): $e, ${message.field0}');
}
} else if (message is EventToUI_Rgba) {
imageModel.onRgba(message.field0);
// Fetch the image buffer from rust codes.
bind.sessionGetRgba(id: id).then((rgba) {
if (rgba != null) {
imageModel.onRgba(rgba);
}
});
}
}
}();