Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
luanpotter committed Dec 14, 2024
1 parent 8fed4d2 commit 99107d8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/flame/lib/src/components/core/component.dart
Original file line number Diff line number Diff line change
Expand Up @@ -643,12 +643,13 @@ class Component {

/// Removes all the children in the list and calls [onRemove] for all of them
/// and their children.
void removeAll(Iterable<Component> components) =>
components.toList(growable: false).forEach(_removeChild);
void removeAll(Iterable<Component> components) {
components.toList(growable: false).forEach(_removeChild);
}

/// Removes all the children for which the [test] function returns true.
void removeWhere(bool Function(Component component) test) {
removeAll([...children.where(test)]);
children.where(test).toList(growable: false).forEach(_removeChild);
}

void _removeChild(Component child) {
Expand Down

0 comments on commit 99107d8

Please sign in to comment.