toJson method
Converts a StatusCause instance to JSON data.
Implementation
Map<String, Object> toJson() {
final jsonData = <String, Object>{};
final tempField = field;
final tempMessage = message;
final tempReason = reason;
if (tempField != null) {
jsonData['field'] = tempField;
}
if (tempMessage != null) {
jsonData['message'] = tempMessage;
}
if (tempReason != null) {
jsonData['reason'] = tempReason;
}
return jsonData;
}