title: Simple command-line app I/O in Dart
body: <p>Is there a way of taking single character (integer) keyboard inputs from the user and storing them to a variable in a Dart command-line app? I've tried something like:</p>
  
  <pre class="lang-dart prettyprint-override"><code>Stream cmdLine = stdin
    .transform(new StringDecoder())
    .transform(new LineTransformer());
  
  StreamSubscription cmdSubscription = cmdLine.listen(
    (line) =&gt; (choice = line);
    cmdSubscription.cancel(););
  </code></pre>
  
  <p>In an attempt to store a keyboard input into the variable 'choice' and many slight variations of this code but can't get it to work.</p>