followedBy method

S followedBy(
  1. Iterable<T> other, [
  2. TotalCountResolver totalCountResolver = _defaultResolver
])

Returns the lazy concatenation of this iterable and other.

The returned iterable will provide the same elements as this iterable, and, after that, the elements of other, in the same order as in the original iterables.

Implementation

S followedBy(Iterable<T> other,
    [TotalCountResolver totalCountResolver = _defaultResolver]) {
  var oldLength = state.items.length;
  var newData = state.items.followedBy(other);
  return state.copyWith(
    items: newData,
    totalCount:
        totalCountResolver(state.totalCount, diff(oldLength, newData.length)),
  );
}