toJson method

String toJson()

Converts the User instance into a JSON string.

This method uses toMap internally for the conversion.

Implementation

String toJson() {
  return jsonEncode(toMap());
}