delay<Event> function
Null safety
- Duration duration
The delay() transformer is pausing adding events for a particular increment of time (that you specify) before emitting each of the events. This has the effect of shifting the entire sequence of events added to the bloc forward in time by that specified increment.
Example
on<ExampleEvent>(
_handleEvent,
transformer: delay(const Duration(seconds: 1)),
);
Implementation
EventTransformer<Event> delay<Event>(Duration duration) =>
(events, mapper) => events.delay(duration).switchMap(mapper);