toJson method

Map<String, Object?> toJson()

Implementation

Map<String, Object?> toJson() {
  return {
    'type': type,
    if (id != null) 'id': id,
    if (payload != null) 'payload': payload
  };
}