retain method

void retain(
  1. bool f(
    1. T
    )
)

Retains only the elements specified by the predicate where the result is true. Equivalent to retainWhere.

Implementation

@pragma('vm:prefer-inline')
void retain(bool Function(T) f) => retainWhere(f);