addLazySingleton<T> abstract method Null safety

void addLazySingleton<T>(
  1. Function constructor,
  2. {String? tag,
  3. DisposeCallback<T>? onDispose,
  4. NotifierCallback<T>? notifier}
)

Register a LazySingleton instance. It will generate a single instance for the duration of the application, or until manually removed.
The object will be started only when requested the first time.

injector.addLazySingleton(MyController.new);

Implementation

void addLazySingleton<T>(
  Function constructor, {
  String? tag,
  DisposeCallback<T>? onDispose,
  NotifierCallback<T>? notifier,
});