void callback(IStatus status, String text) { final textUtf = text.toNativeUtf8(allocator: mem); try { _callback(self, status.self, textUtf); status.checkStatus(); } finally { mem.free(textUtf); } }