Я создал список с картами, которые он показывает успешно, сейчас я пытаюсь удалить карты с помощью кнопки удаления, но не удаляет его
код, который я написал
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);
}),
],
));
},