Repository: flutter
Issue: Better error message when adding Futures into the widget tree
Labels: framework,dependency: dart,d: api docs,has reproducible steps,P3,found in release: 3.0,found in release: 3.1,team-framework,triaged-framework

EDIT: It seems I must use setState() for it to work. Not directly returning from the async function. But still I think a better error message is needed.

## Steps to Reproduce

```dart
import 'package:flutter/material.dart';
import 'dart:io';
import 'dart:convert';

class Report extends StatelessWidget {
  makeRequest() async {
    var _httpClient = new HttpClient();
  
    try {
      return 'OK';
    } catch (exception) {
      return 'OH NO!';
    }
  }

  @override
  Widget build(BuildContext context) {
    return new Text(makeRequest());
  }
}
```

## Logs

<details>
<summary> Logs</summary>

```
I/flutter ( 4208): ══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
[   +3 ms] I/flutter ( 4208): The following assertion was thrown building Report(dirty):
[        ] I/flutter ( 4208): type '_Future' is not a subtype of type 'String' of 'data' where
[        ] I/flutter ( 4208):   _Future is from dart:async
[        ] I/flutter ( 4208):   String is from dart:core
[  +32 ms] I/flutter ( 4208): Either the assertion indicates an error in the framework itself, or we should provide substantially
[        ] I/flutter ( 4208): more information in this error message to help you determine and fix the underlying cause.
[        ] I/flutter ( 4208): In either case, please report this assertion by filing a bug on GitHub:
[        ] I/flutter ( 4208):   https://github.com/flutter/flutter/issues/new
[        ] I/flutter ( 4208): When the exception was thrown, this was the stack:
[  +10 ms] I/flutter ( 4208): #0      new Text (package:flutter/src/widgets/text.dart:203)
[        ] I/flutter ( 4208): #1      Report.build (file:///Users/gorjan/Projects/aero/lib/widgets/Report.dart:32)
[        ] I/flutter ( 4208): #2      StatelessElement.build (package:flutter/src/widgets/framework.dart:3678)
[  +10 ms] I/flutter ( 4208): #3      ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3625)
[        ] I/flutter ( 4208): #4      Element.rebuild (package:flutter/src/widgets/framework.dart:3478)
[        ] I/flutter ( 4208): #5      ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3605)
[        ] I/flutter ( 4208): #6      ComponentElement.mount (package:flutter/src/widgets/framework.dart:3600)
[        ] I/flutter ( 4208): #7      Element.inflateWidget (package:flutter/src/widgets/framework.dart:2890)
[        ] I/flutter ( 4208): #8      Element.updateChild (package:flutter/src/widgets/framework.dart:2693)
[        ] I/flutter ( 4208): #9      ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3636)
[  +10 ms] I/flutter ( 4208): #10     Element.rebuild (package:flutter/src/widgets/framework.dart:3478)
[        ] I/flutter ( 4208): #11     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3605)
[        ] I/flutter ( 4208): #12     ComponentElement.mount (package:flutter/src/widgets/framework.dart:3600)
[        ] I/flutter ( 4208): #13     Element.inflateWidget (package:flutter/src/widgets/framework.dart:2890)
[        ] I/flutter ( 4208): #14     Element.updateChild (package:flutter/src/widgets/framework.dart:2693)
[        ] I/flutter ( 4208): #15     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3636)
[        ] I/flutter ( 4208): #16     Element.rebuild (package:flutter/src/widgets/framework.dart:3478)
[        ] I/flutter ( 4208): #17     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3605)
[        ] I/flutter ( 4208): #18     ComponentElement.mount (package:flutter/src/widgets/framework.dart:3600)
[        ] I/flutter ( 4208): #19     ParentDataElement.mount (package:flutter/src/widgets/framework.dart:3916)
[        ] I/flutter ( 4208): #20     Element.inflateWidget (package:flutter/src/widgets/framework.dart:2890)
[        ] I/flutter ( 4208): #21     MultiChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4716)
[        ] I/flutter ( 4208): #22     Element.inflateWidget (package:flutter/src/widgets/framework.dart:2890)
[        ] I/flutter ( 4208): #23     Element.updateChild (package:flutter/src/widgets/framework.dart:2693)
[        ] I/flutter ( 4208): #24     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3636)
[        ] I/flutter ( 4208): #25     Element.rebuild (package:flutter/src/widgets/framework.dart:3478)
[        ] I/flutter ( 4208): #26     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3605)
[        ] I/flutter ( 4208): #27     ComponentElement.mount (package:flutter/src/widgets/framework.dart:3600)
[        ] I/flutter ( 4208): #28     Element.inflateWidget (package:flutter/src/widgets/framework.dart:2890)
[        ] I/flutter ( 4208): #29     Element.updateChild (package:flutter/src/widgets/framework.dart:2693)
[        ] I/flutter ( 4208): #30     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3636)
[        ] I/flutter ( 4208): #31     Element.rebuild (package:flutter/src/widgets/framework.dart:3478)
[        ] I/flutter ( 4208): #32     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3605)
[        ] I/flutter ( 4208): #33     StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3741)
[        ] I/flutter ( 4208): #34     ComponentElement.mount (package:flutter/src/widgets/framework.dart:3600)
[        ] I/flutter ( 4208): #35     Element.inflateWidget (package:flutter/src/widgets/framework.dart:2890)
[        ] I/flutter ( 4208): #36     Element.updateChild (package:flutter/src/widgets/framework.dart:2693)
[        ] I/flutter ( 4208): #37     SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4611)
[        ] I/flutter ( 4208): #38     Element.inflateWidget (package:flutter/src/widgets/framework.dart:2890)
[        ] I/flutter ( 4208): #39     Element.updateChild (package:flutter/src/widgets/framework.dart:2693)
[        ] I/flutter ( 4208): #40     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3636)
[        ] I/flutter ( 4208): #41     Element.rebuild (package:flutter/src/widgets/framework.dart:3478)
[        ] I/flutter ( 4208): #42     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3605)
[        ] I/flutter ( 4208): #43     ComponentElement.mount (package:flutter/src/widgets/framework.dart:3600)
[        ] I/flutter ( 4208): #44     Element.inflateWidget (package:flutter/src/widgets/framework.dart:2890)
[        ] I/flutter ( 4208): #45     Element.updateChild (package:flutter/src/widgets/framework.dart:2693)
[        ] I/flutter ( 4208): #46     SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4611)
[        ] I/flutter ( 4208): #47     Element.inflateWidget (package:flutter/src/widgets/framework.dart:2890)
[        ] I/flutter ( 4208): #48     Element.updateChild (package:flutter/src/widgets/framework.dart:2693)
[        ] I/flutter ( 4208): #49     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3636)
[        ] I/flutter ( 4208): #50     Element.rebuild (package:flutter/src/widgets/framework.dart:3478)
[        ] I/flutter ( 4208): #51     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3605)
[        ] I/flutter ( 4208): #52     StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3741)
[        ] I/flutter ( 4208): #53     ComponentElement.mount (package:flutter/src/widgets/framework.dart:3600)
[        ] I/flutter ( 4208): #54     Element.inflateWidget (package:flutter/src/widgets/framework.dart:2890)
[        ] I/flutter ( 4208): #55     Element.updateChild (package:flutter/src/widgets/framework.dart:2693)
[        ] I/flutter ( 4208): #56     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3636)
[        ] I/flutter ( 4208): #57     Element.rebuild (package:flutter/src/widgets/framework.dart:3478)
[        ] I/flutter ( 4208): #58     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3605)
[        ] I/flutter ( 4208): #59     StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3741)
[        ] I/flutter ( 4208): #60     ComponentElement.mount (package:flutter/src/widgets/framework.dart:3600)
[        ] I/flutter ( 4208): #61     Element.inflateWidget (package:flutter/src/widgets/framework.dart:2890)
[        ] I/flutter ( 4208): #62     Element.updateChild (package:flutter/src/widgets/framework.dart:2693)
[        ] I/flutter ( 4208): #63     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3636)
[        ] I/flutter ( 4208): #64     Element.rebuild (package:flutter/src/widgets/framework.dart:3478)
[        ] I/flutter ( 4208): #65     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3605)
[        ] I/flutter ( 4208): #66     ComponentElement.mount (package:flutter/src/widgets/framework.dart:3600)
[        ] I/flutter ( 4208): #67     Element.inflateWidget (package:flutter/src/widgets/framework.dart:2890)
[        ] I/flutter ( 4208): #68     Element.updateChild (package:flutter/src/widgets/framework.dart:2693)
[        ] I/flutter ( 4208): #69     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3636)
[        ] I/flutter ( 4208): #70     Element.rebuild (package:flutter/src/widgets/framework.dart:3478)
[        ] I/flutter ( 4208): #71     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3605)
[        ] I/flutter ( 4208): #72     ComponentElement.mount (package:flutter/src/widgets/framework.dart:3600)
[        ] I/flutter ( 4208): #73     Element.inflateWidget (package:flutter/src/widgets/framework.dart:2890)
[        ] I/flutter ( 4208): #74     Element.updateChild (package:flutter/src/widgets/framework.dart:2693)
[        ] I/flutter ( 4208): #75     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3636)
[        ] I/flutter ( 4208): #76     Element.rebuild (package:flutter/src/widgets/framework.dart:3478)
[        ] I/flutter ( 4208): #77     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3605)
[        ] I/flutter ( 4208): #78     StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3741)
[        ] I/flutter ( 4208): #79     ComponentElement.mount (package:flutter/src/widgets/framework.dart:3600)
[        ] I/flutter ( 4208): #80     Element.inflateWidget (package:flutter/src/widgets/framework.dart:2890)
[        ] I/flutter ( 4208): #81     Element.updateChild (package:flutter/src/widgets/framework.dart:2693)
[        ] I/flutter ( 4208): #82     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3636)
[        ] I/flutter ( 4208): #83     Element.rebuild (package:flutter/src/widgets/framework.dart:3478)
[        ] I/flutter ( 4208): #84     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3605)
[        ] I/flutter ( 4208): #85     StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3741)
[        ] I/flutter ( 4208): #86     ComponentElement.mount (package:flutter/src/widgets/framework.dart:3600)
[        ] I/flutter ( 4208): #87     Element.inflateWidget (package:flutter/src/widgets/framework.dart:2890)
[        ] I/flutter ( 4208): #88     Element.updateChild (package:flutter/src/widgets/framework.dart:2693)
[        ] I/flutter ( 4208): #89     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3636)
[        ] I/flutter ( 4208): #90     Element.rebuild (package:flutter/src/widgets/framework.dart:3478)
[        ] I/flutter ( 4208): #91     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3605)
[        ] I/flutter ( 4208): #92     ComponentElement.mount (package:flutter/src/widgets/framework.dart:3600)
[        ] I/flutter ( 4208): #93     Element.inflateWidget (package:flutter/src/widgets/framework.dart:2890)
[        ] I/flutter ( 4208): #94     Element.updateChild (package:flutter/src/widgets/framework.dart:2693)
[        ] I/flutter ( 4208): #95     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3636)
[        ] I/flutter ( 4208): #96     Element.rebuild (package:flutter/src/widgets/framework.dart:3478)
[        ] I/flutter ( 4208): #97     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3605)
[        ] I/flutter ( 4208): #98     ComponentElement.mount (package:flutter/src/widgets/framework.dart:3600)
[        ] I/flutter ( 4208): #99     Element.inflateWidget (package:flutter/src/widgets/framework.dart:2890)
[        ] I/flutter ( 4208): #100    Element.updateChild (package:flutter/src/widgets/framework.dart:2693)
[        ] I/flutter ( 4208): #101    SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4611)
[        ] I/flutter ( 4208): #102    Element.inflateWidget (package:flutter/src/widgets/framework.dart:2890)
[        ] I/flutter ( 4208): #103    Element.updateChild (package:flutter/src/widgets/framework.dart:2693)
[        ] I/flutter ( 4208): #104    SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4611)
[        ] I/flutter ( 4208): #105    Element.inflateWidget (package:flutter/src/widgets/framework.dart:2890)
[        ] I/flutter ( 4208): #106    Element.updateChild (package:flutter/src/widgets/framework.dart:2693)
[        ] I/flutter ( 4208): #107    SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4611)
[        ] I/flutter ( 4208): #108    Element.inflateWidget (package:flutter/src/widgets/framework.dart:2890)
[        ] I/flutter ( 4208): #109    Element.updateChild (package:flutter/src/widgets/framework.dart:2693)
[        ] I/flutter ( 4208): #110    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3636)
[        ] I/flutter ( 4208): #111    Element.rebuild (package:flutter/src/widgets/framework.dart:3478)
[        ] I/flutter ( 4208): #112    ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3605)
[        ] I/flutter ( 4208): #113    StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3741)
[        ] I/flutter ( 4208): #114    ComponentElement.mount (package:flutter/src/widgets/framework.dart:3600)
[        ] I/flutter ( 4208): #115    Element.inflateWidget (package:flutter/src/widgets/framework.dart:2890)
[        ] I/flutter ( 4208): #116    Element.updateChild (package:flutter/src/widgets/framework.dart:2693)
[        ] I/flutter ( 4208): #117    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3636)
[        ] I/flutter ( 4208): #118    Element.rebuild (package:flutter/src/widgets/framework.dart:3478)
[        ] I/flutter ( 4208): #119    ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3605)
[        ] I/flutter ( 4208): #120    ComponentElement.mount (package:flutter/src/widgets/framework.dart:3600)
[        ] I/flutter ( 4208): #121    Element.inflateWidget (package:flutter/src/widgets/framework.dart:2890)
[        ] I/flutter ( 4208): #122    Element.updateChild (package:flutter/src/widgets/framework.dart:2693)
[        ] I/flutter ( 4208): #123    SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4611)
[        ] I/flutter ( 4208): #124    Element.inflateWidget (package:flutter/src/widgets/framework.dart:2890)
[        ] I/flutter ( 4208): #125    Element.updateChild (package:flutter/src/widgets/framework.dart:2693)
[        ] I/flutter ( 4208): #126    SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4611)
[        ] I/flutter ( 4208): #127    Element.inflateWidget (package:flutter/src/widgets/framework.dart:2890)
[        ] I/flutter ( 4208): #128    Element.updateChild (package:flutter/src/widgets/framework.dart:2693)
[        ] I/flutter ( 4208): #129    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3636)
[        ] I/flutter ( 4208): #130    Element.rebuild (package:flutter/src/widgets/framework.dart:3478)
[        ] I/flutter ( 4208): #131    ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3605)
[        ] I/flutter ( 4208): #132    ComponentElement.mount (package:flutter/src/widgets/framework.dart:3600)
[        ] I/flutter ( 4208): #133    Element.inflateWidget (package:flutter/src/widgets/framework.dart:2890)
[        ] I/flutter ( 4208): #134    Element.updateChild (package:flutter/src/widgets/framework.dart:2693)
[        ] I/flutter ( 4208): #135    SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4611)
[        ] I/flutter ( 4208): #136    Element.inflateWidget (package:flutter/src/widgets/framework.dart:2890)
[        ] I/flutter ( 4208): #137    Element.updateChild (package:flutter/src/widgets/framework.dart:2693)
[        ] I/flutter ( 4208): #138    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3636)
[        ] I/flutter ( 4208): #139    Element.rebuild (package:flutter/src/widgets/framework.dart:3478)
[        ] I/flutter ( 4208): #140    ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3605)
[        ] I/flutter ( 4208): #141    StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3741)
[        ] I/flutter ( 4208): #142    ComponentElement.mount (package:flutter/src/widgets/framework.dart:3600)
[        ] I/flutter ( 4208): #143    Element.inflateWidget (package:flutter/src/widgets/framework.dart:2890)
```
</details>



## Flutter Doctor
```
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, v0.1.5, on Mac OS X 10.13.3 17D102, locale en-MK)
[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
[✓] iOS toolchain - develop for iOS devices (Xcode 9.2)
[✓] Android Studio (version 3.0)
[✓] VS Code (version 1.20.1)
[✓] Connected devices (1 available)

• No issues found!
```