siblingClassReflectionFor<T> method

ClassReflection<T>? siblingClassReflectionFor<T>({
  1. T? obj,
  2. Type? type,
})

Returns a siblingsClassReflection for type, obj or T.

Implementation

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

  var classReflectionForType = siblingsClassReflection()
      .where((c) => c.classType == type)
      .firstOrNull;
  return classReflectionForType as ClassReflection<T>?;
}