ChatMessage constructor Null safety

const ChatMessage(
  1. {@JsonKey(name: 'fromId') required ParticipantId fromParticipantId,
  2. @JsonKey(name: 'name') String? fromParticipantName,
  3. required DateTime date,
  4. DateTime? received,
  5. required String message,
  6. String? room,
  7. @Default(false) bool local,
  8. @JsonKey(fromJson: reactionsFromJson, ignore: true) @Default({}) Map<String, Set<ParticipantId>> reactions}
)

Implementation

const factory ChatMessage({
  @JsonKey(name: 'fromId') required ParticipantId fromParticipantId,
  @JsonKey(name: 'name') String? fromParticipantName,
  required DateTime date,
  DateTime? received,
  required String message,
  String? room,
  @Default(false) bool local,
  @JsonKey(fromJson: reactionsFromJson, ignore: true) @Default({}) Map<String, Set<ParticipantId>> reactions,
}) = _ChatMessage;