How to call a named constructor from a generic function in Dart/Flutter : <p>I want to be able to construct an object from inside a generic function. I tried the following:</p>

<pre><code>abstract class Interface
{
  Interface.func(int x);
}
class Test implements Interface
{
  Test.func(int x){}
}
T make&lt;T extends Interface&gt;(int x)
{
  // the next line doesn't work
  return T.func(x);
}
</code></pre>

<p>However, this doesn't work. And I get the following error message: <code>The method 'func' isn't defined for the class 'Type'</code>.</p>

<p><strong>Note</strong>: I cannot use mirrors because I'm using dart with flutter.</p>
