SessionResult.fromJson constructor

SessionResult.fromJson(
  1. Map<String, dynamic> json
)

Factory method to create from JSON string

Implementation

SessionResult.fromJson(Map<String, dynamic> json) {
  if (json == null) {
    return;
  }
  if (json["faceCaptures"] != null) {
    List<dynamic> dynamicList = json["faceCaptures"];

    List<FaceCapture> aux = dynamicList
        .map((detectedFace) => FaceCapture.fromJson(detectedFace))
        .toList();

    this.attachments = aux.toList();
  }
  if (json["error"] != null) {
    try {
      this.error = VerIDError.fromJson(json["error"]);
    } catch (e) {
      throw json["error"];
    }
  }
}