# retract method

Future <Result<PubSubError, bool>> retract(

1. JID host,
2. String node,
3. String itemId

)

## Implementation

    Future<Result<PubSubError, bool>> retract(
      JID host,
      String node,
      String itemId,
    ) async {
      final request = (await getAttributes().sendStanza(
        StanzaDetails(
          Stanza.iq(
            type: 'set',
            to: host.toString(),
            children: [
              XMLNode.xmlns(
                tag: 'pubsub',
                xmlns: pubsubXmlns,
                children: [
                  XMLNode(
                    tag: 'retract',
                    attributes: <String, String>{
                      'node': node,
                    },
                    children: [
                      XMLNode(
                        tag: 'item',
                        attributes: <String, String>{
                          'id': itemId,
                        },
                      ),
                    ],
                  ),
                ],
              ),
            ],
          ),
          shouldEncrypt: false,
        ),
      ))!;

      if (request.attributes['type'] != 'result') {
        // TODO(Unknown): Be more specific
        return Result(UnknownPubSubError());
      }

      return const Result(true);
    }