iterator property

  1. @override
Iterator<Pulse> get iterator
override

Returns an iterator over the sub‑pulses in this pulse.

When to use

  • Use this to iterate over the individual pulses in a composite.
  • Iterating over the pulses in a collective.
  • Processing each pulse in a bundle individually.
  • Checking what pulses are in a composite.

How it works

  • For a standard or collective pulse: returns an iterator over a single element — the pulse itself.
  • For an evolved pulse: returns an iterator over the entire chain.

Example

final collective = Pulse<int>(1) + Pulse<String>('hello');
for (final p in collective) {
  print(p.payload); // Outputs: 1, hello
}

Implementation

@override
Iterator<Pulse> get iterator;