forEachChild method

void forEachChild(
  1. void fn(
    1. ChildKey key,
    2. T value
    )
)

Calls fn on the value of every immediate child that has one.

Implementation

void forEachChild(void Function(ChildKey key, T value) fn) {
  for (final MapEntry<ChildKey, ImmutableTree<T>> entry in children.entries) {
    final T? value = entry.value.value;
    if (value != null) {
      fn(entry.key, value);
    }
  }
}