safeCloseAll static method
Safely closes multiple resources
Implementation
static Future<void> safeCloseAll(
Map<String, Future<void> Function()> resources,
) async {
final futures = resources.entries.map((entry) =>
safeClose(entry.value, entry.key)
);
await Future.wait(futures);
}