toProvider method

Provider toProvider()

Implementation

Provider toProvider() {
  Provider<X> _toProvider<X extends Object>(Inst<X> inst) {
    return isFactory
        ? Provider<X>(
            create: inst.factory!,
            dispose: ((_, _inst) => inst.dispose?.call(_inst)),
          )
        : Provider<X>.value(
            value: inst.instance!,
            updateShouldNotify: inst.shouldUpdate,
          );
  }

  return this.typed(_toProvider);
}