dartx
dartx copied to clipboard
Flatten should work with deeply nested lists as well
This can be achieved by setting a flag in the flatten extension or directly flattening the list. Need some more discussion.
final nestedList = [
[
1,
[2, 3]
],
[4, 5, 6]
];
final flattened = nestedList.flatten(); // [1, 2, 3, 4, 5, 6]