Skip to content

Latest commit

History

History
28 lines (15 loc) 路 798 Bytes

File metadata and controls

28 lines (15 loc) 路 798 Bytes

Return without async/await

Did you know that when a function returns a Future, you don't need to use async/await?

That works as long as the return type matches the type of the expression being returned (e.g. they are both Future<void>).


Of course, if you have more than one Future, you have to use async/await.

But you can still omit the await on the return statement at the end.



Found this useful? Show some love and share the original tweet 馃檹


Previous Next
Creating an empty Flutter project Happy Birthday with records in Dart 3