run<T> method

Future<T> run<T>({
  1. required Future<T> body(),
  2. Future<void> beforeClose(
    1. Object? bodyError,
    2. StackTrace? bodyStackTrace
    )?,
})

Implementation

Future<T> run<T>({
  required Future<T> Function() body,
  Future<void> Function(Object? bodyError, StackTrace? bodyStackTrace)?
      beforeClose,
}) async {
  final outcome = await runCaptured<T>(
    body: body,
    beforeClose: beforeClose,
  );
  return outcome.requireValue();
}