removeChildren method
void
removeChildren(
- [int beginIndex = 0,
- int? endIndex]
)
override
Implementation
@override
void removeChildren([int beginIndex = 0, int? endIndex]) {
final length = _children.length;
final i1 = beginIndex;
final i2 = endIndex ?? length - 1;
if (i1 > i2) {
// do nothing
} else if (i1 < 0 || i1 >= length || i2 < 0 || i2 >= length) {
throw ArgumentError('The supplied index is out of bounds.');
} else {
for (var i = i1; i <= i2 && i1 < _children.length; i++) {
removeChildAt(i1);
}
}
}