getAnnotation<A> abstract method
A?
getAnnotation<A>()
Gets a single annotation by type, if present.
Type Parameters:
A
: The annotation type to look for
Returns:
- The annotation instance of type
A
if found null
if no matching annotation exists
Example:
final deprecated = method.getDirectAnnotation<Deprecated>();
if (deprecated != null) {
print('Deprecation message: ${deprecated.message}');
}
Implementation
A? getAnnotation<A>();