removeChildren method

void removeChildren([
  1. int fromIndex = 0,
  2. int endIndex = -1,
  3. bool dispose = false
])

Removes a child from the list of children of this container based on its index.

Implementation

void removeChildren([
  int fromIndex = 0,
  int endIndex = -1,
  bool dispose = false,
]) {
  if (endIndex < 0 || endIndex >= children.length) {
    endIndex = children.length - 1;
  }

  for (var i = fromIndex; i <= endIndex; ++i) {
    removeChildAt(
      fromIndex,
      dispose,
    );
  }
}