List<double> list = [1,2,3,4,10,2,1,2];
//从小到大排序
list.sort((a, b) => a.compareTo(b));
//最大值
var max = list.last;
List<double> list = [1,2,3,4,10,2,1,2];
//从小到大排序
list.sort((a, b) => a.compareTo(b));
//最大值
var max = list.last;
本文标题:fluter-数组中的最大值和最小值
本文链接:https://www.haomeiwen.com/subject/rmvqirtx.html
网友评论