toJson method

Map<String, Object?> toJson({
  1. List<String> excepts = const [],
})

Implementation

Map<String, Object?> toJson({List<String> excepts = const []}) {
  return {
    if (!excepts.contains("id")) "id": id,
    "message": message,
    "createdAt": createdAt?.toIso8601String(),
    "seenAt": seenAt?.toIso8601String(),
    "read": read,
    "status": messageStatusFromEnum[status],
    "reference": reference,
  };
}