toJson method
Implementation
Map<String, dynamic> toJson() => {
'severity': severity.name,
'code': code,
'message': message,
if (key != null) 'key': key,
if (firstType != null) 'firstType': chartTypeToString(firstType!),
if (secondType != null) 'secondType': chartTypeToString(secondType!),
};