# removeFromScope method

T? removeFromScope()

Removes the object from the scope if it exists.

This method can be used to force cleanup of the object from the scope, which may be necessary for certain scope types (e.g., request scope cleanup after request processing).

Returns the removed object, or null if no object was found

Example:

    // After request processing, clean up request-scoped objects
    final removed = scopedFactory.removeFromScope();
    if (removed is DisposablePod) {
      removed.destroy();
    }

## Implementation

    T? removeFromScope() {
      final removed = scope.remove(name);
      return removed?.getValue() as T?;
    }