title: The argument type '(On....) -> Null' can't be assigned to the parameter type `(Object) -> void`
body: <p>I've enabled strict mode in my Dart code-base today and have fixed most of the warnings and errors. 
  This one I'm not sure how to fix ...</p>
  
  <p>This is my method signature:</p>
  
  <pre><code>StreamSubscription listen(Type eventType, void onData(Object event), { Function onError, void onDone(), bool cancelOnError}) {
  
     ... code here ...
  
  }
  </code></pre>
  
  <p>When doing: <code>_bus.listen(OnRowDoubleClick, (OnRowDoubleClick event){</code>
  I'm getting</p>
  
  <pre><code>The argument type '(OnRowDoubleClick) -&gt; Null' can't be assigned to the parameter type `(Object) -&gt; void`
  </code></pre>
  
  <p>I can change the method signature to </p>
  
  <pre><code>StreamSubscription listen(Type eventType, Null onData(Object event), {...`, 
  </code></pre>
  
  <p>(which doesn't make sense since I don't actually want to return anything), the error changes to     </p>
  
  <pre><code>The argument type '(OnRowDoubleClick) -&gt; Null' can't be assigned to the parameter type `(Object) -&gt; Null`
  </code></pre>
  
  <p>Changing the method call to this: </p>
  
  <pre><code>_bus.listen(OnRowDoubleClick, (event){
  </code></pre>
  
  <p>The error goes away, but now I have to cast <code>event as OnRowDoubleClick</code> the whole time.</p>
  
  <p>Is there a better way of dong this?</p>
  
  <p><strong>* Solution *</strong></p>
  
  <p>Solution is to mark the listener with T:</p>
  
  <pre><code>StreamSubscription listen&lt;T&gt;(Type eventType, Null onData(T event), {
  </code></pre>
  
  <p>Now you can call <code>_bus.listen&lt;OnRowDoubleClick&gt;(OnRowDoubleClick, (event){</code> and the event will be of type <code>OnRowDoubleClick</code></p>