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 |