Repository: flutter
Issue: Improve error messages for indirectly caused type-errors
Labels: team,framework,a: error message,P2,team-framework,triaged-framework

So, I already found the solution and it was definitely my problem. However, I think the error message can be improved. Basically, I wanted to write a `StreamToListWidget` with dynamic typing. The following code (1) can compile, but when used like this (2) it gives the error message (3). I could fix it by changing this line (4).
 
1
```dart
import 'package:flutter/material.dart';

class StreamToListWidget<T> extends StatefulWidget {
  final Widget Function(T) mapper;
  final Stream<T> stream;

  StreamToListWidget(this.stream,
      this.mapper,) : super();

  @override
  _StreamToListWidgetState createState() =>
      _StreamToListWidgetState(stream, mapper);
}

class _StreamToListWidgetState<T> extends State<StreamToListWidget> {
  Stream<T> stream;
  List<T> content;
  final Widget Function(T) mapper;

  _StreamToListWidgetState(this.stream, this.mapper) {
//    content = List();
//    print("_StreamToListWidgetState created");
//    stream.listen((entry)  {
//      print("Received Widget: ${widget}");
//      setState(() {
//        content.add(entry);
//      });
//    });
  }

  @override
  Widget build(BuildContext context) {
    return Row(
      children: <Widget>[Text("Hallo")],
    );
  }
}

```

2
```
StreamToListWidget(
                    Stream.fromIterable(["123", "foo"]),
                    (String text) =>
                        Text("$text"),
                  )
```

