run method

Future<void> run(
  1. FutureOr<void> block(
    1. DisposeScope scope
    )
)

Calls block only if this dispose scope is not yet disposed. Otherwise, it's a no-op.

Implementation

Future<void> run(FutureOr<void> Function(DisposeScope scope) block) async {
  if (!_disposed) {
    await block(this);
  }
}