withoutDependencies<T extends Object> static method

InjectableFactory withoutDependencies<T extends Object>(
  1. InjectableInstanceCreatorWithoutDependencies<T> creator, {
  2. InjectableScope? scope,
})

Creates an InjectableFactory for a type that has no dependencies.

  • creator: A function that returns an instance of T.
  • scope: The optional InjectableScope for the created instance.

Implementation

static InjectableFactory withoutDependencies<T extends Object>(InjectableInstanceCreatorWithoutDependencies<T> creator, {InjectableScope? scope}) =>
    InjectableFactory._(buildsType: T, creator: (_) => creator(), scope: scope);