toJsonString method

String toJsonString()

Converts the map to a JSON string.

Example:

var map = {'name': 'John', 'age': 30};
print(map.toJsonString()); // Output: '{"name":"John","age":30}'

Implementation

String toJsonString() {
  return jsonEncode(this);
}