fromList<T> static method

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

List constructor.

Implementation

static (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 (list[0],);
}