toJson method

Map<String, dynamic> toJson()

Convert to JSON map.

Implementation

Map<String, dynamic> toJson() => {
      'type': type.name,
      'description': description,
      'filePath': filePath,
      'line': location.start.line,
      'column': location.start.column,
      'severity': severity.name,
      if (context != null) 'context': context,
      if (sourceCode != null) 'sourceCode': sourceCode,
    };