I want to create this block of code work in Dart
int pivot (List list ,[ int start = 0 , int end = list.length ] ) { return 1}
this work fine if I wrote syntax like this in JavaScript but when writing it in dart it gives me error that list used in list.length is not defined. How can I solve it especially if this function will be used as recursive function so that I can't defined the parameters out of it.
I am returning 1 here to simplify the function logic as I want to focus on the parameter problem.