goToChatAndClearStack function
void
goToChatAndClearStack(
- BuildContext context,
- String teamConversationId,
- NIMConversationType type, {
- NIMMessage? message,
- int? anchorDate,
跳转到会话页面,并清空栈
Implementation
void goToChatAndClearStack(
BuildContext context, String teamConversationId, NIMConversationType type,
{NIMMessage? message, int? anchorDate}) {
if (IMKitRouter.instance.enableGoRouter) {
context.go(
RouterConstants.PATH_CHAT_PAGE,
extra: {
'conversationId': teamConversationId,
'conversationType': type,
'anchor': message,
'anchorDate': anchorDate,
},
);
} else {
Navigator.pushNamedAndRemoveUntil(context, RouterConstants.PATH_CHAT_PAGE,
ModalRoute.withName(RouterConstants.PATH_CHAT_PAGE),
arguments: {
'conversationId': teamConversationId,
'conversationType': type,
'anchor': message,
'anchorDate': anchorDate,
});
}
}