BaseMessage constructor
BaseMessage({
- Map<
String, dynamic> ? parentMessage, - required bool isPinnedMessage,
- String? requestId,
- int messageId = 0,
- required String message,
- required MessageSendingStatus? sendingStatus,
- Sender? sender,
- required String channelUrl,
- required ChannelType channelType,
- List<
User> mentionedUsers = const <User>[], - MentionType? mentionType,
- List<
String> ? mentionedUserIds = const <String>[], - List<
String> ? requestedMentionUserIds, - int createdAt = 0,
- int updatedAt = 0,
- bool replyToChannel = false,
- int? parentMessageId,
- String? parentMessageText,
- ThreadInfo? threadInfo,
- List<
MessageMetaArray> ? metaArrays, - String? customType,
- int? messageSurvivalSeconds,
- bool forceUpdateLastMessage = false,
- bool isSilent = false,
- int? errorCode,
- bool isOperatorMessage = false,
- String? data,
- OGMetaData? ogMetaData,
- List<
Reaction> ? reactions = const <Reaction>[], - ScheduledInfo? scheduledInfo,
- Map<
String, dynamic> extendedMessage = const {},
default constructor
Implementation
BaseMessage({
Map<String, dynamic>? parentMessage,
required this.isPinnedMessage,
this.requestId,
this.messageId = 0,
required this.message,
required this.sendingStatus,
this.sender,
required this.channelUrl,
required this.channelType,
this.mentionedUsers = const <User>[],
this.mentionType,
this.mentionedUserIds = const <String>[],
this.requestedMentionUserIds,
this.createdAt = 0,
this.updatedAt = 0,
this.replyToChannel = false,
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>[],
this.scheduledInfo,
this.extendedMessage = const {},
}) {
if (parentMessage != null && parentMessageId != null) {
parentMessage['message_id'] = parentMessageId;
parentMessage['channel_url'] = channelUrl;
parentMessage['channel_type'] = channelType;
this.parentMessage = BaseMessage.fromJson(parentMessage);
}
if (sendingStatus == null) {
if (messageId > 0) {
sendingStatus = MessageSendingStatus.succeeded;
} else if (requestId != null) {
sendingStatus = MessageSendingStatus.pending;
} else {
sendingStatus = MessageSendingStatus.none;
}
}
}