title method

String title({
  1. bool withDeletedLabel = true,
})

Returns the string representation of this User to display as a title.

If withDeletedLabel is true, then returns the title with the deleted label for deleted users.

Implementation

String title({bool withDeletedLabel = true}) {
  if (isDeleted && withDeletedLabel) {
    return 'label_deleted_account'.l10n;
  }

  return contacts.firstOrNull?.name.val ?? name?.val ?? this.num.toString();
}