siblingEnumReflectionFor<T> method

EnumReflection<T>? siblingEnumReflectionFor<T>({
  1. T? obj,
  2. Type? type,
})

Returns a siblingsEnumReflection for type, obj or T.

Implementation

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

  var enumReflectionForType =
      siblingsEnumReflection().where((c) => c.enumType == type).firstOrNull;
  return enumReflectionForType as EnumReflection<T>?;
}