siblingReflectionFor<T> method

Reflection<T>? siblingReflectionFor<T>({
  1. T? obj,
  2. Type? type,
})

Returns a Reflection for type, obj or T.

Implementation

Reflection<T>? siblingReflectionFor<T>({T? obj, Type? type}) {
  type ??= obj?.runtimeType ?? T;

  var reflectionForType =
      siblingsReflection().where((c) => c.reflectedType == type).firstOrNull;
  return reflectionForType as Reflection<T>;
}