Stream.periodic

source: https://api.flutter.dev/flutter/dart-async/Stream/Stream.periodic.html

Let's look at this:

Stream<T>.periodic(
  Duration period,
  [T computation(
    int computationCount
  )?]
)

This is how you define a stream that emits values of type T (Stream). You use the constructor Stream.periodic. It takes the positional argument of type Duration and an optional argument, which is the function that returns a type after taking an integer computationCount as an argument.


Comments