registerEventCallback static method Null safety
Register event callbacks.
Function(int, String)? onEffectsError - The callback function for effects error events. When an error occurs during the effects processing, this callback function will be invoked, passing in the error code and error description information.
Function(double, Point, Size)? onEffectsFaceDetected - The callback function for face detection events. When a face is detected, this callback function will be invoked, passing in the confidence, position, and size of the detected face.
Applicable version: >= 2.1.0
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);
});
}