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