DtoChatMessage.sending constructor

DtoChatMessage.sending({
  1. required ChatId chatId,
  2. required UserId me,
  3. ChatMessageText? text,
  4. List<ChatItemQuote> repliesTo = const [],
  5. List<Attachment> attachments = const [],
  6. ChatItemId? existingId,
  7. PreciseDateTime? existingDateTime,
})

Constructs a DtoChatMessage in a SendingStatus.sending state.

Implementation

factory DtoChatMessage.sending({
  required ChatId chatId,
  required UserId me,
  ChatMessageText? text,
  List<ChatItemQuote> repliesTo = const [],
  List<Attachment> attachments = const [],
  ChatItemId? existingId,
  PreciseDateTime? existingDateTime,
}) => DtoChatMessage(
  ChatMessage(
    existingId ?? ChatItemId.local(),
    chatId,
    User(me, UserNum('1234123412341234')),
    existingDateTime ?? PreciseDateTime.now(),
    text: text,
    repliesTo: repliesTo,
    attachments: attachments,
    status: SendingStatus.sending,
  ),
  null,
  ChatItemVersion('0'),
  [],
);