delete<S> static method

bool delete<S>({
  1. String? tag,
  2. bool force = false,
})

Removes the registration for S and disposes of the instance.

If the instance implements LevitScopeDisposable, its onClose method is called.

Parameters:

  • tag: The unique identifier used during registration.
  • force: If true, deletes even if the dependency was marked as permanent.

Returns true if a registration was found and removed.

Implementation

static bool delete<S>({String? tag, bool force = false}) {
  return currentScope.delete<S>(tag: tag, force: force);
}