registerEventCallback static method
注册事件回调。
@param {Function(int errorCode, String desc)?} onEffectsError - 效果错误事件的回调函数。当效果处理过程中发生错误时,会调用此回调函数,并传入错误码和错误描述信息。 @param {Function(double score, Point point, Size size)?} onEffectsFaceDetected - 人脸检测事件的回调函数。当检测到人脸时,会调用此回调函数,并传入人脸检测的置信度、人脸位置和人脸大小信息。
@returns {Promise
Implementation
static Future<void> registerEventCallback({
Function(int errorCode, String desc)? onEffectsError,
Function(double score, Point point, Size size)? onEffectsFaceDetected,
}) async {
await _channel.invokeMethod('registerEventCallback');
_onEffectsError = onEffectsError;
_onEffectsFaceDetected = onEffectsFaceDetected;
_streamSubscription =
_receivedEvents.listen(_eventListener, onError: (error) {
PlatformException exception = error;
print(exception);
});
}