lazyPut<S> static method

Bind lazyPut<S>(
  1. InstanceBuilderCallback<S> builder, {
  2. String? tag,
  3. bool fenix = true,
  4. VoidCallback? onClose,
})

Creates a lazy binding and puts the specified dependency into the GetX service locator.

Returns the binding created.

Implementation

static Bind<dynamic> lazyPut<S>(
  InstanceBuilderCallback<S> builder, {
  String? tag,
  bool fenix = true,
  VoidCallback? onClose,
}) {
  Get.lazyPut<S>(builder, tag: tag, fenix: fenix);
  return _FactoryBind<S>(
    tag: tag,
    dispose: (_) {
      onClose?.call();
    },
  );
}