Tuple3<T1, T2, T3>.fromList constructor

Tuple3<T1, T2, T3>.fromList(
  1. List items
)

Creates a new tuple value with the specified list items.

Note that if given items length is less than 3, or types do not match tuple type, this constructor will throw error.

Implementation

factory Tuple3.fromList(List items) {
  if (items.length != 3) {
    throw ArgumentError('items must have length 3');
  }
  return Tuple3<T1, T2, T3>(items[0] as T1, items[1] as T2, items[2] as T3);
}