ScanResultModel.fromMapScanResult constructor

ScanResultModel.fromMapScanResult(
  1. Map<Object?, Object?> map
)

Implementation

factory ScanResultModel.fromMapScanResult(Map<Object?, Object?> 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'] as List<int>)
        : null,
  );
}