listen method

  1. @override
StreamSubscription<State> listen(
  1. void onData(
    1. State
  2. {Function onError,
  3. void onDone(
    1. bool cancelOnError}

    Adds a subscription to the Stream<State>. Returns a StreamSubscription which handles events from the Stream<State> using the provided onData, onError and onDone handlers.


    StreamSubscription<State> listen(
      void Function(State) onData, {
      Function onError,
      void Function() onDone,
      bool cancelOnError,
    }) {
      return _stateSubject.listen(
        onError: onError,
        onDone: onDone,
        cancelOnError: cancelOnError,