factory<S> static method

Bind<S> factory<S>(
  1. InstanceBuilderCallback<S> builder, {
  2. bool autoRemove = true,
  3. bool assignId = true,
  4. String? tag,
})

Creates a binding with the specified controller factory. This is a more flexible way to create a binding, as it allows you to specify a custom factory function.

Implementation

static Bind<S> factory<S>(
  InstanceBuilderCallback<S> builder, {
  bool autoRemove = true,
  bool assignId = true,
  String? tag,
}) => _FactoryBind<S>(
  init: () => builder(),
  autoRemove: autoRemove,
  assignId: assignId,
  tag: tag,
);