Stack<T>.from constructor

Stack<T>.from(
  1. Iterable<T> elements
)

Creates a stack containing the elements of the given iterable. Elements are pushed in the order they appear, so the last element of the iterable will be at the top of the stack.

Implementation

Stack.from(Iterable<T> elements) : _container = Deque<T>.from(elements);