Flattens array a single level deep.
List flatten(List array) { return array .expand((element) => element is List ? element : [element]) .toList(); }