BaseMessage constructor Null safety

BaseMessage(
  1. {required String message,
  2. required MessageSendingStatus? sendingStatus,
  3. required String channelUrl,
  4. required ChannelType channelType,
  5. Sender? sender,
  6. List<User> mentionedUsers = const <User>[],
  7. String? requestId,
  8. int messageId = 0,
  9. MentionType? mentionType,
  10. List<String>? requestedMentionUserIds,
  11. int createdAt = 0,
  12. int updatedAt = 0,
  13. int? parentMessageId,
  14. String? parentMessageText,
  15. ThreadInfo? threadInfo,
  16. List<MessageMetaArray>? metaArrays,
  17. String? customType,
  18. int? messageSurvivalSeconds,
  19. bool forceUpdateLastMessage = false,
  20. bool isSilent = false,
  21. int? errorCode,
  22. bool isOperatorMessage = false,
  23. String? data,
  24. OGMetaData? ogMetaData,
  25. List<Reaction>? reactions = const <Reaction>[]}
)

default constructor

Implementation

BaseMessage({
  required this.message,
  required this.sendingStatus,
  required this.channelUrl,
  required this.channelType,
  this.sender,
  this.mentionedUsers = const <User>[],
  this.requestId,
  this.messageId = 0,
  this.mentionType,
  this.requestedMentionUserIds,
  this.createdAt = 0,
  this.updatedAt = 0,
  this.parentMessageId,
  this.parentMessageText,
  this.threadInfo,
  this.metaArrays,
  this.customType,
  this.messageSurvivalSeconds,
  this.forceUpdateLastMessage = false,
  this.isSilent = false,
  this.errorCode,
  this.isOperatorMessage = false,
  this.data,
  this.ogMetaData,
  this.reactions = const <Reaction>[],
}) {
  if (sendingStatus == null) {
    if (messageId > 0) {
      sendingStatus = MessageSendingStatus.succeeded;
    } else if (requestId != null) {
      sendingStatus = MessageSendingStatus.pending;
    } else {
      sendingStatus = MessageSendingStatus.none;
    }
  }
}