getOrFetchAvatar method

FutureOr<Uint8List?> getOrFetchAvatar()

If the avatar is already loaded, uses it. Otherwise, fetches the avatar from the server, but does not cache the result in memory.

May be null.

Implementation

FutureOr<Uint8List?> getOrFetchAvatar() {
  if (avatar != null) return avatar;

  if (keys?.unifiedContactId == keys?.singleContactId) {
    return UnifiedContacts.getContactImage(this.identifier);
  } else {
    return SingleContacts.getContactImage(this.identifier);
  }
}