registerLazySingleton<T extends Object> abstract method

void registerLazySingleton<T extends Object>(
  1. T factoryFunction(
    1. GetIt
    ), {
  2. String? instanceName,
})

Registers a new lazy singleton object

This method takes a single argument, factoryFunction, which is a function that returns an instance of the type T.

It also takes an optional argument, instanceName, which is the name of the instance to be registered.

factoryFunction is a function that returns an instance of the type T.

instanceName is the name of the instance to be registered.

Implementation

void registerLazySingleton<T extends Object>(
  T Function(GetIt) factoryFunction, {
  String? instanceName,
});