Stack<T> constructor

Stack<T>({
  1. required T value,
  2. Stack<T>? prev,
})

Creates a stack node with the given value and previous node.

Parameters:

  • value: The value stored in this stack node
  • prev: The previous node in the stack

Example:

final node = Stack(value: 1);

Implementation

Stack({required this.value, this.prev});