flatten<R> method

Iterable<R?> flatten<R>()

Implementation

Iterable<R?> flatten<R>() {
  return expand((element) {
    if (element is Iterable) {
      return element.cast();
    } else {
      return [element].cast();
    }
  });
}