callFunction static method
Implementation
static Future<dynamic> callFunction(
int engineId,
String action,
Object params,
CommonCallback callback,
) async {
var stopwatch = Stopwatch();
stopwatch.start();
var actionPtr = action.toNativeUtf16();
var paramsPair = _parseParams(params);
stopwatch.stop();
LogUtils.profile("callFunction", stopwatch.elapsedMilliseconds);
_BridgeFFIManager.instance.callFunction(
engineId,
actionPtr,
paramsPair.left,
paramsPair.right.length,
generateCallback((value) {
stopwatch.stop();
LogUtils.profile("callFunction", stopwatch.elapsedMilliseconds);
callback(value);
}),
);
free(actionPtr);
free(paramsPair.left);
}