【发布时间】:2020-07-14 05:28:08
【问题描述】:
这是一个颤振/飞镖问题,如果你想问的话。
我有以下 JSONObject:
{
"header": [
2223,
2224
],
"2223": {
"L": 3,
"A": 6,
"B": 5,
"Mode": 15,
},
"2224": {
"L": 9,
"A": 6,
"B": 1,
"Mode": 16,
}
}
首先,我从标题对象加载“目录”。
var tagsJson = jsonDecode(jsonContent)['header'];
List<String> timestamps = tagsJson != null ? List.from(tagsJson) : null;
这是我想要将值分配给的结果对象
class Result {
double L;
double A;
double B;
int mode;
Result({this.L, this.A, this.B, this.mode});
void dump()
{
print(this.L);
print(this.A);
print(this.B);
print(this.mode);
}
}
如何获取时间戳 JSONObjects 的值,并使用 Flutter 为它们分配相应的 Result Object?
【问题讨论】: