getFromToken<T> method

  1. @override
T getFromToken<T>()
override

Get a dependency which was passed inside a injection token

Implementation

@override
T getFromToken<T>() {
  return _registrations.values
      .whereType<InjectionToken?>()
      .firstWhere((t) => t?.type == T, orElse: () => null)
      ?.value;
}