getLiveChildren method

List<TKey> getLiveChildren(
  1. TKey parent
)

Children of parent that are not pending deletion.

Matches the input contract of reorderChildren. Returns an empty list if parent is not present or has no children.

Implementation

List<TKey> getLiveChildren(TKey parent) {
  final full = _childListOf(parent);
  if (full == null || full.isEmpty) return const [];
  if (_pendingDeletionCount == 0) return List<TKey>.of(full);
  final result = <TKey>[];
  for (final k in full) {
    if (!_isPendingDeletion(k)) result.add(k);
  }
  return result;
}