move method

void move (ChildType child, { ChildType after })

Move this child in the child list to be before the given child.

More efficient than removing and re-adding the child. Requires the child to already be in the child list at some position. Pass null for before to move the child to the end of the child list.

Implementation

void move(ChildType child, { ChildType after }) {
  assert(child != this);
  assert(after != this);
  assert(child != after);
  assert(child.parent == this);
  final ParentDataType childParentData = child.parentData;
  if (childParentData.previousSibling == after)
    return;
  _removeFromChildList(child);
  _insertIntoChildList(child, after: after);
  markNeedsLayout();
}