title: How to implement a stack with push and pop in Dart
body: <p>I'd like to implement a stack data structure (not to be confused with the Flutter Stack widget) in Dart so that I can handle a stack of custom TextStyles for Flutter text rendering.</p>
  <p>I know with stack you can push and pop values. This sounds similar to Queue, but I'm not sure of the difference.</p>
  <p>This doesn't work:</p>
  <pre><code>final myStack = Queue&lt;int&gt;();
  myStack.push(1);
  final top = myStack.pop();
  </code></pre>