sublist 抽象方法
override
创建一个包含从 start 到 end 之间元素的新列表。
新列表是一个包含此列表中位置大于或等于 start 且小于 end 的元素的 Int32x4List,顺序与它们在此列表中的顺序相同。
var numbers = Int32x4List.fromList([
Int32x4(0, 1, 2, 3),
Int32x4(1, 2, 3, 4),
Int32x4(2, 3, 4, 5),
Int32x4(3, 4, 5, 6),
Int32x4(4, 5, 6, 7),
]);
print(numbers.sublist(1, 2)); // [Int32x4(1, 2, 3, 4)]
print(numbers.sublist(1, 2).runtimeType); // Int32x4List
如果省略 end,则默认为此列表的 长度。
print(numbers.sublist(3)); // [Int32x4(3, 4, 5, 6), Int32x4(4, 5, 6, 7)]
start 和 end 位置必须满足关系 0 ≤ start ≤ end ≤ this.length。如果 end 等于 start,则返回的列表为空。
实现
Int32x4List sublist(int start, [int? end]);