group<T> function
Wraps an asynchronous function call in a group.
Returns the same type as the function itself.
Implementation
Future<T?> group<T>({
required String name,
required Future<T> Function() fn,
}) async {
startGroup(name: name);
T? result;
try {
result = await fn();
} finally {
endGroup();
}
return result;
}