support FFI 1.0.0

This commit is contained in:
narumi
2021-02-22 00:36:08 +08:00
parent 0de94f12e2
commit 54baa25c87
5 changed files with 33 additions and 33 deletions

View File

@@ -62,11 +62,11 @@ class FlutterQjs {
));
case JSChannelType.MODULE:
if (moduleHandler == null) throw JSError('No ModuleHandler');
final ret = Utf8.toUtf8(moduleHandler(
Utf8.fromUtf8(ptr.cast<Utf8>()),
));
final ret = moduleHandler(
ptr.cast<Utf8>().toDartString(),
).toNativeUtf8();
Future.microtask(() {
free(ret);
malloc.free(ret);
});
return ret;
case JSChannelType.PROMISE_TRACK: