How can I use isolate to get Fibonacci series in flutter? Actually, I have some bigger problems in which I have to do recursion in large list. By your answer to this question, I will get the tip to my original problem.
int Fib(int n){
if(n<=1) //Base Condition
return n;
return Fib(n-1)+Fib(n-2);
}
void main() {
print(Fib(6));
}
I don't know where I am missing, and I am getting the following error: Invalid argument(s): Illegal argument in isolate message: (object extends NativeWrapper - Library:'dart:ui' Class: Paragraph
Declare the function in an empty dart file not in a class or outside the scope of a class (It should be a top-level function)
Then access it anywhere like this: