capture method

ChildGroup capture()

Moves all entries of this list into a new detached group, leaving this list empty.

Implementation

ChildGroup capture() {
  final group = ChildGroup();
  final target = group.children;
  for (var node = _first; node != null; node = node._next) {
    node._owner = target;
  }
  target._first = _first;
  target._last = _last;
  _first = null;
  _last = null;
  return group;
}