flattenDepth<R> method
Implementation
Iterable<R?> flattenDepth<R>([int depth = 1]) {
return expand((element) {
if (element is Iterable && depth > 0) {
return element.flattenDepth(depth - 1).cast();
} else {
return [element].cast();
}
});
}