title: Flutter: type 'List<dynamic>' is not a subtype of type 'List<Widget>'
body: <p>I am developing a simple todo app using flutter.</p>
  
  <p>The app has multiple Views and tables (SQLite).</p>
  
  <ol>
  <li>Todo (StatelessWidget)</li>
  <li>Tag (StatefulWidget)</li>
  </ol>
  
  <p>In the case of Todo ui, it works fine, but Tag ui doesn't work.</p>
  
  <p>First code is Todo ui. (works fine).</p>
  
  <pre class="lang-dart prettyprint-override"><code>class TodosPage extends StatelessWidget {
  
    final TodoRepository _todoRepository;
    final TodosBloc bloc;
  
    TodosPage(this._todoRepository) : this.bloc = TodosBloc(_todoRepository);
  
    @override
    Widget build(BuildContext context) {
      return Scaffold(
        body: Center(
          child: StreamBuilder&lt;List&lt;Todo&gt;&gt;(
              stream: bloc.todos,
              builder: (context, snapshot) {
                if (snapshot.data == null) {
                  return Text("Empty");
                }
  
                return ListView(
                  children: snapshot.data.map(_buildItem).toList(),
                );
              }),
        ),
      );
    }
  
    Widget _buildItem(Todo todo) =&gt; Text(todo.name);
  </code></pre>
  
  <p>and here is Tag ui (It doesn't work).</p>
  
  <pre class="lang-dart prettyprint-override"><code>class TagsPage extends StatefulWidget {
    final TagRepository _tagRepository;
  
    TagsPage(this._tagRepository);
  
    @override
    State&lt;StatefulWidget&gt; createState() =&gt; _TagsState(_tagRepository);
  }
  
  class _TagsState extends State&lt;TagsPage&gt; {
    final TagRepository _tagRepository;
    final TagsBloc bloc;
  
    _TagsState(this._tagRepository) : this.bloc = TagsBloc(_tagRepository);
  
    @override
    Widget build(BuildContext context) =&gt; Scaffold(
          body: Center(
            child: StreamBuilder&lt;List&lt;Tag&gt;&gt;(
              stream: bloc.tags,
              builder: (context, snapshot) {
                if (snapshot.data == null || snapshot.data.isEmpty) {
                  print("[TagsPage][JOS] build - snapshot.data is null");
                } else {
                  return ListView(
                    children: snapshot.data.map(_buildTagItem).toList(),
                  );
                }
              },
            ),
          ),
        );
  
    _buildTagItem(Tag tag) =&gt; Text(tag.name);
  }
  </code></pre>
  
  <p>and the TagBloc is here:</p>
  
  <pre class="lang-dart prettyprint-override"><code>class TagsBloc {
    final TagRepository _tagRepository;
    final _getTagsSubject = PublishSubject&lt;List&lt;Tag&gt;&gt;();
  
    Stream&lt;List&lt;Tag&gt;&gt; get tags =&gt; _getTagsSubject.stream;
  
    TagsBloc(this._tagRepository) {
      _getTags();
    }
  
    Future&lt;Null&gt; _getTags() async {
      await _tagRepository.getAll().then((list) {
        _getTagsSubject.add(list);
      });
    }
  }
  
  </code></pre>
  
  <p>When I run, Tag ui show the below error log:</p>
  
  <pre><code>04-07 00:13:45.698 25181-25195/com.youknow.jos I/flutter: ══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
  04-07 00:13:45.708 25181-25195/com.youknow.jos I/flutter: The following assertion was thrown building StreamBuilder&lt;List&lt;Tag&gt;&gt;(dirty, dependencies:
  04-07 00:13:45.708 25181-25195/com.youknow.jos I/flutter: [_LocalizationsScope-[GlobalKey#49b9d], _InheritedTheme], state: _StreamBuilderBaseState&lt;List&lt;Tag&gt;,
  04-07 00:13:45.708 25181-25195/com.youknow.jos I/flutter: AsyncSnapshot&lt;List&lt;Tag&gt;&gt;&gt;#65ac3):
  04-07 00:13:45.708 25181-25195/com.youknow.jos I/flutter: type 'List&lt;dynamic&gt;' is not a subtype of type 'List&lt;Widget&gt;'
  04-07 00:13:45.715 25181-25195/com.youknow.jos I/flutter: Either the assertion indicates an error in the framework itself, or we should provide substantially
  04-07 00:13:45.715 25181-25195/com.youknow.jos I/flutter: more information in this error message to help you determine and fix the underlying cause.
  04-07 00:13:45.715 25181-25195/com.youknow.jos I/flutter: In either case, please report this assertion by filing a bug on GitHub:
  04-07 00:13:45.715 25181-25195/com.youknow.jos I/flutter:   https://github.com/flutter/flutter/issues/new?template=BUG.md
  04-07 00:13:45.715 25181-25195/com.youknow.jos I/flutter: When the exception was thrown, this was the stack:
  04-07 00:13:45.724 25181-25195/com.youknow.jos I/flutter: #0      _TagsState.build.&lt;anonymous closure&gt; (package:jos/pages/tags.dart:49:62)
  </code></pre>
  
  <p>The Todo and Tag has no difference.
  I think the only difference is StatefulWidget/StatelessWidget.
  I don't know how can I resolve this issue.</p>