subsets method
Returns an iterable of iterables which represents all of the subsets of this iterable. (Also known as the power set of the iterable.)
Implementation
Iterable<Iterable<T>> subsets() sync* {
final asList = toList();
if (asList.isNotEmpty) {
yield* _subsetRecursive(asList, asList.length, asList.length - 1, <T>[]);
} else {
yield <T>[];
}
}