get<T> method

T get <T>()

retrives or creates an instance of a registered type T depending on the registration function used for this type.

Implementation

T get<T>() {
  _ServiceFactory<T> object = _factories[T];
  if (object == null) {
    throw new Exception(
        "Object of type ${T.toString()} is not registered inside GetIt");
  }
  return object.getObject();
}