title: Bloc stream how does it get populated
body: <p>I have the following home page within my app:</p>
  
  <pre><code>class HomePage extends StatelessWidget {
  
  @override
  Widget build(BuildContext context) {
  final CategoriesBloc _categoriesBloc = BlocProvider.of&lt;CategoriesBloc&gt;(context);
  
  return Scaffold(
      appBar: AppBar(
        title: Text('E-Commerce'),
        centerTitle: true,
        actions: &lt;Widget&gt;[CartButton()],
      ),
      body: StreamBuilder(
        stream: _categoriesBloc.outCategories,
        builder: (BuildContext context, AsyncSnapshot&lt;List&lt;Category&gt;&gt; categories) {
          if (categories.hasData) {
            return ListView.builder(
              itemCount: categories.data.length,
              itemBuilder: (BuildContext context, int index) {
                return ListTile(
                    title: Text(categories.data[index].name,
                        style: TextStyle(fontSize: 24.0)),
                    onTap: () =&gt; Navigator.of(context).push(MaterialPageRoute(
                        builder: (BuildContext context) =&gt; BlocProvider&lt;ProductsBloc&gt;(
                              child: SelectedCategoryPage(),
                              bloc: ProductsBloc(categories.data[index]),
                            ))));
              },
            );
          }
          return SizedBox();
        },
      ));
  }}
  </code></pre>
  
  <p>Which utilizes the categories bloc:</p>
  
  <pre><code>class CategoriesBloc implements BlocBase {
    List&lt;Category&gt; _categories;
  
    StreamController&lt;List&lt;Category&gt;&gt; _categoriesController = 
    StreamController&lt;List&lt;Category&gt;&gt;();
    Sink&lt;List&lt;Category&gt;&gt; get _inCategories =&gt; _categoriesController.sink;
    Stream&lt;List&lt;Category&gt;&gt; get outCategories =&gt; _categoriesController.stream;
  
    CategoriesBloc() {
      getCategories();
    }
  
    void getCategories() {
      DbApi dbApi = DbApi();
      _categories = dbApi.getCategories();
      _inCategories.add(_categories);
    }
  
    @override
    void dispose() {
     _categoriesController.close();
    }
  }
  </code></pre>
  
  <p>I'm currently following a Udemy course trying to learn Flutter, my question which the instructor hasn't answered is, you see the following line:</p>
  
  <pre><code>stream: _categoriesBloc.outCategories,
  </code></pre>
  
  <p>This returns all categories with no issue, but how does it access the data? because from the category bloc I only populate _inCategories with data? I've gone through all the code and I can't find anywhere where outCategories gets populated? </p>
  
  <p>Looking for clarification into how this actually works would be great.</p>