List<Widget> ListMyWidgets(ticketGroups) {
List<Widget> list = new List();
list.add(
new CupertinoNavigationBar(
backgroundColor: Colors.blue,
leading:
//children: <Widget>[
new Padding(
padding: new EdgeInsets.all(8.0),
child: new Text(ticketGroups[0]['ticket_name'],style: const TextStyle(fontSize: 20.0, fontFamily: 'Poppins',color: Colors.white)),
),
trailing: new Padding(
padding: new EdgeInsets.all(8.0),
child: new Text('${ticketGroups.length}', style: const TextStyle(fontSize: 20.0, fontFamily: 'Poppins',color: Colors.white))
),
)
);
for (int i = 0 ; i < ticketGroups.length; i++) {
list.add(
new GestureDetector(
// onTap: _try(ticketGroups[i]),
onTap: _try(ticketGroups[i]),
//onTap: _try(1),
// ticketGroups[i]
child:
new Card(
child: new Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
new Padding(
padding: new EdgeInsets.all(8.0),
child: new Text(ticketGroups[0]['ticket_name'],style: const TextStyle(fontSize: 15.0, fontFamily: 'Poppins')),
),
new Padding(
padding: new EdgeInsets.all(8.0),
child: new Text(ticketGroups[i]["used"].toString(), style: const TextStyle(fontSize: 15.0, fontFamily: 'Poppins'))
)
],
),
)
),
);
}
return list;
}
我不知道为什么我得到这个错误,很安静很难找出错误到底在哪里,不告诉我该行。 但是我相信发布我的代码的剪切部分会很有用,因为我很确定这是获取代码的原因。