我有List>数组,我需要创建一个扩展图块。
“我的扩展图块”必须类似于以下格式。
final List<Entry> data = <Entry>[
new Entry('Varlıklar',
<Entry>[
new Entry('Vadeli Hesaplar',
<Entry>[
new Entry('TRY'),
new Entry('USD'),
new Entry('EUR'),
new Entry('GBP'),
new Entry('TL TOPLAM'),
],
),
new Entry('Vadesiz Hesaplar',
<Entry>[
new Entry('TRY'),
new Entry('USD'),
new Entry('EUR'),
new Entry('GBP'),
new Entry('TL TOPLAM'),
],
),
new Entry('Toplam',
<Entry>[
new Entry('TRY'),
new Entry('USD'),
new Entry('EUR'),
new Entry('GBP'),
new Entry('TL TOPLAM'),
],
),
],
),
new Entry('Borçlar',
<Entry>[
new Entry('Vadeli Hesaplar',
<Entry>[
new Entry('TRY'),
new Entry('USD'),
new Entry('EUR'),
new Entry('GBP'),
new Entry('TL TOPLAM'),
],
),
new Entry('Vadesiz Hesaplar',
<Entry>[
new Entry('TRY'),
new Entry('USD'),
new Entry('EUR'),
new Entry('GBP'),
new Entry('TL TOPLAM'),
],
),
new Entry('Toplam',
<Entry>[
new Entry('TRY'),
new Entry('USD'),
new Entry('EUR'),
new Entry('GBP'),
new Entry('TL TOPLAM'),
],
),
],
),
];
来自服务器的数据如下图所示。我以第一个数组值为例,并以上述格式为例;
所以我的问题是,如何在Flutter中从列表创建扩展图块?
[
[
2,
142980,
20042,
65912,
0,
758201
],
[
1,
2404,
0,
0,
0,
2404
],
[
9,
145384,
20042,
65912,
0,
760605
]
]