3
```
I/flutter ( 2223): ══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
I/flutter ( 2223): The following assertion was thrown building FutureBuilder<Reddit>(state:
I/flutter ( 2223): _FutureBuilderState<Reddit>#75b87):
I/flutter ( 2223): type '(String) => Text' is not a subtype of type '(dynamic) => Widget'
I/flutter ( 2223): 
I/flutter ( 2223): Either the assertion indicates an error in the framework itself, or we should provide substantially
I/flutter ( 2223): more information in this error message to help you determine and fix the underlying cause.
I/flutter ( 2223): In either case, please report this assertion by filing a bug on GitHub:
I/flutter ( 2223):   https://github.com/flutter/flutter/issues/new?template=BUG.md
I/flutter ( 2223): 
I/flutter ( 2223): When the exception was thrown, this was the stack:
I/flutter ( 2223): #0      StreamToListWidget.createState (package:offline_reddit/wrappedFuture.dart:30:40)
I/flutter ( 2223): #1      new StatefulElement (package:flutter/src/widgets/framework.dart:3789:23)
I/flutter ( 2223): #2      StatefulWidget.createElement (package:flutter/src/widgets/framework.dart:795:38)
I/flutter ( 2223): #3      Element.inflateWidget (package:flutter/src/widgets/framework.dart:2948:40)
I/flutter ( 2223): #4      Element.updateChild (package:flutter/src/widgets/framework.dart:2753:12)
I/flutter ( 2223): #5      ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
I/flutter ( 2223): #6      Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter ( 2223): #7      StatefulElement.update (package:flutter/src/widgets/framework.dart:3878:5)
I/flutter ( 2223): #8      Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 2223): #9      SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4867:14)
I/flutter ( 2223): #10     Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 2223): #11     SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4867:14)
I/flutter ( 2223): #12     Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 2223): #13     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
I/flutter ( 2223): #14     Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter ( 2223): #15     StatelessElement.update (package:flutter/src/widgets/framework.dart:3781:5)
I/flutter ( 2223): #16     Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 2223): #17     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
I/flutter ( 2223): #18     Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter ( 2223): #19     ProxyElement.update (package:flutter/src/widgets/framework.dart:3990:5)
I/flutter ( 2223): #20     Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 2223): #21     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
I/flutter ( 2223): #22     Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter ( 2223): #23     StatefulElement.update (package:flutter/src/widgets/framework.dart:3878:5)
I/flutter ( 2223): #24     Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 2223): #25     SliverMultiBoxAdaptorElement.updateChild (package:flutter/src/widgets/sliver.dart:1028:36)
I/flutter ( 2223): #26     SliverMultiBoxAdaptorElement.performRebuild.processElement (package:flutter/src/widgets/sliver.dart:978:34)
I/flutter ( 2223): #27     List.forEach (dart:core/runtime/libgrowable_array.dart:278:8)
I/flutter ( 2223): #28     SliverMultiBoxAdaptorElement.performRebuild (package:flutter/src/widgets/sliver.dart:989:36)
I/flutter ( 2223): #29     SliverMultiBoxAdaptorElement.update (package:flutter/src/widgets/sliver.dart:955:7)
I/flutter ( 2223): #30     Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 2223): #31     SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4867:14)
I/flutter ( 2223): #32     Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 2223): #33     RenderObjectElement.updateChildren (package:flutter/src/widgets/framework.dart:4585:32)
I/flutter ( 2223): #34     MultiChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4975:17)
I/flutter ( 2223): #35     Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 2223): #36     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
I/flutter ( 2223): #37     Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter ( 2223): #38     ProxyElement.update (package:flutter/src/widgets/framework.dart:3990:5)
I/flutter ( 2223): #39     Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 2223): #40     SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4867:14)
I/flutter ( 2223): #41     Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 2223): #42     SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4867:14)
I/flutter ( 2223): #43     Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 2223): #44     SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4867:14)
I/flutter ( 2223): #45     Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 2223): #46     SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4867:14)
I/flutter ( 2223): #47     Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 2223): #48     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
I/flutter ( 2223): #49     Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter ( 2223): #50     StatefulElement.update (package:flutter/src/widgets/framework.dart:3878:5)
I/flutter ( 2223): #51     Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 2223): #52     SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4867:14)
I/flutter ( 2223): #53     Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 2223): #54     SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4867:14)
I/flutter ( 2223): #55     Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 2223): #56     SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4867:14)
I/flutter ( 2223): #57     Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 2223): #58     SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4867:14)
I/flutter ( 2223): #59     Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 2223): #60     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
I/flutter ( 2223): #61     Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter ( 2223): #62     StatelessElement.update (package:flutter/src/widgets/framework.dart:3781:5)
I/flutter ( 2223): #63     Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 2223): #64     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
I/flutter ( 2223): #65     Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter ( 2223): #66     StatefulElement.update (package:flutter/src/widgets/framework.dart:3878:5)
I/flutter ( 2223): #67     Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 2223): #68     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
I/flutter ( 2223): #69     Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter ( 2223): #70     StatefulElement.update (package:flutter/src/widgets/framework.dart:3878:5)
I/flutter ( 2223): #71     Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 2223): #72     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
I/flutter ( 2223): #73     Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter ( 2223): #74     ProxyElement.update (package:flutter/src/widgets/framework.dart:3990:5)
I/flutter ( 2223): #75     Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 2223): #76     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
I/flutter ( 2223): #77     Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter ( 2223): #78     StatelessElement.update (package:flutter/src/widgets/framework.dart:3781:5)
I/flutter ( 2223): #79     Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 2223): #80     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
I/flutter ( 2223): #81     Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter ( 2223): #82     ProxyElement.update (package:flutter/src/widgets/framework.dart:3990:5)
I/flutter ( 2223): #83     Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 2223): #84     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
I/flutter ( 2223): #85     Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter ( 2223): #86     ProxyElement.update (package:flutter/src/widgets/framework.dart:3990:5)
I/flutter ( 2223): #87     Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 2223): #88     RenderObjectElement.updateChildren (package:flutter/src/widgets/framework.dart:4585:32)
I/flutter ( 2223): #89     MultiChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4975:17)
I/flutter ( 2223): #90     Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 2223): #91     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
I/flutter ( 2223): #92     Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter ( 2223): #93     StatefulElement.update (package:flutter/src/widgets/framework.dart:3878:5)
I/flutter ( 2223): #94     Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 2223): #95     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
I/flutter ( 2223): #96     Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter ( 2223): #97     ProxyElement.update (package:flutter/src/widgets/framework.dart:3990:5)
I/flutter ( 2223): #98     Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 2223): #99     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
I/flutter ( 2223): #100    Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter ( 2223): #101    StatefulElement.update (package:flutter/src/widgets/framework.dart:3878:5)
I/flutter ( 2223): #102    Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 2223): #103    SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4867:14)
I/flutter ( 2223): #104    Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 2223): #105    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
I/flutter ( 2223): #106    Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter ( 2223): #107    StatelessElement.update (package:flutter/src/widgets/framework.dart:3781:5)
I/flutter ( 2223): #108    Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 2223): #109    SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4867:14)
I/flutter ( 2223): #110    Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 2223): #111    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
I/flutter ( 2223): #112    Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter ( 2223): #113    StatefulElement.update (package:flutter/src/widgets/framework.dart:3878:5)
I/flutter ( 2223): #114    Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 2223): #115    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
I/flutter ( 2223): #116    Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter ( 2223): #117    StatefulElement.update (package:flutter/src/widgets/framework.dart:3878:5)
I/flutter ( 2223): #118    Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 2223): #119    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
I/flutter ( 2223): #120    Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter ( 2223): #121    ProxyElement.update (package:flutter/src/widgets/framework.dart:3990:5)
I/flutter ( 2223): #122    Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 2223): #123    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
I/flutter ( 2223): #124    Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter ( 2223): #125    ProxyElement.update (package:flutter/src/widgets/framework.dart:3990:5)
I/flutter ( 2223): #126    Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 2223): #127    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
I/flutter ( 2223): #128    Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter ( 2223): #129    StatefulElement.update (package:flutter/src/widgets/framework.dart:3878:5)
I/flutter ( 2223): #130    Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 2223): #131    SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4867:14)
I/flutter ( 2223): #132    Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 2223): #133    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
I/flutter ( 2223): #134    Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter ( 2223): #135    StatelessElement.update (package:flutter/src/widgets/framework.dart:3781:5)
I/flutter ( 2223): #136    Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 2223): #137    SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4867:14)
Reloaded 1 of 588 libraries in 1,020ms.
I/flutter ( 2223): #138    Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 2223): #139    SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4867:14)
I/flutter ( 2223): #140    Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 2223): #141    SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4867:14)
I/flutter ( 2223): #142    Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 2223): #143    SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4867:14)
I/flutter ( 2223): #144    Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 2223): #145    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
I/flutter ( 2223): #146    Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter ( 2223): #147    StatefulElement.update (package:flutter/src/widgets/framework.dart:3878:5)
I/flutter ( 2223): #148    Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 2223): #149    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
I/flutter ( 2223): #150    Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter ( 2223): #151    StatelessElement.update (package:flutter/src/widgets/framework.dart:3781:5)
I/flutter ( 2223): #152    Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 2223): #153    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
I/flutter ( 2223): #154    Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter ( 2223): #155    StatefulElement.update (package:flutter/src/widgets/framework.dart:3878:5)
I/flutter ( 2223): #156    Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 2223): #157    SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4867:14)
I/flutter ( 2223): #158    Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 2223): #159    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
I/flutter ( 2223): #160    Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter ( 2223): #161    ProxyElement.update (package:flutter/src/widgets/framework.dart:3990:5)
I/flutter ( 2223): #162    Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 2223): #163    SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4867:14)
I/flutter ( 2223): #164    Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 2223): #165    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
I/flutter ( 2223): #166    Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter ( 2223): #167    StatefulElement.update (package:flutter/src/widgets/framework.dart:3878:5)
I/flutter ( 2223): #168    Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 2223): #169    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
I/flutter ( 2223): #170    Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter ( 2223): #171    StatelessElement.update (package:flutter/src/widgets/framework.dart:3781:5)
I/flutter ( 2223): #172    Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 2223): #173    SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4867:14)
I/flutter ( 2223): #174    Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 2223): #175    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
I/flutter ( 2223): #176    Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter ( 2223): #177    ProxyElement.update (package:flutter/src/widgets/framework.dart:3990:5)
I/flutter ( 2223): #178    Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 2223): #179    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
I/flutter ( 2223): #180    Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter ( 2223): #181    BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2286:33)
I/flutter ( 2223): #182    _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&SemanticsBinding&RendererBinding&WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:676:20)
I/flutter ( 2223): #183    _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&SemanticsBinding&RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:219:5)
I/flutter ( 2223): #184    _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:990:15)
I/flutter ( 2223): #185    _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:930:9)
I/flutter ( 2223): #186    _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding.scheduleWarmUpFrame.<anonymous closure> (package:flutter/src/scheduler/binding.dart:751:7)
I/flutter ( 2223): #188    _Timer._runTimers (dart:isolate/runtime/libtimer_impl.dart:382:19)
I/flutter ( 2223): #189    _Timer._handleMessage (dart:isolate/runtime/libtimer_impl.dart:416:5)
I/flutter ( 2223): #190    _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:171:12)
I/flutter ( 2223): (elided one frame from package dart:async)
I/flutter ( 2223): ════════════════════════════════════════════════════════════════════════════════════════════════════
```

4
```dart
class StreamToListWidget<T> extends StatefulWidget {
  final Widget Function(T) mapper;
  final Stream<T> stream;

  StreamToListWidget(this.stream,
      this.mapper,) : super();

  @override
  _StreamToListWidgetState createState() =>
      _StreamToListWidgetState<T>(stream, mapper); // added <T> here
}
```