lazyPut<S> static method

void lazyPut<S>(
  1. S builder(), {
  2. String? tag,
  3. bool permanent = false,
  4. bool isFactory = false,
})

Registers a builder that will be executed only when the dependency is first requested.

Parameters:

  • builder: A function that creates the dependency instance.
  • tag: Optional unique identifier for the instance.
  • permanent: If true, the registration persists through a reset.
  • isFactory: If true, a new instance is created every time find is called.

Implementation

static void lazyPut<S>(S Function() builder,
    {String? tag, bool permanent = false, bool isFactory = false}) {
  currentScope.lazyPut<S>(builder,
      tag: tag, permanent: permanent, isFactory: isFactory);
}