abs method Null safety

List abs(
  1. List list
)

Implementation

List abs(List list) {
  List shape = getDim(list);
  List temp = flatten(list).map((e) => e > 0 ? e : -e).toList();
  temp = generate(temp, shape);
  return temp;
}