Closed
Description
Would it be possible to return a future for all async methods? I have noticed that some async methods return void
and not Future<void>
which make then non awaitable. Is this on purpose?
Ex: I would like to await connect
but can't because it does not return a future:
@override
void connect() async {
return _connect();
}
Here _connect
returns a future, and connect
would be great this way:
Future<void> connect() async {
return await _connect();
}
// or the short way
Future<void> connect() async => _connect();
Is it possible or the actual way is by design?
Metadata
Metadata
Assignees
Labels
No labels