title: Distinguish between onClick and onDoubleClick on same element to perform different actions in Dart
body: <p>I want to do the ill-advised and place both an onClick and onDoubleClick on the same element with each type of event resulting in a different action. Specifically on an image, click to advance to the next image, double-click to toggle fullscreen. </p>
  
  <p>Naturally I get two clicks followed by a double-click (though I understand that some browsers only fire one click before the double-click).</p>
  
  <p>I had thought to make it easy on myself and place each event into a buffer (List) - or rather to add the event.type string to a list, then, after a suitable elapse of time, say 250 or 300 milliseconds examine the last item in the buffer and if doubleclick then go fullscreen else advance the length of the list.</p>
  
  <p>I have found that the list only ever has one item, and I have not worked out how to get the timer to work..</p>
  
  <p>Amongst my attempts was this one:</p>
  
  <pre class="lang-dart prettyprint-override"><code>void catchClickEvents(Event e) {
    var eventTypes = new List&lt;String&gt;();
    eventTypes.add(e.type);
    Duration duration = const Duration(milliseconds: 300);
    var timeout = new Timer(duration, () =&gt; processEvents(eventTypes));
  }
  
  void processEvents(List eTypes) {
    // just to see what is going on...
    print(eTypes);
  }
  </code></pre>
  
  <p>this results in this output printed to the console:</p>
  
  <pre><code>[click]
  [click]
  [dblclick]
  </code></pre>
  
  <p>rather than </p>
  
  <pre><code>[click, click, dblclick]
  </code></pre>
  
  <p>If I slow it down there is a clear delay before those three event types are printed together</p>
  
  <p>So...</p>
  
  <p>The bigger question is 
  'What is the darty way to distiguish between single and double-click and perform a different action for each?'</p>
  
  <p>The other questions are:</p>
  
  <p>How do I fill a buffer with successive events (and later clear it down) - or even how do I use Dart's Stream of events as a buffer...</p>
  
  <p>What is the real way timeout before examining the contents of the buffer?</p>
  
  <p>(and I guess the final question is 'should I abandon the effort and settle for a conventional set of buttons with glyph-icons?'!)</p>