hyzp_ybqx-Commit042:在点位信息列表页面,对 listDwspGetList2 按 'id' 号排序,解决点位编号不连续的问题
This commit is contained in:
@@ -49,11 +49,26 @@ class _DwspPageState extends State<DwspGetList> {
|
||||
//按照用户选择的_selectedValue、_descending对listDwspGetList2进行排序,并延时更新
|
||||
|
||||
// 在点位视频列表页面,解决点位编号不连续的问题
|
||||
int _len = listDwspGetList2.length;
|
||||
for (int i = 0; i < _len; i++) {
|
||||
listDwspGetList2[i]['dwbh'] = i + 1;
|
||||
// int _len = listDwspGetList2.length;
|
||||
// for (int i = 0; i < _len; i++) {
|
||||
// listDwspGetList2[i]['dwbh'] = i + 1;
|
||||
// }
|
||||
|
||||
//print('listDwspGetList2 = $listDwspGetList2');
|
||||
// for (var item in listDwspGetList2) {
|
||||
// print('item = $item');
|
||||
// }
|
||||
|
||||
listDwspGetList2.sort((_left, _right) => _left['id'].compareTo(_right['id'])); // list排序
|
||||
for (var item in listDwspGetList2) {
|
||||
print('item = $item');
|
||||
}
|
||||
|
||||
// flutter dart list 排序
|
||||
// list.sort((_left,_right)=>_left.age.compare(_right.age));
|
||||
// 说明:age为年龄,按age排完序 需要降序的话,right.age.compare(_left.age)。
|
||||
// List.sort(),参数支持subtype(当然除bool)。
|
||||
|
||||
_listSort();
|
||||
firstIndex = 0;
|
||||
lastIndex = 7;
|
||||
@@ -144,8 +159,11 @@ class _DwspPageState extends State<DwspGetList> {
|
||||
//leading: new Icon(Icons.phone),
|
||||
contentPadding: EdgeInsets.symmetric(horizontal: 15.0, vertical: 0),
|
||||
title: Text(
|
||||
"${listDwspGetList2[indexRecord]['dwbh'].toString()}. ${listDwspGetList2[indexRecord]['dwmc']}",
|
||||
"${listDwspGetList2[indexRecord]['id'].toString()}. ${listDwspGetList2[indexRecord]['dwmc']}",
|
||||
style: TextStyle(fontSize: 14, fontWeight: FontWeight.bold)),
|
||||
// title: Text(
|
||||
// "${listDwspGetList2[indexRecord]['dwbh'].toString()}. ${listDwspGetList2[indexRecord]['dwmc']}",
|
||||
// style: TextStyle(fontSize: 14, fontWeight: FontWeight.bold)),
|
||||
// subtitle: Text(
|
||||
// 'dwIP:${listDwspGetList2[indexRecord]['dwip']},${listDwspGetList2[indexRecord]['dwzt']}',
|
||||
// style: TextStyle(fontSize: 10)),
|
||||
|
||||
Reference in New Issue
Block a user