# DocumentDetectionResult.fromJson constructor

DocumentDetectionResult.fromJson(

1. Map<String, dynamic> json

)

## Implementation

    factory DocumentDetectionResult.fromJson(Map<String, dynamic> json) =>
        DocumentDetectionResult(
          status: json.containsKey("status")
              ? DocumentDetectionStatus.values.byName(json["status"] as String)
              : DocumentDetectionStatus.NOT_ACQUIRED,
          detectionScores: DocumentDetectionScores.fromJson(
              json["detectionScores"] as Map<String, dynamic>),
          points: (json["points"] as List<dynamic>)
              .map((it) => Point<int>(
                  ((it as Map<String, dynamic>)["x"] as int), ((it)["y"] as int)))
              .toList(),
          horizontalLines: (json["horizontalLines"] as List<dynamic>)
              .map((it) => LineSegmentInt.fromJson(it as Map<String, dynamic>))
              .toList(),
          verticalLines: (json["verticalLines"] as List<dynamic>)
              .map((it) => LineSegmentInt.fromJson(it as Map<String, dynamic>))
              .toList(),
          pointsNormalized: (json["pointsNormalized"] as List<dynamic>)
              .map((it) => Point<double>(
                  ((it as Map<String, dynamic>)["x"] as num).toDouble(),
                  ((it)["y"] as num).toDouble()))
              .toList(),
          horizontalLinesNormalized: (json["horizontalLinesNormalized"]
                  as List<dynamic>)
              .map((it) => LineSegmentFloat.fromJson(it as Map<String, dynamic>))
              .toList(),
          verticalLinesNormalized: (json["verticalLinesNormalized"]
                  as List<dynamic>)
              .map((it) => LineSegmentFloat.fromJson(it as Map<String, dynamic>))
              .toList(),
          aspectRatio: (json["aspectRatio"] as num).toDouble(),
          averageBrightness: json.containsKey("averageBrightness")
              ? (json["averageBrightness"] as int)
              : 0,
        );