Injector constructor

Injector({
  1. required BindFunc bindFunc,
  2. String? name,
  3. Injector? parent,
})

Creates an Injector from it's bindings.

Implementation

factory Injector(
    {required BindFunc bindFunc, String? name, Injector? parent}) {
  final b = parent?.child() ?? Injector.builder();
  if (name != null) b.setName(name);
  bindFunc(b);
  return b.build();
}