loading...

re: Explain Futures and Streams in Dart like I'm Five VIEW POST

FULL DISCUSSION
 

I type
asyncRequest().then((result) => print(result));
and it works.

If I want to use result outside this line how to proceed?
I've tried this, but it didn't work:

String x;
asyncRequest().then((result) => x=result);
print (x);

It shows x=null;

Code of Conduct Report abuse