get<T> static method

T? get<T>()

Retrieves an instance of type T. If the instance is a factory function, it will invoke the factory.

Implementation

static T? get<T>() {
  var instance = _instances[T];
  if (instance is Function) {
    return instance() as T;
  }
  return instance as T?;
}