append2 method

Iterable<T> append2(
  1. T v1,
  2. T v2
)

Inserts two elements to the end of the iterable.

Takes the specified elements and inserts them at the end of the iterable.

Example:

void main() {
  final list = [0, 1, 2, 3];
  final result = list.append2(4, 5);

  // Result: [0, 1, 2, 3, 4, 5]
}

Implementation

Iterable<T> append2(T v1, T v2) sync* {
  yield* this;
  yield v1;
  yield v2;
}