title: How can I create a dispatch table that creates different types of objects
body: <p>If I define a bunch of classes:</p>
  
  <pre><code>class A  {
    final List&lt;int&gt; value;
    A(this.value);
    static make(List&lt;int&gt; value) =&gt; new A(value);
  }
  // more class defs here
  class Z  {
    final List&lt;String&gt; value;
    Z(this.value);
    static make(List&lt;String&gt; value) =&gt; new A(value);
  }
  </code></pre>
  
  <p>Then the following doesn't work, because Type has no methods</p>
  
  <pre><code>Map&lt;int, Type&gt; typeMap = {0: A, 25: Z};
  new typeMap[0]([1, 2, 3])
  </code></pre>
  
  <p>But the following does work. Although, it takes lots of extra work to create the static make methods.</p>
  
  <pre><code>Map&lt;int, Function&gt; funcMap = {0: A.make, 25: Z.make};
  funcMap[0]([1, 2, 3])
  </code></pre>
  
  <p>Is there a better way to do this?</p>