title: Exposing BLOC streams via fields, methods, or getter
body: <p>I am using the BLOC pattern for my latest Flutter app and I started out using something like this for my output streams:</p>
  
  <pre><code>class MyBloc {
    // Outputs
    final Stream&lt;List&lt;Todo&gt;&gt; todos;
  
    factory MyBloc(TodosInteractor interactor) {
      final todosController = BehaviorSubject&lt;List&lt;Todo&gt;&gt;()
        ..addStream(interactor.todos);
  
      return MyBloc._(todosController);
    }
  
    MyBloc._(this.todos);
  }
  </code></pre>
  
  <p>but slowly I found myself doing something more like this, using a method (or getter) after awhile:</p>
  
  <pre><code>class MyBloc {
    final TodosInteractor _interactor;
    // Outputs
    Stream&lt;List&lt;Todo&gt;&gt; todos(){
      return _interactor.todos;
    }
  
     MyBloc(this._interactor) {  }
  
  }
  </code></pre>
  
  <p>For people who want to see... getter for <code>todos</code> in <code>TodosInteractor</code>:</p>
  
  <pre><code>  Stream&lt;List&lt;Todo&gt;&gt; get todos {
      return repository
          .todos()
          .map((entities) =&gt; entities.map(Todo.fromEntity).toList());
    }
  </code></pre>
  
  <p>When I look at the differing code, I see that the first example uses a field versus a method to expose the stream but I couldn't figure out why I would choose one over the other. It seems to me that creating another controller just to push through the stream is a little much... Is there a benefit to this other than being immutable in my todos stream definition? Or am I just splitting hairs?</p>