goToChatAndClearStack function

void goToChatAndClearStack(
  1. BuildContext context,
  2. String teamConversationId,
  3. NIMConversationType type
)

跳转到会话页面,并清空栈

Implementation

void goToChatAndClearStack(
    BuildContext context, String teamConversationId, NIMConversationType type) {
  if (IMKitRouter.instance.enableGoRouter) {
    context.go(
      RouterConstants.PATH_CHAT_PAGE,
      extra: {
        'conversationId': teamConversationId,
        'conversationType': type,
      },
    );
  } else {
    Navigator.pushNamedAndRemoveUntil(context, RouterConstants.PATH_CHAT_PAGE,
        ModalRoute.withName(RouterConstants.PATH_CHAT_PAGE),
        arguments: {
          'conversationId': teamConversationId,
          'conversationType': type,
        });
  }
}