【发布时间】:2020-07-01 18:42:19
【问题描述】:
当我尝试重建一个类时,我收到了上面引用的错误。我正在调用的类 ListOfIngs() 是一个基本上创建 textField 的类,但我的目标是创建大量 TextField,变量 countIngs 在 listView 中保存确切数字的值。代码如下:
body: Container(
padding: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 30.0),
child: Column(
children: <Widget>[
Row(
children: <Widget>[
Text('Ingredients',
style: GoogleFonts.biryani(fontSize: 15.0)),
IconButton(
icon: new Icon(Icons.add),
onPressed: () {
setState(() {
countings++;
});
debugPrint('$countings');
},
)
],
),
setState(() {
ListOfIngsWidget(countings);
}),
],
),
)
【问题讨论】: