lazyReplace<P> method

void lazyReplace<P>(
  1. InstanceBuilderCallback<P> builder, {
  2. String? tag,
  3. bool? fenix,
})

Registers a lazy singleton dependency, replacing any existing dependency.

Implementation

void lazyReplace<P>(
  InstanceBuilderCallback<P> builder, {
  String? tag,
  bool? fenix,
}) {
  final InstanceInfo info = Get.getInstanceInfo<P>(tag: tag);
  final bool permanent = info.isPermanent ?? false;
  delete<P>(tag: tag, force: permanent);
  lazyPut(builder, tag: tag, fenix: fenix ?? permanent);
}