padTo method
New list padded with fill to at least length elements.
Implementation
@useResult
List<T> padTo(int length, T fill) {
if (this.length >= length) return List<T>.of(this);
return <T>[...this, ...List<T>.filled(length - this.length, fill)];
}