chat method

void chat(
  1. ChatId id, {
  2. RouteAs mode = RouteAs.replace,
  3. ChatItemId? itemId,
  4. ChatDirectLinkSlug? link,
})

Changes router location to the Routes.chats page.

If push is true, then location is pushed to the router location stack.

Implementation

void chat(
  ChatId id, {
  RouteAs mode = RouteAs.replace,
  ChatItemId? itemId,
  ChatDirectLinkSlug? link,
}) {
  switch (mode) {
    case RouteAs.insteadOfLast:
      routes.removeLast();
      push('${Routes.chats}/$id');
      break;

    case RouteAs.replace:
      go('${Routes.chats}/$id');
      break;

    case RouteAs.push:
      push('${Routes.chats}/$id');
      break;
  }

  arguments = {'itemId': itemId, 'link': link};
}