nestedEvents function

Stream<int> nestedEvents(
  1. int count
)

Implementation

Stream<int> nestedEvents(int count) {
  return Stream.periodic(
    const Duration(seconds: 1),
    (e) => e,
  ).take(count).asyncExpand(
        (event) => Stream.fromIterable(
          Iterable.generate(event + 1),
        ),
      );
}