cartesianProduct method

Iterable<T> cartesianProduct(
  1. T combinator(
    1. T a,
    2. T b
    )
)

Creates the Cartesian product of the iterables and combines each resulting pair using the combinator function.

Example:

final sets = [{1, 2}, {10, 20}];
final combined = sets.cartesianProduct((a, b) => a + b);
print(combined); // (11, 21, 12, 22)

Implementation

Iterable<T> cartesianProduct(T Function(T a, T b) combinator) {
  return _cartesianProduct(this, combinator);
}