documentFormatFromJson function

BarcodeFormattedResult documentFormatFromJson(
  1. Map<String, dynamic> json
)

Implementation

BarcodeFormattedResult documentFormatFromJson(Map<String, dynamic> json) {
  var format = json['documentFormat'];
  switch (format) {
    case AAMVADocument.DOCUMENT_FORMAT:
      return AAMVADocument.fromJson(json);
    case BoardingPassDocument.DOCUMENT_FORMAT:
      return BoardingPassDocument.fromJson(json);
    case DEMedicalPlanDocument.DOCUMENT_FORMAT:
      return DEMedicalPlanDocument.fromJson(json);
    case DisabilityCertificateDocument.DOCUMENT_FORMAT:
      return DisabilityCertificateDocument.fromJson(json);
    case IDCardPDF417Document.DOCUMENT_FORMAT:
      return IDCardPDF417Document.fromJson(json);
    case SEPADocument.DOCUMENT_FORMAT:
      return SEPADocument.fromJson(json);
    case VCardDocument.DOCUMENT_FORMAT:
      return VCardDocument.fromJson(json);
    default:
      return UnknownBarcodeFormat('UNKNOWN');
  }
}