toJson method
Returns a JSON object representation.
Implementation
Map<String, dynamic> toJson() {
return <String, dynamic>{
'type': type.name,
'amount': amount,
'action': action,
'canUpdate': canUpdate,
}..removeWhere((key, value) => value == null);
}