$allInstanceMethods method

Iterable<MethodMirror> $allInstanceMethods([
  1. Type? type
])

Implementation

Iterable<MethodMirror> $allInstanceMethods([Type? type]) sync* {
  type ??= runtimeType;

  yield* reflectClass(type)
      .declarations
      .values
      .where((i) => i is MethodMirror && !i.isStatic)
      .map((i) => i as MethodMirror);

  ClassMirror? c = reflectClass(type).superclass;
  if (c != null) {
    yield* $allInstanceMethods(c.reflectedType);
  }
}