createEmptyMessage method Null safety

Future<NIMResult<NIMMessage>> createEmptyMessage(
  1. {required String sessionId,
  2. required NIMSessionType sessionType,
  3. required int timestamp}
)

Create an empty message.

The empty message is used for recording. It only contains the chat partner and time information.

  • sessionId If the conversation type is one-to-one chat, it is the chat partner's accid; if group chat, group ID.
  • sessionType The conversation type, including one-to-one chat and group chat
  • timestamp The start time for query

Implementation

static Future<NIMResult<NIMMessage>> createEmptyMessage(
    {required String sessionId,
    required NIMSessionType sessionType,
    required int timestamp}) async {
  return NIMResult.success(
      data: NIMMessage.emptyMessage(
          sessionId: sessionId,
          sessionType: sessionType,
          timestamp: timestamp));
}