Calling startFaceAuthenticator
void startSDK() {
final stream = _faceAuth.start();
_setupFaceAuthListener(stream);
}
void _setupFaceAuthListener(Stream<FaceAuthEvent> stream) {
stream.listen((event) {
if (event is FaceAuthEventConnecting) {
print('Connecting to FaceAuth...');
} else if (event is FaceAuthEventConnected) {
print('Connected to FaceAuth.');
} else if (event is FaceAuthEventClosed) {
print('SDK closed by the user.');
} else if (event is FaceAuthEventSuccess) {
print('Success! SignedResponse: ${event.signedResponse}');
} else if (event is FaceAuthEventFailure) {
print(
'Failure! Error type: ${event.errorType}, '
'Error description: ${event.errorDescription}',
);
}
});
}