# getUserAvatarData method

Future <Result<AvatarError, UserAvatarData>> getUserAvatarData(

1. JID jid,
2. String id

)

Requests the avatar from `jid`. Returns the avatar data if the request was successful. Null otherwise

## Implementation

    Future<Result<AvatarError, UserAvatarData>> getUserAvatarData(
      JID jid,
      String id,
    ) async {
      final pubsub = _getPubSubManager();
      final resultRaw = await pubsub.getItem(jid, userAvatarDataXmlns, id);
      if (resultRaw.isType<PubSubError>()) return Result(UnknownAvatarError());

      final result = resultRaw.get<PubSubItem>();
      return Result(
        UserAvatarData(
          result.payload.innerText(),
          id,
        ),
      );
    }