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