withApp method
Boots the application, runs body inside a command scope and shuts
the application down afterwards.
Implementation
Future<int> withApp(FutureOr<int> Function(Application app) body) async {
final app = createApp();
try {
await app.boot();
return await app.run<int>(() => body(app));
} finally {
await app.shutdown();
}
}