getDartAnnotationIdentifier function

String getDartAnnotationIdentifier(
  1. String source,
  2. int startPosition
)

extracts the name of the identifier as described for the isDartAnnotation() method. Same limits as above.

The method simply returns tha annotation name, NOT the parameters (if any)

Implementation

String getDartAnnotationIdentifier(String source, int startPosition) =>
    dartAnnotationRegExp
        .matchAsPrefix(source, startPosition)
        ?.group(0)
        ?.substring(1) ??
    '';