hyzp_ybqx-Commit042:在点位信息列表页面,对 listDwspGetList2 按 'id' 号排序,解决点位编号不连续的问题
This commit is contained in:
@@ -49,11 +49,26 @@ class _DwspPageState extends State<DwspGetList> {
|
|||||||
//按照用户选择的_selectedValue、_descending对listDwspGetList2进行排序,并延时更新
|
//按照用户选择的_selectedValue、_descending对listDwspGetList2进行排序,并延时更新
|
||||||
|
|
||||||
// 在点位视频列表页面,解决点位编号不连续的问题
|
// 在点位视频列表页面,解决点位编号不连续的问题
|
||||||
int _len = listDwspGetList2.length;
|
// int _len = listDwspGetList2.length;
|
||||||
for (int i = 0; i < _len; i++) {
|
// for (int i = 0; i < _len; i++) {
|
||||||
listDwspGetList2[i]['dwbh'] = i + 1;
|
// 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();
|
_listSort();
|
||||||
firstIndex = 0;
|
firstIndex = 0;
|
||||||
lastIndex = 7;
|
lastIndex = 7;
|
||||||
@@ -144,8 +159,11 @@ class _DwspPageState extends State<DwspGetList> {
|
|||||||
//leading: new Icon(Icons.phone),
|
//leading: new Icon(Icons.phone),
|
||||||
contentPadding: EdgeInsets.symmetric(horizontal: 15.0, vertical: 0),
|
contentPadding: EdgeInsets.symmetric(horizontal: 15.0, vertical: 0),
|
||||||
title: Text(
|
title: Text(
|
||||||
"${listDwspGetList2[indexRecord]['dwbh'].toString()}. ${listDwspGetList2[indexRecord]['dwmc']}",
|
"${listDwspGetList2[indexRecord]['id'].toString()}. ${listDwspGetList2[indexRecord]['dwmc']}",
|
||||||
style: TextStyle(fontSize: 14, fontWeight: FontWeight.bold)),
|
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(
|
// subtitle: Text(
|
||||||
// 'dwIP:${listDwspGetList2[indexRecord]['dwip']},${listDwspGetList2[indexRecord]['dwzt']}',
|
// 'dwIP:${listDwspGetList2[indexRecord]['dwip']},${listDwspGetList2[indexRecord]['dwzt']}',
|
||||||
// style: TextStyle(fontSize: 10)),
|
// style: TextStyle(fontSize: 10)),
|
||||||
|
|||||||
@@ -55,9 +55,14 @@ class _SbglPageState extends State<DwxxGetList> {
|
|||||||
listDwspGetList2 = listSbglGetList2;
|
listDwspGetList2 = listSbglGetList2;
|
||||||
|
|
||||||
// 在点位视频列表页面,解决点位编号不连续的问题
|
// 在点位视频列表页面,解决点位编号不连续的问题
|
||||||
int _len = listDwspGetList2.length;
|
// int _len = listDwspGetList2.length;
|
||||||
for (int i = 0; i < _len; i++) {
|
// for (int i = 0; i < _len; i++) {
|
||||||
listDwspGetList2[i]['dwbh'] = i + 1;
|
// listDwspGetList2[i]['dwbh'] = i + 1;
|
||||||
|
// }
|
||||||
|
|
||||||
|
listDwspGetList2.sort((_left, _right) => _left['id'].compareTo(_right['id'])); // list排序
|
||||||
|
for (var item in listDwspGetList2) {
|
||||||
|
print('item = $item');
|
||||||
}
|
}
|
||||||
|
|
||||||
listDwinfoGetList2 = listSbglGetList2;
|
listDwinfoGetList2 = listSbglGetList2;
|
||||||
@@ -123,8 +128,11 @@ class _SbglPageState extends State<DwxxGetList> {
|
|||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
ListTile(
|
ListTile(
|
||||||
//leading: new Icon(Icons.phone),
|
//leading: new Icon(Icons.phone),
|
||||||
|
// title: Text(
|
||||||
|
// "${listSbglGetList2[indexRecord]['dwbh'].toString()}. ${listSbglGetList2[indexRecord]['dwmc']}",
|
||||||
|
// style: TextStyle(fontSize: 14, fontWeight: FontWeight.bold)),
|
||||||
title: Text(
|
title: Text(
|
||||||
"${listSbglGetList2[indexRecord]['dwbh'].toString()}. ${listSbglGetList2[indexRecord]['dwmc']}",
|
"${listSbglGetList2[indexRecord]['id'].toString()}. ${listSbglGetList2[indexRecord]['dwmc']}",
|
||||||
style: TextStyle(fontSize: 14, fontWeight: FontWeight.bold)),
|
style: TextStyle(fontSize: 14, fontWeight: FontWeight.bold)),
|
||||||
subtitle: Text(
|
subtitle: Text(
|
||||||
'dwIP:${listSbglGetList2[indexRecord]['dwip']},${listSbglGetList2[indexRecord]['dwzt']}',
|
'dwIP:${listSbglGetList2[indexRecord]['dwip']},${listSbglGetList2[indexRecord]['dwzt']}',
|
||||||
|
|||||||
Reference in New Issue
Block a user