getInstance static method

Reflectable? getInstance(
  1. Type type
)

Returns the canonicalized instance of the given reflector type.

If type is not a subclass of Reflectable, or if it is such a class but no entities are covered (that is, it is unused, so we don't have any reflection data for it) then null is returned.

Implementation

static Reflectable? getInstance(Type type) {
  for (Reflectable reflector in implementation.reflectors) {
    if (reflector.runtimeType == type) return reflector;
  }
  return null;
}