operator * method

List<T> operator *(
  1. dynamic item
)

The existing List + operator only works for lists, so *= is the best we can do

Implementation

List<T> operator *(item) {
  if (item is List<T>) {
    this.addAll(item);
  } else if (item is T) {
    this.add(item);
  } else if (item == null) {
    /// we don't add nulls, may regret this some day
    return this;
  } else {
    throw "Invalid input - must be null, $T, List<$T>";
  }
  return this;
}