flatten function

List flatten(
  1. Iterable list
)

Implementation

List flatten(Iterable<dynamic> list) => [
      for (var element in list)
        if (element is! Iterable) element else ...element
    ];