isAnyTokenRef function
Returns true if the value is a token reference.
Detects both class-based token references (Prop with ValueRef) and extension type token references.
Implementation
bool isAnyTokenRef(Object value) {
// Check for class-based token references
if (value is Prop && value.sources.any((s) => s is TokenSource)) {
final typeName = value.runtimeType.toString();
if (typeName.endsWith('Ref') || typeName.endsWith('Prop')) {
return true;
}
}
// Check for extension type token references
return _tokenRegistry.containsKey(value);
}