I'm getting error summing a List using the .fold() method:
List<int> listInt = [1, 2, 3, 4, 5, 6];
int sumList = listInt.fold(0, (p, c) => p + c);
// First Print
print(sumList);
// Second Pring
print(listInt.fold(0, (p, c) => p + c));
Printing sumList is perfectly fine, but when I print the same operation i get a compilation error:
The operator '+' can't be unconditionally invoked because the receiver can be 'null'.
Any ideas why?