Dart List.last
属性返回列表的最后一个元素。
语法
List.last
示例
void main() {
var lst = new List();
lst.add(12);
lst.add(13);
print("The last element of the list is: ${lst.last}");
}
执行上面示例代码,得到以下结果 -
The last element of the list is: 13