如何从列表值创建json组?

时间:2019-10-27 12:09:09

标签: flutter dart

这是我的数据

#include <bits/stdc++.h>
using namespace std;
const int MAX = 1500;
int A[MAX];
int main(int argc, char* argv[])
{
    if(argc == 2 or argc == 3) freopen(argv[1], "r", stdin);
    if(argc == 3) freopen(argv[2], "w", stdout);
    ios::sync_with_stdio(false);
    int n, hh1, hh2, mm1, mm2, smins, emins, ans;
    cin >> n;
    for (int i = 0; i < n; i++) {
        cin >> hh1 >> mm1 >> hh2 >> mm2;
        smins = hh1 * 60 + mm1;
        emins = hh2 * 60 + mm2;
        A[smins]++;
        A[emins+1]--;
    }
    ans = A[0];
    for (int i = 1; i < MAX; i++) {
        A[i] += A[i-1];
        ans = max(ans, A[i]);
    }
    cout << ans << endl;
    return 0;

}

};

我需要使用stid对此分组,因为如果我在listview中调用它,我的相同数据将显示两次。所以我需要在列表视图中显示一次。

这是我的列表视图

 static Map<String, Object> check = {
"status": false,
"msg": "Student marks list successfully loaded",
"st_mark_list": [
  {
    "id": 6129,
    "stid": 1146,
    "marks_type_id": 1,
    "marks_type": "MCQ",
    "total_mark": 30,
    "pass_mark": 10.0,
    "st_roll": 1,
    "student_id": 1819,
    "st_first_name": "Md Tofayel",
    "st_last_name": "Ahmed"
  },
  {
    "id": 6129,
    "stid": 1146,
    "marks_type_id": 2,
    "marks_type": "wrt",
    "total_mark": 70,
    "pass_mark": 23.0,
    "st_roll": 1,
    "student_id": 1819,
    "st_first_name": "Md Tofayel",
    "st_last_name": "Ahmed"
  },
  {
    "id": 15777,
    "stid": 3032,
    "marks_type_id": 1,
    "marks_type": "MCQ",
    "total_mark": 30,
    "pass_mark": 10.0,
    "st_roll": 2,
    "student_id": 3693,
    "st_first_name": "Babu",
    "st_last_name": ""
  },
]

这里是ui image

我还需要在第一个ui中添加marks_type值。

0 个答案:

没有答案