BarkoderResult.fromJson constructor

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

Implementation

factory BarkoderResult.fromJson(Map<String, dynamic> json) {
  List<DecoderResult> decoderResults = (json['decoderResults'] as List)
      .map((result) => DecoderResult.fromJson(result))
      .toList();
  return BarkoderResult(
    decoderResults: decoderResults,
    resultThumbnails: json['resultThumbnailsAsBase64'] != null
        ? (json['resultThumbnailsAsBase64'] as List<dynamic>)
            .map((thumbnail) => Base64Decoder().convert(thumbnail))
            .toList()
        : null,
    resultImage: json['resultImageAsBase64'] != null
        ? Base64Decoder().convert(json['resultImageAsBase64'])
        : null,
  );
}