# toJson method

Map<String, dynamic> toJson({

1. ToJsonConfiguration? config,

})

## Implementation

    Map<String, dynamic> toJson({ToJsonConfiguration? config}) {
      config = config ?? ToJsonConfiguration();
      Map<String, dynamic> obj = <String, dynamic>{};
      obj["text"] = text;
      obj["rawBytes"] = rawBytes.toString();
      obj["rawBytesEncodings"] =
          rawBytesEncodings.map((it) => it.toJson(config: config)).toList();
      obj["structuredAppendInfo"] = (structuredAppendInfo != null
          ? structuredAppendInfo!.toJson(config: config)
          : null);
      obj["format"] = format.name;
      obj["quad"] = quad.map((it) => {"x": it.x, "y": it.y}).toList();
      obj["quadNormalized"] =
          quadNormalized.map((it) => {"x": it.x, "y": it.y}).toList();
      obj["extendedQuad"] =
          extendedQuad.map((it) => {"x": it.x, "y": it.y}).toList();
      obj["extendedQuadNormalized"] =
          extendedQuadNormalized.map((it) => {"x": it.x, "y": it.y}).toList();
      obj["isUpsideDown"] = isUpsideDown;
      if (config.serializeImages) {
        obj["sourceImage"] = (sourceImage != null ? sourceImage!.toJson() : null);
      }
      obj["upcEanExtension"] = upcEanExtension;
      obj["isGS1Message"] = isGS1Message;
      obj["isGS1CompositePart"] = isGS1CompositePart;
      obj["dataBarStackSize"] = dataBarStackSize;
      obj["sizeScore"] = sizeScore;
      obj["extractedDocument"] = (extractedDocument != null
          ? extractedDocument!.toJson(config: config)
          : null);
      obj["globalIndex"] = globalIndex;
      return obj;
    }