# GenericDocument.fromJson constructor

GenericDocument.fromJson(

1. Map<String, dynamic> json

)

## Implementation

    factory GenericDocument.fromJson(Map<String, dynamic> json) =>
        GenericDocument(
          type:
              GenericDocumentType.fromJson(json["type"] as Map<String, dynamic>),
          fields: (json["fields"] as List<dynamic>)
              .map((it) => Field.fromJson(it as Map<String, dynamic>))
              .toList(),
          children: (json["children"] as List<dynamic>)
              .map((it) => GenericDocument.fromJson(it as Map<String, dynamic>))
              .toList(),
          quad: (json["quad"] as List<dynamic>)
              .map((it) => Point<double>(
                  ((it as Map<String, dynamic>)["x"] as num).toDouble(),
                  ((it)["y"] as num).toDouble()))
              .toList(),
          quadInRoot: (json["quadInRoot"] as List<dynamic>)
              .map((it) => Point<double>(
                  ((it as Map<String, dynamic>)["x"] as num).toDouble(),
                  ((it)["y"] as num).toDouble()))
              .toList(),
          crop: json.containsKey("crop")
              ? (json["crop"] != null
                  ? ImageRef.fromJson(json["crop"] as Map<String, dynamic>)
                  : null)
              : null,
          confidence: json.containsKey("confidence")
              ? (json["confidence"] as num).toDouble()
              : 0.0,
          confidenceWeight: json.containsKey("confidenceWeight")
              ? (json["confidenceWeight"] as num).toDouble()
              : 0.0,
        );