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