toFrontWhere method

List<T> toFrontWhere(
  1. bool test(
    1. T
    )
)

Implementation

List<T> toFrontWhere(bool Function(T) test) {
  int at = indexWhere(test);

  if (at != -1) {
    T element = removeAt(at);
    insert(0, element);
  }

  return this;
}