cartesianProduct<T> static method
Computes the Cartesian product of a list of lists.
Implementation
static Iterable<List<T>> cartesianProduct<T>(List<List<T>> lists) {
try {
Iterable<List<T>> result = [[]];
for (final list in lists) {
result = result.expand((x) => list.map((y) => [...x, y]));
}
return result;
} catch (e) {
rethrow;
}
}