averageOrNull method

num? averageOrNull()
  • return the average of the list
  • return null if isEmpty

Implementation

num? averageOrNull() => isEmpty ? null : (sum() / length);