await;there are two key tools we use for this.
waitForis a fairly new Dart function which ONLY works for Dart CLI applications and can be found in the
waitForallows a Dart CLI application to turn what would normally be an async method (returning a future) into a normal synchronous method by effectively 'absorbing' a future. Normally in Dart, as soon as you have one async function, its async all of the way up.
waitFordoes however have a problem. If an exception gets thrown whilst in a
waitForcall, then the stacktrace generated will be a microtask based stack trace. These stacktraces are useless as they don't show you where the original call came from.
waitForExis my own little creation that does three things.
waitForand catches any exceptions