toJson method

  1. @override
Map<String, Object> toJson()

Returns a JSON presentation of the object.

Implementation

@override
Map<String, Object> toJson() {
  var result = <String, Object>{};
  result['severity'] = severity.toJson();
  result['type'] = type.toJson();
  result['location'] = location.toJson();
  result['message'] = message;
  var correction = this.correction;
  if (correction != null) {
    result['correction'] = correction;
  }
  result['code'] = code;
  var url = this.url;
  if (url != null) {
    result['url'] = url;
  }
  var contextMessages = this.contextMessages;
  if (contextMessages != null) {
    result['contextMessages'] = contextMessages
        .map((DiagnosticMessage value) => value.toJson())
        .toList();
  }
  var hasFix = this.hasFix;
  if (hasFix != null) {
    result['hasFix'] = hasFix;
  }
  return result;
}