ScanResultModel.fromMap constructor

ScanResultModel.fromMap(
  1. Map<String, dynamic> map
)

Implementation

factory ScanResultModel.fromMap(Map<String, dynamic> map) {
  return ScanResultModel(
    length: map['length'] != null ? map['length'] as int : 0,
    barcode: map['barcode'] != null ? map['barcode'] as String : null,
    bytesToHexString: map['bytesToHexString'] != null
        ? map['bytesToHexString'] as String
        : null,
    barcodeStr:
        map['barcodeStr'] != null ? map['barcodeStr'] as String : null,
    image: map['image'] != null ? Uint8List.fromList(map['image']) : null,
  );
}