rebalanceWhere method

  1. @override
void rebalanceWhere(
  1. bool test(
    1. Component element
    )
)
override

Allows you to rebalance only a portion of the tree. If you are dealing with non-deterministic compare functions, you probably need to consider rebalancing. If the priority function changed for certain known elements but not all, you can use this instead of rebalanceAll. In general be careful with using comparing functions that can change. Note: rebalancing is not stable.

Implementation

@override
void rebalanceWhere(bool Function(Component element) test) {
  // bypass the wrapper because the components are already added
  final elements = super.removeWhere(test).toList();
  elements.forEach(super.add);
}