fillRange 抽象方法
用 fillValue 覆盖一系列元素。
将位置大于或等于 start 且小于 end 的元素设置为 fillValue。
提供的范围(由 start 和 end 给出)必须是有效的。如果 start ≤ end ≤ length 且范围为 0 ≤ start,则范围有效。一个空范围(其中 end == start)是有效的。
如果元素类型不可为 null,则必须提供 fillValue 并确保其非 null。
示例
final words = List.filled(5, 'old');
print(words); // [old, old, old, old, old]
words.fillRange(1, 3, 'new');
print(words); // [old, new, new, old, old]
实现
void fillRange(int start, int end, [E? fillValue]);