KtList<T>.from constructor

KtList<T>.from([
  1. Iterable<T> elements = const []
])

Returns a new read-only list based on elements.

Implementation

factory KtList.from([Iterable<T> elements = const []]) {
  if (elements.isEmpty) return EmptyList<T>();
  return DartList(elements);
}