Consider this (textbook) sample dart code:
// Sequential processing using async and await.
main() async {
await expensiveA();
await expensiveB();
doSomethingWith(await expensiveC());
}
I understand that await will wait for the result of the future "expensiveA" to complete before continuing.
But what I don't understand is why main() must itself be declared async? Apparently you have to do this or the program will not compile. But why can a synchronous method not await the result of asynchronous calls?
I understand this must be a newbie question but I have not been able to find an answer for this yet.