partition method

Partitioning<T> partition(
  1. bool predicate(
    1. T x
    ), {
  2. String? nameForMatches,
  3. String? nameForNonMatches,
})

Implementation

Partitioning<T> partition(bool Function(T x) predicate,
    {String? nameForMatches, String? nameForNonMatches}) {
  final matchesNode = this.where(predicate, name: nameForMatches);
  final nonMatchesNode =
      this.where((T e) => !predicate(e), name: nameForNonMatches);
  return Partitioning(matches: matchesNode, nonMatches: nonMatchesNode);
}