The return type is usingAsync()
technically dynamic
because for usingAsync()
there is no annotation of the return type. Omitting a return type annotation is similar to using a dynamic
return value type annotation.
The runtime of the object returned usingAsync()
is Future<dynamic>
. Functions marked async
simply always return an object Future<dynamic>
.
usingAsync()
, "" "" int
.
import 'dart:async';
Future<int> doAsyncThing() => new Future.value(42);
usingAsync() async => doAsyncThing();
main() {
var thing = usingAsync();
print(thing.runtimeType);
thing.then((value) {
print(value);
print(value.runtimeType);
});
}
, , :
Future<int> usingAsync() async => await doAsyncThing();
, :
Future<int> usingAsync() => doAsyncThing();
, , async. .
: https://dartpad.dartlang.org/73fed0857efab196e3f9