toModel method

User toModel()

Constructs a new User from this UserMixin.

Implementation

User toModel() => User(
  id,
  this.num,
  name: name,
  bio: bio,
  avatar: avatar?.toModel(),
  callCover: callCover?.toModel(),
  online: online?.$$typename == 'UserOnline',
  lastSeenAt:
      online?.$$typename == 'UserOffline'
          ? (online as UserMixin$Online$UserOffline).lastSeenAt
          : null,
  dialog: dialog?.id,
  presenceIndex: presence?.index,
  status: status,
  isDeleted: isDeleted,
  isBlocked: isBlocked.record?.toModel(id),
  welcomeMessage: welcomeMessage?.toModel(),
);