max method

List<T> max({
  1. required int length,
  2. required String operation,
  3. String? name,
  4. String? reason,
})

Implementation

List<T> max({
  required int length,
  required String operation,
  String? name,
  String? reason,
}) {
  if (this.length > length) {
    throw ArgumentException.invalidOperationArguments(
      operation,
      name: name,
      reason:
          reason ??
          (name == null
              ? "Invalid array length"
              : "Invalid $name array length."),
    );
  }
  return this;
}