close method

  1. @mustCallSuper
void close()

Closes the BloC. This method should be called when the BloC is no longer needed.

Implementation

@mustCallSuper
void close() {
  if (!closed && canClose()) {
    closed = true;
    publishers.forEach((PublishSubject publisher) => publisher.close());
    stateController.close();
    errorController.close();
    subxList.cancelAll();
    subxMap.cancelAll();
  }
}