toJson function

String toJson (dynamic object, { bool parseString: false, dynamic depth, dynamic exclude })

Serializes the object to a JSON string.

Parameters:

depth : determines how deep is going to be the serialization and avoids stack overflow produced by cyclical object references. exclude : exclude some attributes. It could be String, Map, or List

Implementation

String toJson(object, {bool parseString: false, depth, exclude}) {
//  _serLog.fine("Start serializing");

  if (!parseString && object is String) return object;

  var result = json.encode(objectToSerializable(object, depth: depth, exclude: exclude));

  _serializedStack.clear();

  return result;
}