whereAnnotated method

Iterable<FunctionReflection<O, R>> whereAnnotated([
  1. bool test(
    1. List<Object> annotations
    )?
])

Returns the MethodReflection that matches annotations test. If test is null, will match methods with any annotation.

Implementation

Iterable<FunctionReflection<O, R>> whereAnnotated(
    [bool Function(List<Object> annotations)? test]) {
  if (test != null) {
    return where((m) {
      return test(m.annotations);
    });
  }
  return where((m) => m.annotations.isNotEmpty);
}