title: Is template parameter stacking possible in Dart?
body: <p>I'm currently trying to write a function that can take and execute any function with any set of parameters. In CPP, I do this using the following pattern;</p>
  <pre><code>template &lt;class R, class... Args&gt;
  class Wrapper
  {
  private:
      R(*_function)(Args... args);
  
  public:
      Wrapper(R(*function)(Args...)) : _function(function), _dt(dt){
        //do some init stuff here
      }
  
      R run(Args... args) {
          return _function(args...);  
  </code></pre>
  <p>Is it possible to have this in dart? I can do a limited version of this in dart but I need to define a typedef with a fixed set of parameters.</p>
  <pre><code>typedef Generic&lt;T, R&gt; = R Function(T data);
  
  class GenericClass&lt;T, R&gt;{
    Generic&lt;T, R&gt; callback;
    GenericClass({required this.callback});
  
    R method(T data){
      return callback(data);
    }
  </code></pre>