dartx icon indicating copy to clipboard operation
dartx copied to clipboard

Flatten should work with deeply nested lists as well

Open rishabhdeepsingh opened this issue 3 years ago • 0 comments

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]

rishabhdeepsingh avatar Jun 08 '21 18:06 rishabhdeepsingh