GenericApplicationContext.withParent constructor

GenericApplicationContext.withParent(
  1. ApplicationContext parent, [
  2. DefaultListablePodFactory? podFactory
])

Creates a new GenericApplicationContext with the given parent context.

This constructor establishes a parent-child relationship between contexts, allowing the child context to delegate pod lookups to the parent when pods are not found locally.

Parameters:

  • parent: The parent application context
  • podFactory: Optional custom pod factory instance

Example:

final parentContext = GenericApplicationContext();
await parentContext.refresh();

final childContext = GenericApplicationContext.withParent(parentContext);
// Child can access pods from parent context

Implementation

GenericApplicationContext.withParent(ApplicationContext parent, [DefaultListablePodFactory? podFactory]) : this.all(parent, podFactory);