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;
    stateController.close();
    errorController.close();
    analyticsEventController.close();
    subxList.cancelAll();
    subxMap.cancelAll();

    for (final publisher in publishers) {
      publisher.close();
    }
  }
}