FaceLivenessEvent.fromMap constructor

FaceLivenessEvent.fromMap(
  1. Map map
)

Implementation

factory FaceLivenessEvent.fromMap(Map map) {
  switch (map['event']) {
    case connectingEvent:
      return const FaceLivenessEventConnecting();
    case connectedEvent:
      return const FaceLivenessEventConnected();
    case validatingEvent:
      return const FaceLivenessEventConnecting();
    case validatedEvent:
      return const FaceLivenessEventConnected();
    case canceledEvent:
      return const FaceLivenessEventClosed();
    case successEvent:
      return FaceLivenessEventSuccess(map['signedResponse']);
    case failureEvent:
      return FaceLivenessEventFailure(
          errorType: map["errorType"],
          errorDescription: map["errorDescription"]);
  }
  throw Exception(resultMappingError);
}