首页 > 解决方案 > 颤振:从列表中删除卡不起作用

问题描述

我已经创建了带有成功显示的卡片的列表现在我正在尝试使用删除按钮删除卡片但没有将其删除

我写的代码

   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);
                        }),
                      ],
                    ));
              }, 

标签: listdartflutter

解决方案


推荐阅读