BarcodeAddress.fromJson constructor

BarcodeAddress.fromJson(
  1. Map json
)

Returns an instance of BarcodeAddress from a given json.

Implementation

factory BarcodeAddress.fromJson(Map<dynamic, dynamic> json) {
  final lines = <String>[];
  for (final dynamic line in json['addressLines']) {
    lines.add(line);
  }
  return BarcodeAddress(
    addressLines: lines,
    type: BarcodeAddressType.values[json['addressType']],
  );
}