fromList<T> static method

Tuple1<T> fromList<T>(
  1. List<T> list
)
override

List constructor.

Implementation

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