sort method Null safety

void sort(
  1. [Comparator<int>? compare]
)
inherited

This operation is not supported by an unmodifiable list.

Implementation

void sort([Comparator<E>? compare]) {
  throw new UnsupportedError("Cannot modify an unmodifiable list");
}