convertToJSONAsString function

String? convertToJSONAsString(
  1. dynamic jsonNode, [
  2. String indent = ' '
])

Implementation

String? convertToJSONAsString(dynamic jsonNode, [String indent = '  ']) {
  if (jsonNode == null) return null;

  if (indent.isNotEmpty) {
    return encodeJSON(jsonNode, withIndent: true);
  } else {
    return encodeJSON(jsonNode);
  }
}