Pass a typed function as a parameter in Dart : <p>I know the <a href="https://api.dartlang.org/stable/1.22.1/dart-core/Function-class.html" rel="noreferrer" title="Function">Function</a> class can be passed as a parameter to another function, like this:</p>

<pre><code>void doSomething(Function f) {
    f(123);
}
</code></pre>

<p>But is there a way to constrain the arguments and the return type of the function parameter?</p>

<p>For instance, in this case <code>f</code> is being invoked directly on an integer, but what if it was a function accepting a different type?</p>

<p>I tried passing it as a <code>Function&lt;Integer&gt;</code>, but Function is not a parametric type.</p>

<p>Is there any other way to specify the signature of the function being passed as a parameter?</p>
