goToTopicChatPage<T extends Object?> function

Future<T?> goToTopicChatPage<T extends Object?>(
  1. BuildContext context,
  2. String conversationId,
  3. BotSubsessionTopicContext topicContext
)

Implementation

Future<T?> goToTopicChatPage<T extends Object?>(
  BuildContext context,
  String conversationId,
  BotSubsessionTopicContext topicContext,
) {
  if (ChatKitUtils.isDesktopOrWeb && _desktopChatNavigator != null) {
    Navigator.popUntil(context, (route) => route.isFirst);
    _desktopChatNavigator!(
      conversationId,
      forceLinearChat: false,
      topicContext: topicContext,
    );
    return Future.value(null);
  }
  if (IMKitRouter.instance.enableGoRouter) {
    return context.pushNamed(
      RouterConstants.PATH_TOPIC_CHAT_PAGE,
      extra: {
        'conversationId': conversationId,
        'topicContext': topicContext,
      },
    );
  }
  return Navigator.pushNamed(
    context,
    RouterConstants.PATH_TOPIC_CHAT_PAGE,
    arguments: {
      'conversationId': conversationId,
      'topicContext': topicContext,
    },
  );
}