toJson method

Map<String, dynamic> toJson()

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);
}