fromList<T> static method

Tuple2<T, T> fromList<T>(
  1. List<T> list
)
override

List constructor.

Implementation

static Tuple2<T, T> fromList<T>(List<T> list) {
  if (list.length != 2) {
    throw ArgumentError.value(
        list, 'list', 'Expected list of length 2, but got ${list.length}');
  }
  return Tuple2(list[0], list[1]);
}