max method Null safety

dynamic max(
  1. List list
)

Implementation

max(List list) {
  var maxVal =
      flatten(list).reduce((curr, next) => curr > next ? curr : next);
  return maxVal;
}