toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  Map<String, dynamic> filteredConfigAsJson = {
    "locationLineColor": locationLineColor,
    "locationLineWidth": locationLineWidth,
    "roiLineColor": roiLineColor,
    "roiLineWidth": roiLineWidth,
    "roiOverlayBackgroundColor": roiOverlayBackgroundColor,
    "closeSessionOnResultEnabled": closeSessionOnResultEnabled,
    "imageResultEnabled": imageResultEnabled,
    "locationInImageResultEnabled": locationInImageResultEnabled,
    "locationInPreviewEnabled": locationInPreviewEnabled,
    "pinchToZoomEnabled": pinchToZoomEnabled,
    "regionOfInterestVisible": regionOfInterestVisible,
    "barkoderResolution": barkoderResolution?.index,
    "beepOnSuccessEnabled": beepOnSuccessEnabled,
    "vibrateOnSuccessEnabled": vibrateOnSuccessEnabled,
    "enableVINRestrictions": enableVINRestrictions,
    "decoder": decoder?.toMap()
  };

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

  return filteredConfigAsJson;
}