cacheExtent,
ListWidget> children = const Widget>[],
int?...ListWidget> _buildList(){
/// 遍历 NAMES 数组
/// 调用 map 方法遍历数组元素
return NAMES.map((name)...color: Colors.yellowAccent,
fontSize: 20
),
),
);
}
}
执行结果 : 在下面的数组中..., ‘柴进’ 是最后一个元素 , 下拉到最后一个元素 , 会触发复制当前数组 , 添加到后面 , 然后更新列表 , 可以加载更多元素 ;
var NAMES = [ '宋江', '卢俊义', '吴用'...地址 : https://github.com/flutter
Flutter 中文社区 : https://flutter.cn/
Flutter 实用教程 : https://flutter.cn