listview用另一种方法检查每个项目

我有这种类型的数据列表。

  {class_wise_group: [],msg: Student Search Successful,status: true,student_list: [{ name: 10,stid: 905,admission_year: 2017,birth_certificate_no: 210036122010,class_name_id: 8,}

listview用另一种方法检查每个项目

从此列表中,我需要通过另一种方法传递stid项目数据,然后向我显示json格式的这种类型

{"status": true,"msg": "Student list for attendance successfully loaded","attendance_status": "att_signout"}

打开列表时使用方法检查每个项目的出席状态,需要自动检查。

然后我将分别更改按钮的颜色。

我可以使用onTap检查一项状态,但是当列表已经打开时,我需要检查整个列表。

 getStatus() async {

final Map<String,dynamic> jsondata = {
  'emp_id':
      'emp.text','stid': stid.text',};
var jsonresponse = null;
var response = await http.post(
  'example.com',headers: {"accept": "application/json"},body: jsondata,);

if (response.statusCode == 200) {
  jsonresponse = json.decode(response.body);
  btncolor = jsonresponse['attendance_status'];

} 
 }

我可以通过传递单个数据来检查此状态。

这是构建列表的方法

  signIn() async {
final Map<String,dynamic> jsondata = {

  "version_name":
      "version.text","class_name":
      "class.text}",};
var jsonResponse = null;
var response = await http.post(
    "example.text",headers: {
      "accept": "application/json",},body: jsondata);

if (response.statusCode == 200) {
  jsonResponse = json.decode(response.body);

  setState(() {
    _isloading = false;
    Studentlist = jsonResponse['student_list'];
    _selected = List.generate(
        Studentlist == null ? 0 : Studentlist.length,(i) => false);

  });
} 

}

我该怎么做?

qq4714167 回答:listview用另一种方法检查每个项目

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3167754.html

大家都在问