toMap method

Map<String, dynamic> toMap()

Implementation

Map<String, dynamic> toMap() {
  Map<String, dynamic> filteredMap = {
    "maxThreads": threadsLimit,
    "decodingSpeed": decodingSpeed?.index,
    "roi_x": roiX,
    "roi_y": roiY,
    "roi_w": roiWidth,
    "roi_h": roiHeight,
    "formattingType": formattingType?.index,
    "encodingCharacterSet": encodingCharacterSet,
    "maximumResultsCount": maximumResultsCount,
    "duplicatesDelayMs": duplicatesDelayMs,
    "multicodeCachingDuration": multicodeCachingDuration,
    "multicodeCachingEnabled": multicodeCachingEnabled
  };

  filteredMap.removeWhere((key, value) => value == null);

  return filteredMap;
}