Метод followedBy
-
Iterable<
E> other
Возвращает ленивую конкатенацию этой итерируемой коллекции и other.
Возвращаемая итерируемая коллекция будет содержать те же элементы, что и эта итерируемая коллекция, а затем элементы other в том же порядке, что и в исходных итерируемых коллекциях.
Пример:
var planets = <String>['Earth', 'Jupiter']; var updated = planets.followedBy(['Mars', 'Venus']); print(updated); // (Earth, Jupiter, Mars, Venus)
Реализация
Iterable<E> followedBy(Iterable<E> other) {
var self = this; // TODO(lrn): Remove when we can promote `this`.
if (self is EfficientLengthIterable<E>) {
return FollowedByIterable<E>.firstEfficient(self, other);
}
return FollowedByIterable<E>(this, other);
}
© 2012 the Dart project authors
Licensed under the BSD 3-Clause "New" or "Revised" License.
https://api.dart.dev/stable/2.19.6/dart-core/Iterable/followedBy.html