sum method
Implementation
num sum() => fold(
0,
(num previousValue, dynamic element) =>
previousValue + (element is num ? element : 0));
num sum() => fold(
0,
(num previousValue, dynamic element) =>
previousValue + (element is num ? element : 0));