toJson method

Map<String, Object> toJson()

Return a table representing the structure of the Json object that will be sent to the client to represent this response.

Implementation

Map<String, Object> toJson() {
  var jsonObject = <String, Object>{};
  jsonObject[ID] = id;
  var error = this.error;
  if (error != null) {
    jsonObject[ERROR] = error.toJson();
  }
  var result = this.result;
  if (result != null) {
    jsonObject[RESULT] = result;
  }
  return jsonObject;
}