DecoderResult.fromJson constructor

DecoderResult.fromJson(
  1. Map<String, dynamic> resultMap
)

Implementation

DecoderResult.fromJson(Map<String, dynamic> resultMap) {
  barcodeType = resultMap['barcodeType'];
  barcodeTypeName = resultMap['barcodeTypeName'];
  binaryDataAsBase64 = resultMap['binaryDataAsBase64'];
  textualData = resultMap['textualData'];
  characterSet = resultMap['characterSet'];
  if (resultMap.containsKey('extra')) extra = json.decode(resultMap['extra']);
  if (resultMap.containsKey('mrzImagesAsBase64')) {
    mrzImages = (resultMap['mrzImagesAsBase64'] as List<dynamic>)
        .map((imageData) => MRZImage.fromJson(imageData))
        .toList();
  }
}