distinctBy<R> method
Skips data events if their key are equal to the key of the previous data event.
Implementation
Stream<T> distinctBy<R>(
R Function(T) keySelector, {
Equality<R>? equals,
}) {
final eq = equals ?? defaultEquals;
return distinct(
(e1, e2) => eq(
keySelector(e1),
keySelector(e2),
),
);
}