Converts to an encoded JSON.
String toJson({bool withIndent = false}) => encodeJSON(toJsonMap(), withIndent: withIndent);