isFromExpectedPackage function
Returns true if namedType originates from expectedPackage.
If the type can't be resolved (e.g. unresolved import), returns true
to avoid false negatives — the rule should still fire rather than
silently skipping a real issue just because the type didn't resolve.
Implementation
bool isFromExpectedPackage(NamedType namedType, String expectedPackage) {
final type = namedType.type;
if (type == null || type is! InterfaceType) return true;
return isTypeFromPackage(type, expectedPackage);
}