isRiverpodRef function
bool
isRiverpodRef(
- DartType targetType
)
Implementation
bool isRiverpodRef(DartType targetType) {
final isBuiltInRef = _isBuiltInRef(targetType);
if (isBuiltInRef) return true;
final targetElement = targetType.element;
// Not a built-in ref. Might be a generated ref, let's check that.
if (targetElement is! MixinElement) return false;
final constraints = targetElement.superclassConstraints.singleOrNull;
if (constraints == null) return false;
return _isBuiltInRef(constraints);
}