getUserAvatar method

UserAvatar? getUserAvatar(
  1. UserId? me
)

Returns an UserAvatar of this Chat.

Implementation

UserAvatar? getUserAvatar(UserId? me) {
  switch (kind) {
    case ChatKind.monolog:
      return members.firstOrNull?.user.avatar;
    case ChatKind.dialog:
      return members.firstWhereOrNull((e) => e.user.id != me)?.user.avatar;
    case ChatKind.group:
    case ChatKind.artemisUnknown:
      return null;
  }
}