title: Lambda Expression as a function parameter in Dart Language
body: <p>I am trying to build a class to making some operations in <em>mathematical sequences</em> in <strong>Dart</strong> . And I am expecting a sequence as a <strong>lambda expression</strong> or <strong>function</strong> . I got confused when I try to build constructor of class . What should I write for parameters and data types ?</p>
  <p>Sample <strong>lambda expression</strong> :</p>
  <blockquote>
  <p><code>int sequence(int n) =&gt; 7+5*(n-1);</code></p>
  </blockquote>
  <p>Sample function :</p>
  <pre><code>int fib(int n) {
    if ((n == 1) || (n == 2)) {
      return 1;
    } else {
      return fib(n - 1) + fib(n - 2);
    }
  }
  </code></pre>
  <p>How can I give that lambda expression and function as a parameter to another function ?</p>