$allInstanceFields method

Iterable<VariableMirror> $allInstanceFields([
  1. Type? type
])

Implementation

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

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

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