getAsProperties static method

Map<String, dynamic> getAsProperties(
  1. List<CodeFormat> codeFormats, {
  2. bool enabled = true,
})

Returns a Map of Honeywell's Barcode formats properties according to the List of CodeFormat specified and the enabled value which is true by default. codeFormats the List of CodeFormat enums to be converted to Honeywell properties enabled the value to be set to the format property, true or false

Implementation

static Map<String, dynamic> getAsProperties(
    final List<CodeFormat> codeFormats,
    {bool enabled = true}) {
  if (codeFormats.isEmpty) return {};
  Map<String, dynamic> mapProperties = {};
  for (var codeFormat in codeFormats) {
    if (codeFormat.propertyName != null) {
      mapProperties[codeFormat.propertyName!] = enabled;
    }
  }
  return mapProperties;
}