toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  final Map<String, dynamic> json = {
    "arMode": arMode?.index,
    "resultDisappearanceDelayMs": resultDisappearanceDelayMs,
    "locationTransitionSpeed": locationTransitionSpeed,
    "overlayRefresh": overlayRefresh?.index,
    "selectedLocationColor": selectedLocationColor,
    "nonSelectedLocationColor": nonSelectedLocationColor,
    "selectedLocationLineWidth": selectedLocationLineWidth,
    "nonSelectedLocationLineWidth": nonSelectedLocationLineWidth,
    "locationType": locationType?.index,
    "doubleTapToFreezeEnabled": doubleTapToFreezeEnabled,
    "imageResultEnabled": imageResultEnabled,
    "barcodeThumbnailOnResult": barcodeThumbnailOnResult,
    "resultLimit": resultLimit,
    "continueScanningOnLimit": continueScanningOnLimit,
    "emitResultsAtSessionEndOnly": emitResultsAtSessionEndOnly,
    "headerHeight": headerHeight,
    "headerShowMode": headerShowMode?.index,
    "headerMaxTextHeight": headerMaxTextHeight,
    "headerMinTextHeight": headerMinTextHeight,
    "headerTextColorSelected": headerTextColorSelected,
    "headerTextColorNonSelected": headerTextColorNonSelected,
    "headerHorizontalTextMargin": headerHorizontalTextMargin,
    "headerVerticalTextMargin": headerVerticalTextMargin,
    "headerTextFormat": headerTextFormat,
  };

  json.removeWhere((key, value) => value == null);
  return json;
}