【发布时间】:2021-10-02 06:08:44
【问题描述】:
我想使用 for 之类的迭代器在 ListView 中制作一些小部件,如下例所示,
for(int i = 1; i < 3; i++ ){
Text('hello world'),
}
但不幸的是它不起作用,向我显示此错误消息。
The element type 'Set<Text>' can't be assigned to the list type 'Widget'.
我该如何解决这个问题?
感谢您关心我的问题。
【问题讨论】:
-
for(int i = 1; i < 3; i++ ) Text('hello world'),