我已经使用成功创建的卡片列表创建了列表,现在我正尝试使用“删除”按钮删除卡片,但不会将其删除
我写的代码
List<DriverList> list = DriverList.list();
按钮代码:
FlatButton(
child: Text("Cancel"),
onPressed: () {
showDialog(
context: context,
child: new AlertDialog(
title: new Text("Fair Bid"),
content: new Text("Are you sure you want to
cancel?"),
actions: <Widget>[
// usually buttons at the bottom of the dialog
new FlatButton(
child: new Text("OK"), onPressed: () {
list.removeAt(index);
}),
],
));
},