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