isRoute method
Indicates whether the provided route
represents this Chat.
Implementation
bool isRoute(String route, UserId? me) {
final UserId? member =
members.firstWhereOrNull((e) => e.user.id != me)?.user.id;
final bool byId = route.startsWith('${Routes.chats}/$id');
final bool byUser =
isDialog &&
member != null &&
route.startsWith('${Routes.chats}/${ChatId.local(member)}');
final bool byMonolog =
isMonolog &&
me != null &&
route.startsWith('${Routes.chats}/${ChatId.local(me)}');
return byId || byUser || byMonolog;
}